{"version":3,"sources":["Static/scripts/Web/utilities/heatcanvas.ts","Static/scripts/Web/colorPicker.min.js","Static/scripts/Web/Client3DObjectEditor/client3dEditor.ajax.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.BaseTool.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.cameraControls.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.clientObject.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.controller.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.editablePolygon.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.editor.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.genericHolder.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.helper.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.inputHandler.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.instanceContext.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.interference.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.navigationHelper.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.pageSwitch.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.toolbox.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.tools.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.tools_conduitTool.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.tools_interference.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.tools_spacingTool.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.tools_stringingTool.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.updateManager.ts","Static/scripts/Web/Client3DObjectEditor/client3dEditor.viewModel.ts"],"names":[],"mappings":"AAAA,IAAO,OAAO,CA6Ob;AA7OD,WAAO,OAAO;IAEV,IAAM,eAAe,GAAG,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACjD,IAAM,wBAAwB,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,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AC,IAAI,CAAC,CAAC;YACnB,CAAC;YAML,qBAAC;QAAD,CAVA,AAUC,IAAA;QAVY,6BAAc,iBAU1B,CAAA;IACL,CAAC,EA/vFS,cAAc,GAAd,iBAAc,KAAd,iBAAc,QA+vFvB;AAAD,CAAC,EA/vFM,EAAE,KAAF,EAAE,QA+vFR","file":"clientEditor.js","sourcesContent":["module HeatMap {\r\n\r\n const hsla2rgbaResult = new Uint8ClampedArray(4);\r\n const defaultValue2ColorResult = new Float64Array([0, 0.8, 0, 1.0]); //h,s,l,a\r\n\r\n function hue2rgb(p, q, t) {\r\n if (t < 0) t += 1;\r\n if (t > 1) t -= 1;\r\n if (t < 1 / 6) return p + (q - p) * 6 * t;\r\n if (t < 1 / 2) return q;\r\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\r\n return p;\r\n }\r\n\r\n export enum DegreeEnum {\r\n LINEAR = 1,\r\n QUAD = 2,\r\n CUBIC = 3\r\n }\r\n\r\n export class HeatCanvas {\r\n\r\n canvas: HTMLCanvasElement;\r\n width: number;\r\n height: number;\r\n radius: number;\r\n degree: DegreeEnum;\r\n min: number;\r\n max: number;\r\n\r\n needsRender = true;\r\n\r\n data: { [x: number]: { [y: number]: number } } = {};\r\n\r\n value: { [id: number]: number } = {};\r\n\r\n bgcolor = [0, 0, 0, 255];\r\n\r\n constructor(width?: number, height?: number, radius?: number, min?: number, max?: number, degree?: DegreeEnum) {\r\n this.canvas = document.createElement('canvas') as HTMLCanvasElement;\r\n this.width = this.canvas.width = width || 512;\r\n this.height = this.canvas.height = height || 512;\r\n this.radius = radius || 1;\r\n this.degree = degree || DegreeEnum.LINEAR;\r\n this.min = min || 0;\r\n this.max = max || 100;\r\n }\r\n\r\n private calc() {\r\n var value = this.value,\r\n degree = this.degree,\r\n step = 1 / this.radius;\r\n\r\n for (var yd in this.data) {\r\n var dataY = this.data[yd];\r\n for (var xd in dataY) {\r\n var data = dataY[xd];\r\n var y = +yd;\r\n var x = +xd;\r\n var radius = Math.floor(Math.pow((data / step), 1 / degree));\r\n var radiusSq = radius * radius;\r\n\r\n // calculate point x.y \r\n for (var scanx = x - radius; scanx < x + radius; scanx += 1) {\r\n // out of extend\r\n if (scanx < 0 || scanx > this.width) {\r\n continue;\r\n }\r\n for (var scany = y - radius; scany < y + radius; scany += 1) {\r\n\r\n if (scany < 0 || scany > this.height)\r\n continue;\r\n\r\n var dx = scanx - x;\r\n var dy = scany - y;\r\n\r\n var distSq = dx * dx + dy * dy;\r\n if (distSq > radiusSq) {\r\n continue;\r\n } else {\r\n \r\n var v = data - step * Math.pow(Math.sqrt(distSq), degree);\r\n\r\n var id = Math.round(scanx) + Math.round(scany) * this.width;\r\n\r\n if (value[id]) {\r\n value[id] = value[id] + v;\r\n } else {\r\n value[id] = v;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n setRadiusDegree(radius: number, degree?: DegreeEnum) {\r\n this.radius = radius || 1;\r\n if (degree)\r\n this.degree = degree;\r\n\r\n this.needsRender = true;\r\n }\r\n\r\n setMinMax(min: number, max: number) {\r\n this.min = min || 0;\r\n this.max = max || 100;\r\n\r\n this.needsRender = true;\r\n }\r\n\r\n resize(w: number, h: number) {\r\n this.width = this.canvas.width = w;\r\n this.height = this.canvas.height = h;\r\n\r\n this.canvas.style.width = w + 'px';\r\n this.canvas.style.height = h + 'px';\r\n\r\n this.needsRender = true;\r\n }\r\n\r\n push(x: number, y: number, data: number) {\r\n // ignore all data out of extent\r\n if (x < 0 || x > this.width) {\r\n return;\r\n }\r\n if (y < 0 || y > this.height) {\r\n return;\r\n }\r\n\r\n var dataY = this.data[y];\r\n\r\n if (dataY) {\r\n dataY[x] = (dataY[x] || 0) + data;\r\n } else {\r\n this.data[y] = {};\r\n this.data[y][x] = data;\r\n }\r\n\r\n this.needsRender = true;\r\n }\r\n\r\n render() {\r\n this.calc();\r\n this.data = {};\r\n this.draw();\r\n }\r\n\r\n private draw() {\r\n var bgcolor = this.bgcolor,\r\n ctx = this.canvas.getContext(\"2d\");\r\n\r\n //ctx.clearRect(0, 0, this.width, this.height);\r\n\r\n ctx.fillStyle = `rgb(${bgcolor[0]},${bgcolor[1]},${bgcolor[2]})`;\r\n ctx.fillRect(0, 0, this.width, this.height);\r\n\r\n var canvasData = ctx.createImageData(this.width, this.height);\r\n //for (var i = 0; i < canvasData.data.length; i += 4) {\r\n // canvasData.data[i] = defaultColor[0]; // r\r\n // canvasData.data[i + 1] = defaultColor[1];\r\n // canvasData.data[i + 2] = defaultColor[2];\r\n // canvasData.data[i + 3] = defaultColor[3];\r\n //}\r\n\r\n var min = this.min,\r\n max = this.max,\r\n delta = max - min;\r\n\r\n // maximum \r\n //var maxValue = 0;\r\n //for (var id in this.value) {\r\n // maxValue = Math.max(this.value[id], maxValue);\r\n //}\r\n\r\n for (var k in this.value) {\r\n var pos = +k;\r\n var x = Math.floor(pos % this.width);\r\n var y = Math.floor(pos / this.width);\r\n\r\n // MDC ImageData:\r\n // data = [r1, g1, b1, a1, r2, g2, b2, a2 ...]\r\n var pixelColorIndex = y * this.width * 4 + x * 4;\r\n\r\n var color = HeatCanvas.hsla2rgba.apply(null, HeatCanvas.defaultValue2Color((this.value[pos] - min) / delta));\r\n canvasData.data[pixelColorIndex] = color[0]; //r\r\n canvasData.data[pixelColorIndex + 1] = color[1]; //g\r\n canvasData.data[pixelColorIndex + 2] = color[2]; //b\r\n canvasData.data[pixelColorIndex + 3] = color[3]; //a\r\n }\r\n\r\n ctx.putImageData(canvasData, 0, 0);\r\n\r\n this.needsRender = false;\r\n }\r\n\r\n clear() {\r\n this.data = {};\r\n this.value = {};\r\n\r\n this.canvas.getContext(\"2d\").clearRect(0, 0, this.width, this.height);\r\n }\r\n\r\n exportImage() {\r\n return this.canvas.toDataURL();\r\n }\r\n\r\n static defaultValue2Color(v: number) {\r\n var value = Math.min(1, Math.max(0, v));\r\n defaultValue2ColorResult[0] = (1 - value);// h\r\n defaultValue2ColorResult[2] = value * 0.6;// l\r\n return defaultValue2ColorResult;\r\n }\r\n\r\n // http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\r\n static hsla2rgba(h: number, s: number, l: number, a: number) {\r\n var r: number, g: number, b: number;\r\n\r\n if (s == 0) {\r\n r = g = b = l;\r\n } else {\r\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\r\n var p = 2 * l - q;\r\n r = hue2rgb(p, q, h + 1 / 3);\r\n g = hue2rgb(p, q, h);\r\n b = hue2rgb(p, q, h - 1 / 3);\r\n }\r\n\r\n hsla2rgbaResult[0] = r * 255;\r\n hsla2rgbaResult[1] = g * 255;\r\n hsla2rgbaResult[2] = b * 255;\r\n hsla2rgbaResult[3] = a * 255;\r\n return hsla2rgbaResult;\r\n }\r\n }\r\n\r\n}","/*! colorPicker - v1.0.0 2015-11-14 */\r\n\r\n!function(a,b){\"use strict\";function c(a,c,d,f,g){if(\"string\"==typeof c){var c=w.txt2color(c);d=c.type,n[d]=c[d],g=g!==b?g:c.alpha}else if(c)for(var h in c)a[d][h]=k(c[h]/l[d][h][1],0,1);return g!==b&&(a.alpha=k(+g,0,1)),e(d,f?a:b)}function d(a,b,c){var d=m.options.grey,e={};return e.RGB={r:a.r,g:a.g,b:a.b},e.rgb={r:b.r,g:b.g,b:b.b},e.alpha=c,e.equivalentGrey=r.round(d.r*a.r+d.g*a.g+d.b*a.b),e.rgbaMixBlack=i(b,{r:0,g:0,b:0},c,1),e.rgbaMixWhite=i(b,{r:1,g:1,b:1},c,1),e.rgbaMixBlack.luminance=h(e.rgbaMixBlack,!0),e.rgbaMixWhite.luminance=h(e.rgbaMixWhite,!0),m.options.customBG&&(e.rgbaMixCustom=i(b,m.options.customBG,c,1),e.rgbaMixCustom.luminance=h(e.rgbaMixCustom,!0),m.options.customBG.luminance=h(m.options.customBG,!0)),e}function e(a,b){var c,e,k,o=r,p=b||n,q=w,s=m.options,t=l,u=p.RND,v=\"\",x=\"\",y={hsl:\"hsv\",cmyk:\"cmy\",rgb:a},z=u.rgb;if(\"alpha\"!==a){for(var A in t)if(!t[A][A]){a!==A&&\"XYZ\"!==A&&(x=y[A]||\"rgb\",p[A]=q[x+\"2\"+A](p[x])),u[A]||(u[A]={}),c=p[A];for(v in c)u[A][v]=o.round(c[v]*(\"Lab\"===A?1:t[A][v][1]))}\"Lab\"!==a&&delete p._rgb,z=u.rgb,p.HEX=q.RGB2HEX(z),p.equivalentGrey=s.grey.r*p.rgb.r+s.grey.g*p.rgb.g+s.grey.b*p.rgb.b,p.webSave=e=f(z,51),p.webSmart=k=f(z,17),p.saveColor=z.r===e.r&&z.g===e.g&&z.b===e.b?\"web save\":z.r===k.r&&z.g===k.g&&z.b===k.b?\"web smart\":\"\",p.hueRGB=q.hue2RGB(p.hsv.h),b&&(p.background=d(z,p.rgb,p.alpha))}var B,C,D,E,F,G,H,I=p.rgb,J=p.alpha,K=\"luminance\",L=p.background,M=i,N=h,O=j,P=g;return B=M(I,{r:0,g:0,b:0},J,1),B[K]=N(B,!0),p.rgbaMixBlack=B,C=M(I,{r:1,g:1,b:1},J,1),C[K]=N(C,!0),p.rgbaMixWhite=C,s.allMixDetails&&(B.WCAG2Ratio=O(B[K],0),C.WCAG2Ratio=O(C[K],1),s.customBG&&(D=M(I,s.customBG,J,1),D[K]=N(D,!0),D.WCAG2Ratio=O(D[K],s.customBG[K]),p.rgbaMixCustom=D),E=M(I,L.rgb,J,L.alpha),E[K]=N(E,!0),p.rgbaMixBG=E,F=M(I,L.rgbaMixBlack,J,1),F[K]=N(F,!0),F.WCAG2Ratio=O(F[K],L.rgbaMixBlack[K]),F.luminanceDelta=o.abs(F[K]-L.rgbaMixBlack[K]),F.hueDelta=P(L.rgbaMixBlack,F,!0),p.rgbaMixBGMixBlack=F,G=M(I,L.rgbaMixWhite,J,1),G[K]=N(G,!0),G.WCAG2Ratio=O(G[K],L.rgbaMixWhite[K]),G.luminanceDelta=o.abs(G[K]-L.rgbaMixWhite[K]),G.hueDelta=P(L.rgbaMixWhite,G,!0),p.rgbaMixBGMixWhite=G),s.customBG&&(H=M(I,L.rgbaMixCustom,J,1),H[K]=N(H,!0),H.WCAG2Ratio=O(H[K],L.rgbaMixCustom[K]),p.rgbaMixBGMixCustom=H,H.luminanceDelta=o.abs(H[K]-L.rgbaMixCustom[K]),H.hueDelta=P(L.rgbaMixCustom,H,!0)),p.RGBLuminance=N(z),p.HUELuminance=N(p.hueRGB),s.convertCallback&&s.convertCallback(p,a),p}function f(a,b){var c={},d=0,e=b/2;for(var f in a)d=a[f]%b,c[f]=a[f]+(d>e?b-d:-d);return c}function g(a,b,c){var d=r;return(d.max(a.r-b.r,b.r-a.r)+d.max(a.g-b.g,b.g-a.g)+d.max(a.b-b.b,b.b-a.b))*(c?255:1)/765}function h(a,b){for(var c=b?1:255,d=[a.r/c,a.g/c,a.b/c],e=m.options.luminance,f=d.length;f--;)d[f]=d[f]<=.03928?d[f]/12.92:r.pow((d[f]+.055)/1.055,2.4);return e.r*d[0]+e.g*d[1]+e.b*d[2]}function i(a,c,d,e){var f={},g=d!==b?d:1,h=e!==b?e:1,i=g+h*(1-g);for(var j in a)f[j]=(a[j]*g+c[j]*h*(1-g))/i;return f.a=i,f}function j(a,b){var c=1;return c=a>=b?(a+.05)/(b+.05):(b+.05)/(a+.05),r.round(100*c)/100}function k(a,b,c){return a>c?c:b>a?b:a}var l={rgb:{r:[0,255],g:[0,255],b:[0,255]},hsv:{h:[0,360],s:[0,100],v:[0,100]},hsl:{h:[0,360],s:[0,100],l:[0,100]},cmy:{c:[0,100],m:[0,100],y:[0,100]},cmyk:{c:[0,100],m:[0,100],y:[0,100],k:[0,100]},Lab:{L:[0,100],a:[-128,127],b:[-128,127]},XYZ:{X:[0,100],Y:[0,100],Z:[0,100]},alpha:{alpha:[0,1]},HEX:{HEX:[0,16777215]}},m={},n={},o={X:[.4124564,.3575761,.1804375],Y:[.2126729,.7151522,.072175],Z:[.0193339,.119192,.9503041],R:[3.2404542,-1.5371385,-.4985314],G:[-.969266,1.8760108,.041556],B:[.0556434,-.2040259,1.0572252]},p={r:.298954,g:.586434,b:.114612},q={r:.2126,g:.7152,b:.0722},r=Math,s=parseInt,t=a.Colors=function(a){this.colors={RND:{}},this.options={color:\"rgba(204, 82, 37, 0.8)\",XYZMatrix:o,grey:p,luminance:q,valueRanges:l},u(this,a||{})},u=function(a,d){var e,f,g=a.options;v(a);for(var h in d)d[h]!==b&&(g[h]=d[h]);e=g.XYZMatrix,d.XYZReference||(g.XYZReference={X:e.X[0]+e.X[1]+e.X[2],Y:e.Y[0]+e.Y[1]+e.Y[2],Z:e.Z[0]+e.Z[1]+e.Z[2]}),f=g.customBG,g.customBG=\"string\"==typeof f?w.txt2color(f).rgb:f,n=c(a.colors,g.color,b,!0)},v=function(a){m!==a&&(m=a,n=a.colors)};t.prototype.setColor=function(a,d,f){return v(this),a?c(this.colors,a,d,b,f):(f!==b&&(this.colors.alpha=k(f,0,1)),e(d))},t.prototype.getColor=function(a){var c=this.colors,d=0;if(a){for(a=a.split(\".\");c[a[d]];)c=c[a[d++]];a.length!==d&&(c=b)}return c},t.prototype.setCustomBackground=function(a){return v(this),this.options.customBG=\"string\"==typeof a?w.txt2color(a).rgb:a,c(this.colors,b,\"rgb\")},t.prototype.saveAsBackground=function(){return v(this),c(this.colors,b,\"rgb\",!0)},t.prototype.convertColor=function(a,b){var c=w,d=l,e=b.split(\"2\"),f=e[0],g=e[1],h=/(?:RG|HS|CM|LA)/,i=h.test(f),j=h.test(g),k={LAB:\"Lab\"},m=function(a,b,c){var e={},f=\"Lab\"===b?1:0;for(var g in a)e[g]=c?r.round(a[g]*(f||d[b][g][1])):a[g]/(f||d[b][g][1]);return e};return f=d[f]?f:k[f]||f.toLowerCase(),g=d[g]?g:k[g]||g.toLowerCase(),i&&\"RGB2HEX\"!==b&&(a=m(a,f)),a=f===g?a:c[f+\"2\"+g]?c[f+\"2\"+g](a,!0):\"HEX\"===g?c.RGB2HEX(\"RGB2HEX\"===b?a:m(\"rgb\"===f?a:c[f+\"2rgb\"](a,!0),\"rgb\",!0)):c[\"rgb2\"+g](c[f+\"2rgb\"](a,!0),!0),j&&(a=m(a,g,!0)),a};var w={txt2color:function(a){var b={},c=a.replace(/(?:#|\\)|%)/g,\"\").split(\"(\"),d=(c[1]||\"\").split(/,\\s*/),e=c[1]?c[0].substr(0,3):\"rgb\",f=\"\";if(b.type=e,b[e]={},c[1])for(var g=3;g--;)f=e[g]||e.charAt(g),b[e][f]=+d[g]/l[e][f][1];else b.rgb=w.HEX2rgb(c[0]);return b.alpha=d[3]?+d[3]:1,b},RGB2HEX:function(a){return((a.r<16?\"0\":\"\")+a.r.toString(16)+(a.g<16?\"0\":\"\")+a.g.toString(16)+(a.b<16?\"0\":\"\")+a.b.toString(16)).toUpperCase()},HEX2rgb:function(a){var b=s;return a=a.split(\"\"),{r:b(a[0]+a[a[3]?1:0],16)/255,g:b(a[a[3]?2:1]+(a[3]||a[1]),16)/255,b:b((a[4]||a[2])+(a[5]||a[2]),16)/255}},hue2RGB:function(a){var b=r,c=6*a,d=~~c%6,e=6===c?0:c-d;return{r:b.round(255*[1,1-e,0,0,e,1][d]),g:b.round(255*[e,1,1,1-e,0,0][d]),b:b.round(255*[0,0,e,1,1,1-e][d])}},rgb2hsv:function(a){var b,c,d,e=r,f=a.r,g=a.g,h=a.b,i=0;return h>g&&(g=h+(h=g,0),i=-1),c=h,g>f&&(f=g+(g=f,0),i=-2/6-i,c=e.min(g,h)),b=f-c,d=f?b/f:0,{h:1e-15>d?n&&n.hsl&&n.hsl.h||0:b?e.abs(i+(g-h)/(6*b)):0,s:f?b/f:n&&n.hsv&&n.hsv.s||0,v:f}},hsv2rgb:function(a){var b=6*a.h,c=a.s,d=a.v,e=~~b,f=b-e,g=d*(1-c),h=d*(1-f*c),i=d*(1-(1-f)*c),j=e%6;return{r:[d,h,g,g,i,d][j],g:[i,d,d,h,g,g][j],b:[g,g,i,d,d,h][j]}},hsv2hsl:function(a){var b=(2-a.s)*a.v,c=a.s*a.v;return c=a.s?1>b?b?c/b:0:c/(2-b):0,{h:a.h,s:a.v||c?c:n&&n.hsl&&n.hsl.s||0,l:b/2}},rgb2hsl:function(a,b){var c=w.rgb2hsv(a);return w.hsv2hsl(b?c:n.hsv=c)},hsl2rgb:function(a){var b=6*a.h,c=a.s,d=a.l,e=.5>d?d*(1+c):d+c-c*d,f=d+d-e,g=e?(e-f)/e:0,h=~~b,i=b-h,j=e*g*i,k=f+j,l=e-j,m=h%6;return{r:[e,l,f,f,k,e][m],g:[k,e,e,l,f,f][m],b:[f,f,k,e,e,l][m]}},rgb2cmy:function(a){return{c:1-a.r,m:1-a.g,y:1-a.b}},cmy2cmyk:function(a){var b=r,c=b.min(b.min(a.c,a.m),a.y),d=1-c||1e-20;return{c:(a.c-c)/d,m:(a.m-c)/d,y:(a.y-c)/d,k:c}},cmyk2cmy:function(a){var b=a.k;return{c:a.c*(1-b)+b,m:a.m*(1-b)+b,y:a.y*(1-b)+b}},cmy2rgb:function(a){return{r:1-a.c,g:1-a.m,b:1-a.y}},rgb2cmyk:function(a,b){var c=w.rgb2cmy(a);return w.cmy2cmyk(b?c:n.cmy=c)},cmyk2rgb:function(a,b){var c=w.cmyk2cmy(a);return w.cmy2rgb(b?c:n.cmy=c)},XYZ2rgb:function(a,b){var c=r,d=m.options.XYZMatrix,e=a.X,f=a.Y,g=a.Z,h=e*d.R[0]+f*d.R[1]+g*d.R[2],i=e*d.G[0]+f*d.G[1]+g*d.G[2],j=e*d.B[0]+f*d.B[1]+g*d.B[2],l=1/2.4;return d=.0031308,h=h>d?1.055*c.pow(h,l)-.055:12.92*h,i=i>d?1.055*c.pow(i,l)-.055:12.92*i,j=j>d?1.055*c.pow(j,l)-.055:12.92*j,b||(n._rgb={r:h,g:i,b:j}),{r:k(h,0,1),g:k(i,0,1),b:k(j,0,1)}},rgb2XYZ:function(a){var b=r,c=m.options.XYZMatrix,d=a.r,e=a.g,f=a.b,g=.04045;return d=d>g?b.pow((d+.055)/1.055,2.4):d/12.92,e=e>g?b.pow((e+.055)/1.055,2.4):e/12.92,f=f>g?b.pow((f+.055)/1.055,2.4):f/12.92,{X:d*c.X[0]+e*c.X[1]+f*c.X[2],Y:d*c.Y[0]+e*c.Y[1]+f*c.Y[2],Z:d*c.Z[0]+e*c.Z[1]+f*c.Z[2]}},XYZ2Lab:function(a){var b=r,c=m.options.XYZReference,d=a.X/c.X,e=a.Y/c.Y,f=a.Z/c.Z,g=16/116,h=1/3,i=.008856,j=7.787037;return d=d>i?b.pow(d,h):j*d+g,e=e>i?b.pow(e,h):j*e+g,f=f>i?b.pow(f,h):j*f+g,{L:116*e-16,a:500*(d-e),b:200*(e-f)}},Lab2XYZ:function(a){var b=r,c=m.options.XYZReference,d=(a.L+16)/116,e=a.a/500+d,f=d-a.b/200,g=b.pow(e,3),h=b.pow(d,3),i=b.pow(f,3),j=16/116,k=.008856,l=7.787037;return{X:(g>k?g:(e-j)/l)*c.X,Y:(h>k?h:(d-j)/l)*c.Y,Z:(i>k?i:(f-j)/l)*c.Z}},rgb2Lab:function(a,b){var c=w.rgb2XYZ(a);return w.XYZ2Lab(b?c:n.XYZ=c)},Lab2rgb:function(a,b){var c=w.Lab2XYZ(a);return w.XYZ2rgb(b?c:n.XYZ=c,b)}}}(window),function(a){\"use strict\";var b='^§app alpha-bg-w\">^§slds\">^§sldl-1\">$^§sldl-2\">$^§sldl-3\">$^§curm\">$^§sldr-1\">$^§sldr-2\">$^§sldr-4\">$^§curl\">$^§curr\">$$^§opacity\">|^§opacity-slider\">$$$^§memo\">^§raster\">$^§raster-bg\">$|$|$|$|$|$|$|$|$^§memo-store\">$^§memo-cursor\">$$^§panel\">^§hsv\">^hsl-mode §ß\">$^hsv-h-ß §ß\">H$^hsv-h-~ §~\">-^§nsarrow\">$$^hsl-h-@ §@\">H$^hsv-s-ß §ß\">S$^hsv-s-~ §~\">-$^hsl-s-@ §@\">S$^hsv-v-ß §ß\">B$^hsv-v-~ §~\">-$^hsl-l-@ §@\">L$$^§hsl §hide\">^hsv-mode §ß\">$^hsl-h-ß §ß\">H$^hsl-h-~ §~\">-$^hsv-h-@ §@\">H$^hsl-s-ß §ß\">S$^hsl-s-~ §~\">-$^hsv-s-@ §@\">S$^hsl-l-ß §ß\">L$^hsl-l-~ §~\">-$^hsv-v-@ §@\">B$$^§rgb\">^rgb-r-ß §ß\">R$^rgb-r-~ §~\">-$^rgb-r-@ §ß\"> $^rgb-g-ß §ß\">G$^rgb-g-~ §~\">-$^rgb-g-@ §ß\"> $^rgb-b-ß §ß\">B$^rgb-b-~ §~\">-$^rgb-b-@ §ß\"> $$^§cmyk\">^Lab-mode §ß\">$^cmyk-c-ß §@\">C$^cmyk-c-~ §~\">-$^Lab-L-@ §@\">L$^cmyk-m-ß §@\">M$^cmyk-m-~ §~\">-$^Lab-a-@ §@\">a$^cmyk-y-ß §@\">Y$^cmyk-y-~ §~\">-$^Lab-b-@ §@\">b$^cmyk-k-ß §@\">K$^cmyk-k-~ §~\">-$^Lab-x-@ §ß\"> $$^§Lab §hide\">^cmyk-mode §ß\">$^Lab-L-ß §@\">L$^Lab-L-~ §~\">-$^cmyk-c-@ §@\">C$^Lab-a-ß §@\">a$^Lab-a-~ §~\">-$^cmyk-m-@ §@\">M$^Lab-b-ß §@\">b$^Lab-b-~ §~\">-$^cmyk-y-@ §@\">Y$^Lab-x-ß §@\"> $^Lab-x-~ §~\">-$^cmyk-k-@ §@\">K$$^§alpha\">^alpha-ß §ß\">A$^alpha-~ §~\">-$^alpha-@ §ß\">W$$^§HEX\">^HEX-ß §ß\">#$^HEX-~ §~\">-$^HEX-@ §ß\">M$$^§ctrl\">^§raster\">$^§cont\">$^§cold\">$^§col1\">| $$^§col2\">| $$^§bres\">RESET$^§bsav\">SAVE$$$^§exit\">$^§resize\">$^§resizer\">|$$$'.replace(/\\^/g,'
\").replace(/~/g,\"disp\").replace(/ß/g,\"butt\").replace(/@/g,\"labl\").replace(/\\|/g,\"
\"),c=\"är^1,äg^1,äb^1,öh^1,öh?1,öh?2,ös?1,öv?1,üh^1,üh?1,üh?2,üs?1,ül?1,.no-rgb-r är?2,.no-rgb-r är?3,.no-rgb-r är?4,.no-rgb-g äg?2,.no-rgb-g äg?3,.no-rgb-g äg?4,.no-rgb-b äb?2,.no-rgb-b äb?3,.no-rgb-b äb?4{visibility:hidden}är^2,är^3,äg^2,äg^3,äb^2,äb^3{@-image:url(_patches.png)}.§slds div{@-image:url(_vertical.png)}öh^2,ös^1,öv^1,üh^2,üs^1,ül^1{@-image:url(_horizontal.png)}ös?4,öv^3,üs?4,ül^3{@:#000}üs?3,ül^4{@:#fff}är?1{@-color:#f00}äg?1{@-color:#0f0}äb?1{@-color:#00f}är^2{@|-1664px 0}är^3{@|-896px 0}är?1,äg?1,äb?1,öh^3,ös^2,öv?2Ãœ-2432Öär?2Ãœ-2944Öär?3Ãœ-4480Öär?4Ãœ-3202Öäg^2Äöh^2{@|-640px 0}äg^3{@|-384px 0}äg?2Ãœ-4736Öäg?3Ãœ-3968Öäg?4Ãœ-3712Öäb^2{@|-1152px 0}äb^3{@|-1408px 0}äb?2Ãœ-3456Öäb?3Ãœ-4224Öäb?4Ãœ-2688Ööh^2Äär^3Ääb?4Ãœ0}öh?4,üh?4Ãœ-1664Öös^1,öv^1,üs^1,ül^1Ääg^3{@|-256px 0}ös^3,öv?4,üs^3,ül?4Ãœ-2176Öös?2,öv^2Ãœ-1920Öüh^2{@|-768px 0}üh^3,üs^2,ül?2Ãœ-5184Öüs?2,ül^2Ãœ-5824Ö.S är^2{@|-128px -128Ö.S är?1Ääg?1Ääb?1Äöh^3Äös^2Äöv?2Ãœ-1408Ö.S är?2Ääb^3Ãœ-128Ö.S är?3Ãœ-896Ö.S är?4Ãœ-256Ö.S äg^2{@|-256px -128Ö.S äg?2Ãœ-1024Ö.S äg?3Ãœ-640Ö.S äg?4Ãœ-512Ö.S äb^2{@|-128px 0}.S äb?2Ãœ-384Ö.S äb?3Ãœ-768Ö.S öh?4Äüh?4Ãœ-1536Ö.S ös^1Äöv^1Äüs^1Äül^1{@|-512px 0}.S ös^3Äöv?4Äüs^3Äül?4Ãœ-1280Ö.S ös?2Äöv^2Ãœ-1152Ö.S üh^2{@|-1024px 0}.S üh^3Äüs^2Äül?2Ãœ-5440Ö.S üs?2Äül^2Ãœ-5696Ö.XXS ös^2,.XXS öv?2Ãœ-5120Ö.XXS ös^3,.XXS öv?4,.XXS üs^3,.XXS ül^3,.XXS ül?4Ãœ-5056Ö.XXS ös?2,.XXS öv^2Ãœ-4992Ö.XXS üs^2,.XXS ül?2Ãœ-5568Ö.XXS üs?2,.XXS ül^2Ãœ-5632Ö\".replace(/Ãœ/g,\"{@|0 \").replace(/Ö/g,\"px}\").replace(/Ä/g,\",.S \").replace(/\\|/g,\"-position:\").replace(/@/g,\"background\").replace(/ü/g,\".hsl-\").replace(/ö/g,\".hsv-\").replace(/ä/g,\".rgb-\").replace(/~/g,\" .no-rgb-}\").replace(/\\?/g,\" .§sldr-\").replace(/\\^/g,\" .§sldl-\"),d='∑{@#bbb;font-family:monospace, \"Courier New\", Courier, mono;font-size:12Â¥line-ä15Â¥font-weight:bold;cursor:default;~412¥ä323Â¥?top-left-radius:7Â¥?top-Ãœ-radius:7Â¥?bottom-Ãœ-radius:7Â¥?bottom-left-radius:7¥ö@#444}.S{~266¥ä177px}.XS{~158¥ä173px}.XXS{ä105Â¥~154px}.no-alpha{ä308px}.no-alpha .§opacity,.no-alpha .§alpha{display:none}.S.no-alpha{ä162px}.XS.no-alpha{ä158px}.XXS.no-alpha{ä90px}∑,∑ div{border:none;padding:0Â¥float:none;margin:0Â¥outline:none;box-sizing:content-box}∑ div{|absolute}^s .§curm,Ǥdisp,Ǥnsarrow,∑ .§exit,∑ ø-cursor,∑ .§resize{öimage:url(_icons.png)}∑ .do-drag div{cursor:none}∑ .§opacity,ø .§raster-bg,∑ .§raster{öimage:url(_bgs.png)}∑ ^s{~287¥ä256Â¥top:10Â¥left:10Â¥overflow:hidden;cursor:crosshair}.S ^s{~143¥ä128Â¥left:9Â¥top:9px}.XS ^s{left:7Â¥top:7px}.XXS ^s{left:5Â¥top:5px}^s div{~256¥ä256Â¥left:0px}.S ^l-1,.S ^l-2,.S ^l-3,.S ^l-4{~128¥ä128px}.XXS ^s,.XXS ^s ^l-1,.XXS ^s ^l-2,.XXS ^s ^l-3,.XXS ^s ^l-4{ä64px}^s ^r-1,^s ^r-2,^s ^r-3,^s ^r-4{~31Â¥left:256Â¥cursor:default}.S ^r-1,.S ^r-2,.S ^r-3,.S ^r-4{~15¥ä128Â¥left:128px}^s .§curm{margin:-5Â¥~11¥ä11¥ö|-36px -30px}.light .§curm{ö|-7px -30px}^s .§curl,^s .§curr{~0¥ä0Â¥margin:-3px -4Â¥border:4px solid;cursor:default;left:auto;öimage:none}^s .§curl,∑ ^s .§curl-dark,.hue-dark div.§curl{Ãœ:27Â¥?@† † † #fff}.light .§curl,∑ ^s .§curl-light,.hue-light .§curl{?@† † † #000}.S ^s .§curl,.S ^s .§curr{?~3px}.S ^s .§curl-light,.S ^s .§curl{Ãœ:13px}^s .§curr,∑ ^s .§curr-dark{Ãœ:4Â¥?@† #fff † †}.light .§curr,∑ ^s .§curr-light{?@† #000 † †}∑ .§opacity{bottom:44Â¥left:10¥ä10Â¥~287¥ö|0 -87px}.S .§opacity{bottom:27Â¥left:9Â¥~143¥ö|0 -100px}.XS .§opacity{left:7Â¥bottom:25px}.XXS .§opacity{left:5Â¥bottom:23px}.§opacity div{~100%;ä16Â¥margin-top:-3Â¥overflow:hidden}.§opacity .§opacity-slider{margin:0 -4Â¥~0¥ä8Â¥?~4Â¥?style:solid;?@#eee †}∑ ø{bottom:10Â¥left:10Â¥~288¥ä31¥ö@#fff}.S ø{ä15Â¥~144Â¥left:9Â¥bottom:9px}.XS ø{left:7Â¥bottom:7px}.XXS ø{left:5Â¥bottom:5px}ø div{|relative;float:left;~31¥ä31Â¥margin-Ãœ:1px}.S ø div{~15¥ä15px}∑ .§raster,ø .§raster-bg,.S ø .§raster,.S ø .§raster-bg{|absolute;top:0¥Ü:0Â¥bottom:0Â¥left:0Â¥~100%}.S ø .§raster-bg{ö|0 -31px}∑ .§raster{opacity:0.2;ö|0 -49px}.alpha-bg-b ø{ö@#333}.alpha-bg-b .§raster{opacity:1}ø ø-cursor{|absolute;Ãœ:0¥ö|-26px -87px}∑ .light ø-cursor{ö|3px -87px}.S ø-cursor{ö|-34px -95px}.S .light ø-cursor{ö|-5px -95px}∑ .§panel{|absolute;top:10¥Ü:10Â¥bottom:10Â¥~94Â¥?~1Â¥?style:solid;?@#222 #555 #555 #222;overflow:hidden;ö@#333}.S .§panel{top:9¥Ü:9Â¥bottom:9px}.XS .§panel{display:none}.§panel div{|relative}Ǥhsv,Ǥhsl,Ǥrgb,Ǥcmyk,ǤLab,Ǥalpha,.no-alpha ǤHEX,ǤHEX{~86Â¥margin:-1px 0px 1px 4Â¥padding:1px 0px 3Â¥?top-~1Â¥?top-style:solid;?top-@#444;?bottom-~1Â¥?bottom-style:solid;?bottom-@#222;float:Ö«§hsv,Ǥhsl{padding-top:2px}.S .§hsv,.S .§hsl{padding-top:1px}ǤHEX{?bottom-style:none;?top-~0Â¥margin-top:-4Â¥padding-top:0px}.no-alpha ǤHEX{?bottom-style:none}Ǥalpha{?bottom-style:none}.S .rgb-r .§hsv,.S .rgb-g .§hsv,.S .rgb-b .§hsv,.S .rgb-r .§hsl,.S .rgb-g .§hsl,.S .rgb-b .§hsl,.S .hsv-h .§rgb,.S .hsv-s .§rgb,.S .hsv-v .§rgb,.S .hsl-h .§rgb,.S .hsl-s .§rgb,.S .hsl-l .§rgb,.S .§cmyk,.S .§Lab{display:none}Ǥbutt,Ǥlabl{float:left;~14¥ä14Â¥margin-top:2Â¥text-align:center;border:1px solid}Ǥbutt{?@#555 #222 #222 #555}Ǥbutt:active{ö@#444}Ǥlabl{?@†}«Lab-mode,«cmyk-mode,«hsv-mode,«hsl-mode{|absolute;Ãœ:0Â¥top:1¥ä50px}«hsv-mode,«hsl-mode{top:2px}«cmyk-mode{ä68px}.hsl-h .hsl-h-labl,.hsl-s .hsl-s-labl,.hsl-l .hsl-l-labl,.hsv-h .hsv-h-labl,.hsv-s .hsv-s-labl,.hsv-v .hsv-v-labl{@#f90}«cmyk-mode,«hsv-mode,.rgb-r .rgb-r-butt,.rgb-g .rgb-g-butt,.rgb-b .rgb-b-butt,.hsv-h .hsv-h-butt,.hsv-s .hsv-s-butt,.hsv-v .hsv-v-butt,.hsl-h .hsl-h-butt,.hsl-s .hsl-s-butt,.hsl-l .hsl-l-butt,«rgb-r-labl,«rgb-g-labl,«rgb-b-labl,«alpha-butt,«HEX-butt,«Lab-x-labl{?@#222 #555 #555 #222;ö@#444}.no-rgb-r .rgb-r-labl,.no-rgb-g .rgb-g-labl,.no-rgb-b .rgb-b-labl,.mute-alpha .alpha-butt,.no-HEX .HEX-butt,.cmy-only .Lab-x-labl{?@#555 #222 #222 #555;ö@#333}.Lab-x-disp,.cmy-only .cmyk-k-disp,.cmy-only .cmyk-k-butt{visibility:hidden}«HEX-disp{öimage:none}Ǥdisp{float:left;~48¥ä14Â¥margin:2px 2px 0Â¥cursor:text;text-align:left;text-indent:3Â¥?~1Â¥?style:solid;?@#222 #555 #555 #222}∑ .§nsarrow{|absolute;top:0Â¥left:-13Â¥~8¥ä16Â¥display:none;ö|-87px -23px}∑ .start-change .§nsarrow{display:block}∑ .do-change .§nsarrow{display:block;ö|-87px -36px}.do-change .§disp{cursor:default}Ǥhide{display:none}Ǥcont,Ǥcold{|absolute;top:-5Â¥left:0¥ä3Â¥border:1px solid #333}Ǥcold{z-index:1;ö@#c00}Ǥcont{margin-Ãœ:-1Â¥z-index:2}«contrast .§cont{z-index:1;ö@#ccc}«orange .§cold{ö@#f90}«green .§cold{ö@#4d0}Ǥctrl{|absolute;bottom:0Â¥left:0Â¥~100%;ö@#fff}.alpha-bg-b .§ctrl,Ǥbres,Ǥbsav{ö@#333}Ǥcol1,Ǥcol2,Ǥbres,Ǥbsav{?~1Â¥?style:solid;?@#555 #222 #222 #555;float:left;~45Â¥line-ä28Â¥text-align:center;top:0px}.§panel div div{ä100%}.S .§ctrl div{line-ä25px}.S Ǥbres,.S Ǥbsav{line-ä26px}∑ .§exit,∑ .§resize{Ãœ:3Â¥top:3Â¥~15¥ä15¥ö|0 -52px}∑ .§resize{top:auto;bottom:3Â¥cursor:nwse-resize;ö|-15px -52px}.S .§exit{ö|1px -52px}.XS .§resize,.XS .§exit{~10¥ä10¥Ü:0¥öimage:none}.XS .§exit{top:0px}.XS .§resize{bottom:0px}∑ .§resizer,∑ .§resizer div{|absolute;border:1px solid #888;top:-1¥Ü:-1Â¥bottom:-1Â¥left:-1Â¥z-index:2;display:none;cursor:nwse-resize}∑ .§resizer div{border:1px dashed #333;opacity:0.3;display:block;ö@#bbb}'.replace(/Ãœ/g,\"right\").replace(/Ö/g,\"left}\").replace(/∑/g,\".§app\").replace(/«/g,\".§panel .\").replace(/Â¥/g,\"px;\").replace(/\\|/g,\"position:\").replace(/@/g,\"color:\").replace(/ö/g,\"background-\").replace(/ä/g,\"height:\").replace(/ø/g,\".§memo\").replace(/†/g,\"transparent\").replace(/\\~/g,\"width:\").replace(/\\?/g,\"border-\").replace(/\\^/g,\".§sld\"),e=\"iVBORw0KGgoAAAANSUhEUgAABIAAAAABCAYAAACmC9U0AAABT0lEQVR4Xu2S3Y6CMBCFhyqIsjGBO1/B9/F5DC/pK3DHhVkUgc7Zqus2DVlGU/cnQZKTjznttNPJBABA149HyRf1iN//4mIBCg0jV4In+j9xJiuihly1V/Z9X88v//kNeDXVvyO/lK+IPR76B019+1Riab3H1zkmeqerKnL+Bzwxx6PAgZxaSQU8vB62T28pxcQeRQ2sHw6GxCOWHvP78zwHAARBABOfdYtd30rwxXOEPDF+dj2+91r6vV/id3k+/brrXmaGUkqKhX3i+ffSt16HQ/dorTGZTHrs7ev7Tl7XdZhOpzc651nfsm1bRFF0YRiGaJoGs9nsQuN/xafTCXEco65rzOdzHI9HJEmCqqqwXC6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ztH63lDdKebOUH5Xyk1LeKuWd/ry2tlap9P125Onp6Zf9eWpq6lW3b8f6zMzM6/71er3+ppSP+u/XNN/pz41Go+sjIMBTMEABASggQAEBKCBAAQEoIEABASggQAEB/CN/CDAAw78uW9AVDw4AAAAASUVORK5CYII=\";a.ColorPicker={_html:b,_cssFunc:c,_cssMain:d,_horizontalPng:e,_verticalPng:f,_patchesPng:g,_iconsPng:h,_bgsPng:i}}(window),function(a,b){\"use strict\";function c(a,c){var e,j=\"\",k=\"\";for(var l in c)a.options[l]=c[l];_=new Colors(a.options),delete a.options,bb=_.options,bb.scale=1,k=bb.CSSPrefix,a.color=_,S=bb.valueRanges,a.nodes=cb=g(f(a),a),q(bb.mode),d(a),u(),j=\" \"+bb.mode.type+\"-\"+bb.mode.z,cb.slds.className+=j,cb.panel.className+=j,bb.noHexButton&&C(cb.HEX_butt,k+\"butt\",k+\"labl\"),bb.size!==b&&p(b,bb.size),e={alphaBG:cb.alpha_labl,cmyOnly:cb.HEX_labl};for(var m in e)bb[m]!==b&&o({target:e[m],data:bb[m]});bb.noAlpha&&(cb.colorPicker.className+=\" no-alpha\"),a.renderMemory(bb.memoryColors),h(a),I=!0,i(b,\"init\"),N&&(d(N),w())}function d(a){Y=!0,M!==a&&(M=a,ab=a.color.colors,bb=a.color.options,cb=a.nodes,_=a.color,$={},v(ab))}function e(){var a=[\"L\",\"S\",\"XS\",\"XXS\"];bb.sizes={},cb.testNode.style.cssText=\"position:absolute;left:-1000px;top:-1000px;\",document.body.appendChild(cb.testNode);for(var b=a.length;b--;)cb.testNode.className=bb.CSSPrefix+\"app \"+a[b],bb.sizes[a[b]]=[cb.testNode.offsetWidth,cb.testNode.offsetHeight];cb.testNode.removeNode?cb.testNode.removeNode(!0):document.body.removeChild(cb.testNode)}function f(a){var b=document.createElement(\"div\"),c=bb.CSSPrefix,d=\"data:image/png;base64,\",e=function(a,b){var c=document.createElement(\"style\");c.setAttribute(\"type\",\"text/css\"),b&&c.setAttribute(\"id\",b),c.styleSheet||c.appendChild(document.createTextNode(a)),document.getElementsByTagName(\"head\")[0].appendChild(c),c.styleSheet&&(document.styleSheets[document.styleSheets.length-1].cssText=a)},f=function(a){O._cssFunc=O._cssFunc.replace(/§/g,c).replace(\"_patches.png\",a?d+O._patchesPng:bb.imagePath+\"_patches.png\").replace(\"_vertical.png\",a?d+O._verticalPng:bb.imagePath+\"_vertical.png\").replace(\"_horizontal.png\",a?d+O._horizontalPng:bb.imagePath+\"_horizontal.png\"),e(O._cssFunc,\"colorPickerCSS\"),bb.customCSS||(O._cssMain=O._cssMain.replace(/§/g,c).replace(\"_bgs.png\",a?d+O._bgsPng:bb.imagePath+\"_bgs.png\").replace(\"_icons.png\",a?d+O._iconsPng:bb.imagePath+\"_icons.png\").replace(/opacity:(\\d*\\.*(\\d+))/g,function(a,b){return R?\"-moz-opacity: \"+b+\"; -khtml-opacity: \"+b+\"; opacity: \"+b:'-ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity='+db.round(100*+b)+')\";filter: alpha(opacity='+db.round(100*+b)+\")\"}),e(O._cssMain))},g=document.createElement(\"img\");return P?a.color.options.devPicker:(document.getElementById(\"colorPickerCSS\")||(g.onload=g.onerror=function(){O._cssFunc&&f(1===this.width&&1===this.height)},g.src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==\"),(N=M)&&r(),b.insertAdjacentHTML(\"afterbegin\",M?M.nodes.colorPicker.outerHTML||(new XMLSerializer).serializeToString(M.nodes.colorPicker):O._html.replace(/§/g,c)),b=b.children[0],b.style.cssText=bb.initStyle||\"\",(bb.appendTo||document.body).appendChild(b))}function g(a){var b,c,d=a.getElementsByTagName(\"*\"),e={colorPicker:a},f=new RegExp(bb.CSSPrefix);e.styles={},e.textNodes={},e.memos=[],e.testNode=document.createElement(\"div\");for(var g=0,h=d.length;h>g;g++)b=d[g],(c=b.className)&&f.test(c)?(c=c.split(\" \")[0].replace(bb.CSSPrefix,\"\").replace(/-/g,\"_\"),/_disp/.test(c)?(c=c.replace(\"_disp\",\"\"),e.styles[c]=b.style,e.textNodes[c]=b.firstChild,b.contentEditable=!0):(/(?:hs|cmyk|Lab).*?(?:butt|labl)/.test(c)||(e[c]=b),/(?:cur|sld[^s]|opacity|cont|col)/.test(c)&&(e.styles[c]=/(?:col\\d)/.test(c)?b.children[0].style:b.style))):/memo/.test(b.parentNode.className)&&e.memos.push(b);return e.panelCover=e.panel.appendChild(document.createElement(\"div\")),e}function h(c,f){var g=f?G:F;g(cb.colorPicker,\"mousedown\",function(f){var g=f||a.event,h=E(g),n=g.target||g.srcElement,o=n.className;return d(c),J=n,i(b,\"resetEventListener\"),U=\"\",n===cb.sldl_3||n===cb.curm?(J=cb.sldl_3,I=j,U=\"changeXYValue\",C(cb.slds,\"do-drag\")):/sldr/.test(o)||n===cb.curl||n===cb.curr?(J=cb.sldr_4,I=k,U=\"changeZValue\"):n===cb.opacity.children[0]||n===cb.opacity_slider?(J=cb.opacity,I=l,U=\"changeOpacityValue\"):/-disp/.test(o)&&!/HEX-/.test(o)?(I=m,U=\"changeInputValue\",(3===n.nextSibling.nodeType?n.nextSibling.nextSibling:n.nextSibling).appendChild(cb.nsarrow),K=o.split(\"-disp\")[0].split(\"-\"),K={type:K[0],z:K[1]||\"\"},C(cb.panel,\"start-change\"),V=0):n!==cb.resize||bb.noResize?I=b:(bb.sizes||e(),J=cb.resizer,I=p,U=\"resizeApp\"),I&&(W={pageX:h.X,pageY:h.Y},J.style.display=\"block\",X=D(J),X.width=cb.opacity.offsetWidth,X.childWidth=cb.opacity_slider.offsetWidth,J.style.display=\"\",I(g),F(Q?document.body:a,\"mousemove\",I),L=a[fb](w)),/-disp/.test(o)?void 0:B(g)}),g(cb.colorPicker,\"click\",function(a){d(c),o(a)}),g(cb.colorPicker,\"dblclick\",o),g(cb.colorPicker,\"keydown\",function(a){d(c),n(a)}),g(cb.colorPicker,\"keypress\",n),g(cb.colorPicker,\"paste\",function(a){return a.target.firstChild.data=a.clipboardData.getData(\"Text\"),B(a)})}function i(c,d){var e=I;I&&(a[gb](L),G(Q?document.body:a,\"mousemove\",I),V&&(K={type:\"alpha\"},w()),(\"function\"==typeof I||\"number\"==typeof I)&&delete bb.webUnsave,V=1,I=b,C(cb.slds,\"do-drag\",\"\"),C(cb.panel,\"(?:start-change|do-change)\",\"\"),cb.resizer.style.cssText=\"\",cb.panelCover.style.cssText=\"\",cb.memo_store.style.cssText=\"background-color: \"+y(ab.RND.rgb)+\"; \"+A(ab.alpha),cb.memo.className=cb.memo.className.replace(/\\s+(?:dark|light)/,\"\")+(ab[\"rgbaMix\"+T[bb.alphaBG]].luminance<.22?\" dark\":\" light\"),K=b,s(),bb.actionCallback&&bb.actionCallback(c,U||e.name||d||\"external\"))}function j(b){var c=b||a.event,d=bb.scale,e=E(c),f=(e.X-X.left)*(4===d?2:d),g=(e.Y-X.top)*d,h=bb.mode;return ab[h.type][h.x]=z(f/255,0,1),ab[h.type][h.y]=1-z(g/255,0,1),t(),B(c)}function k(b){var c=b||a.event,d=E(c),e=(d.Y-X.top)*bb.scale,f=bb.mode;return ab[f.type][f.z]=1-z(e/255,0,1),t(),B(c)}function l(b){var c=b||a.event,d=E(c);return Y=!0,ab.alpha=z(db.round((d.X-X.left)/X.width*100),0,100)/100,t(\"alpha\"),B(c)}function m(b){var c,d=b||a.event,e=E(d),f=W.pageY-e.Y,g=bb.delayOffset,h=K.type,i=\"alpha\"===h;return V||db.abs(f)>=g?(V||(V=(f>0?-g:g)+ +J.firstChild.data*(i?100:1),W.pageY+=V,f+=V,V=1,C(cb.panel,\"start-change\",\"do-change\"),cb.panelCover.style.cssText=\"position:absolute;left:0;top:0;right:0;bottom:0\",document.activeElement.blur(),L=a[fb](w)),\"cmyk\"===h&&bb.cmyOnly&&(h=\"cmy\"),i?(Y=!0,ab.alpha=z(f/100,0,1)):(c=S[h][K.z],ab[h][K.z]=\"Lab\"===h?z(f,c[0],c[1]):z(f/c[1],0,1)),t(i?\"alpha\":h),B(d)):void 0}function n(c){var d,e=c||a.event,f=e.which||e.keyCode,g=String.fromCharCode(f),h=document.activeElement,j=h.className.replace(bb.CSSPrefix,\"\").split(\"-\"),k=j[0],l=j[1],m=\"alpha\"===k,n=\"HEX\"===k,o={k40:-1,k38:1,k34:-10,k33:10}[\"k\"+f]/(m?100:1),p={HEX:/[0-9a-fA-F]/,Lab:/[\\-0-9]/,alpha:/[\\.0-9]/}[k]||/[0-9]/,q=S[k][k]||S[k][l],r=h.firstChild,s=H(h),u=r.data,w=\"0\"!==u||n?u.split(\"\"):[];\r\nreturn/^(?:27|13)$/.test(f)?(B(e),h.blur()):\"keydown\"===e.type?(o?d=z(db.round(1e6*(+u+o))/1e6,q[0],q[1]):/^(?:8|46)$/.test(f)&&(s.range||(s.range++,s.start-=8===f?1:0),w.splice(s.start,s.range),d=w.join(\"\")||\"0\"),d!==b&&B(e,!0)):\"keypress\"===e.type&&(/^(?:37|39|8|46|9)$/.test(f)||B(e,!0),p.test(g)&&(w.splice(s.start,s.range,g),d=w.join(\"\")),s.start++),13===f&&n?r.data.length%3===0||\"0\"===r.data?M.setColor(\"0\"===r.data?\"000\":r.data,\"rgb\",ab.alpha,!0):(B(e,!0),h.focus()):(n&&d!==b&&(d=/^0+/.test(d)?d:parseInt(\"\"+d,16)||0),void(d!==b&&\"\"!==d&&+d>=q[0]&&+d<=q[1]&&(n&&(d=d.toString(16).toUpperCase()||\"0\"),m?ab[k]=+d:n||(ab[k][l]=+d/(\"Lab\"===k?1:q[1])),t(m?\"alpha\":k),v(ab),I=!0,i(c,e.type),r.data=d,H(h,db.min(h.firstChild.data.length,s.start<0?0:s.start)))))}function o(c){var d,e,f=c||a.event,g=f.target||f.srcElement,h=g.className,j=g.parentNode,k=bb,l=ab.RND.rgb,m=bb.mode,n=\"\",o=k.CSSPrefix,p=/(?:hs|rgb)/.test(j.className)&&/^[HSBLRG]$/.test(g.firstChild?g.firstChild.data:\"\"),q=/dblc/.test(f.type),r=\"\";if(!q||p){if(-1!==h.indexOf(\"-labl \"+o+\"labl\"))C(cb[h.split(\"-\")[0]],o+\"hide\",\"\"),C(cb[j.className.split(\"-\")[1]],o+\"hide\");else if(-1!==h.indexOf(o+\"butt\"))if(p)q&&2===bb.scale&&(n=/hs/.test(m.type)?\"rgb\":/hide/.test(cb.hsl.className)?\"hsv\":\"hsl\",n=n+\"-\"+n[m.type.indexOf(m.z)]),M.setMode(n?n:h.replace(\"-butt\",\"\").split(\" \")[0]),r=\"modeChange\";else if(/^[rgb]/.test(h))n=h.split(\"-\")[1],C(cb.colorPicker,\"no-rgb-\"+n,(k[\"noRGB\"+n]=!k[\"noRGB\"+n])?b:\"\"),r=\"noRGB\"+n;else if(g===cb.alpha_labl)d=k.customBG,e=k.alphaBG,C(cb.colorPicker,\"alpha-bg-\"+e,\"alpha-bg-\"+(e=k.alphaBG=c.data||(\"w\"===e?d?\"c\":\"b\":\"c\"===e?\"b\":\"w\"))),g.firstChild.data=e.toUpperCase(),cb.ctrl.style.backgroundColor=cb.memo.style.backgroundColor=\"c\"!==e?\"\":\"rgb(\"+db.round(255*d.r)+\", \"+db.round(255*d.g)+\", \"+db.round(255*d.b)+\")\",cb.raster.style.cssText=cb.raster_bg.previousSibling.style.cssText=\"c\"!==e?\"\":A(d.luminance<.22?.5:.4),r=\"alphaBackground\";else if(g===cb.alpha_butt)C(cb.colorPicker,\"mute-alpha\",(k.muteAlpha=!k.muteAlpha)?b:\"\"),r=\"alphaState\";else if(g===cb.HEX_butt)C(cb.colorPicker,\"no-HEX\",(k.HEXState=!k.HEXState)?b:\"\"),r=\"HEXState\";else if(g===cb.HEX_labl){var s=\"web save\"===ab.saveColor;\"web smart\"===ab.saveColor||s?s?M.setColor(k.webUnsave,\"rgb\"):(k.webUnsave||(k.webUnsave=x(l)),M.setColor(ab.webSave,\"rgb\")):(k.webUnsave=x(l),M.setColor(ab.webSmart,\"rgb\")),r=\"webColorState\"}else/Lab-x-labl/.test(h)&&(C(cb.colorPicker,\"cmy-only\",(k.cmyOnly=!k.cmyOnly)?b:\"\"),r=\"cmykState\");else if(g===cb.bsav)u(),r=\"saveAsBackground\";else if(g===cb.bres){var w=x(l),y=ab.alpha;M.setColor(k.color),u(),M.setColor(w,\"rgb\",y),r=\"resetColor\"}else if(j===cb.col1)ab.hsv.h-=ab.hsv.h>.5?.5:-.5,t(\"hsv\"),r=\"shiftColor\";else if(j===cb.col2)M.setColor(g.style.backgroundColor,\"rgb\",ab.background.alpha),r=\"setSavedColor\";else if(j===cb.memo){var z=function(){cb.memos.blinker&&(cb.memos.blinker.style.cssText=cb.memos.cssText)},B=function(b){cb.memos.blinker=b,b.style.cssText=\"background-color:\"+(ab.RGBLuminance>.22?\"#333\":\"#DDD\"),a.setTimeout(z,200)};if(g===cb.memo_cursor){z(),cb.memos.blinker=b,cb.testNode.style.cssText=cb.memo_store.style.cssText,cb.memos.cssText=cb.testNode.style.cssText;for(var D=cb.memos.length-1;D--;)if(cb.memos.cssText===cb.memos[D].style.cssText){B(cb.memos[D]);break}if(!cb.memos.blinker){for(var D=cb.memos.length-1;D--;)cb.memos[D+1].style.cssText=cb.memos[D].style.cssText;cb.memos[0].style.cssText=cb.memo_store.style.cssText}r=\"toMemery\"}else z(),M.setColor(g.style.backgroundColor,\"rgb\",g.style.opacity||1),cb.memos.cssText=g.style.cssText,B(g),I=1,r=\"fromMemory\"}r&&(v(ab),I=I||!0,i(c,r))}}function p(c,d){var e,f=c||a.event,g=f?E(f):{},h=d!==b,i=h?d:g.X-X.left+8,j=h?d:g.Y-X.top+8,k=[\" S XS XXS\",\" S XS\",\" S\",\"\"],l=bb.sizes,m=h?d:j10?i:10)+\"px;height: \"+(j>10?j:10)+\"px;\"}function q(a){var b={rgb_r:{x:\"b\",y:\"g\"},rgb_g:{x:\"b\",y:\"r\"},rgb_b:{x:\"r\",y:\"g\"},hsv_h:{x:\"s\",y:\"v\"},hsv_s:{x:\"h\",y:\"v\"},hsv_v:{x:\"h\",y:\"s\"},hsl_h:{x:\"s\",y:\"l\"},hsl_s:{x:\"h\",y:\"l\"},hsl_l:{x:\"h\",y:\"s\"}},c=a.replace(\"-\",\"_\"),d=\"\\\\b(?:rg|hs)\\\\w\\\\-\\\\w\\\\b\";return C(cb.panel,d,a),C(cb.slds,d,a),a=a.split(\"-\"),bb.mode={type:a[0],x:b[c].x,y:b[c].y,z:a[1]}}function r(){var a=/\\s+(?:hue-)*(?:dark|light)/g,b=\"className\";cb.curl[b]=cb.curl[b].replace(a,\"\"),cb.curr[b]=cb.curr[b].replace(a,\"\"),cb.slds[b]=cb.slds[b].replace(a,\"\"),cb.sldr_2[b]=bb.CSSPrefix+\"sldr-2\",cb.sldr_4[b]=bb.CSSPrefix+\"sldr-4\",cb.sldl_3[b]=bb.CSSPrefix+\"sldl-3\";for(var c in cb.styles)c.indexOf(\"sld\")||(cb.styles[c].cssText=\"\");$={}}function s(){cb.styles.curr.cssText=cb.styles.curl.cssText,cb.curl.className=bb.CSSPrefix+\"curl\"+(Z.noRGBZ?\" \"+bb.CSSPrefix+\"curl-\"+Z.noRGBZ:\"\"),cb.curr.className=bb.CSSPrefix+\"curr \"+bb.CSSPrefix+\"curr-\"+(\"h\"===bb.mode.z?Z.HUEContrast:Z.noRGBZ?Z.noRGBZ:Z.RGBLuminance)}function t(a){v(_.setColor(b,a||bb.mode.type)),Y=!0}function u(a){return _.saveAsBackground(),cb.styles.col2.cssText=\"background-color: \"+y(ab.background.RGB)+\";\"+A(ab.background.alpha),a&&v(ab),ab}function v(a){var c=db,d=Z,e=T[bb.alphaBG];d.hueDelta=c.round(100*a[\"rgbaMixBGMix\"+e].hueDelta),d.luminanceDelta=c.round(100*a[\"rgbaMixBGMix\"+e].luminanceDelta),d.RGBLuminance=a.RGBLuminance>.22?\"light\":\"dark\",d.HUEContrast=a.HUELuminance>.22?\"light\":\"dark\",d.contrast=d.luminanceDelta>d.hueDelta?\"contrast\":\"\",d.readabiltiy=a[\"rgbaMixBGMix\"+e].WCAG2Ratio>=7?\"green\":a[\"rgbaMixBGMix\"+e].WCAG2Ratio>=4.5?\"orange\":\"\",d.noRGBZ=bb[\"no\"+bb.mode.type.toUpperCase()+bb.mode.z]?\"g\"===bb.mode.z&&a.rgb.g<.59||\"b\"===bb.mode.z||\"r\"===bb.mode.z?\"dark\":\"light\":b}function w(){if(I){if(!Y)return L=a[fb](w);Y=!1}var c,d,e,f,g=bb,h=g.mode,i=g.scale,l=g.CSSPrefix,m=ab,n=cb,o=n.styles,p=n.textNodes,q=S,r=K,s=Z,t=$,u=db,v=A,x=y,z=0,B=0,C=m[h.type][h.x],D=u.round(255*C/(4===i?2:i)),E=m[h.type][h.y],F=1-E,G=u.round(255*F/i),H=1-m[h.type][h.z],M=u.round(255*H/i),N=[C,E],O=\"rgb\"===h.type,P=\"h\"===h.z,Q=\"hsl\"===h.type,R=Q&&\"s\"===h.z,T=I===j,U=I===k;O&&(N[0]>=N[1]?B=1:z=1,t.sliderSwap!==z&&(n.sldr_2.className=g.CSSPrefix+\"sldr-\"+(3-z),t.sliderSwap=z)),(O&&!U||P&&!T||!P&&!U)&&(o[P?\"sldl_2\":\"sldr_2\"][O?\"cssText\":\"backgroundColor\"]=O?v((N[z]-N[B])/(1-N[B]||0)):x(m.hueRGB)),P||(U||(o.sldr_4.cssText=v(O?N[B]:R?u.abs(1-2*F):F)),T||(o.sldl_3.cssText=v(Q&&\"l\"===h.z?u.abs(1-2*H):H)),Q&&(f=R?\"sldr_4\":\"sldl_3\",d=R?\"r-\":\"l-\",e=R?F>.5?4:3:H>.5?3:4,t[f]!==e&&(n[f].className=g.CSSPrefix+\"sld\"+d+e,t[f]=e))),U||(o.curm.cssText=\"left: \"+D+\"px; top: \"+G+\"px;\"),T||(o.curl.top=M+\"px\"),r&&(o.curr.top=M+\"px\"),(r&&\"alpha\"===r.type||J===n.opacity)&&(o.opacity_slider.left=g.opacityPositionRelative?m.alpha*((X.width||n.opacity.offsetWidth)-(X.childWidth||n.opacity_slider.offsetWidth))+\"px\":100*m.alpha+\"%\"),o.col1.cssText=\"background-color: \"+x(m.RND.rgb)+\"; \"+(g.muteAlpha?\"\":v(m.alpha)),o.opacity.backgroundColor=x(m.RND.rgb),o.cold.width=s.hueDelta+\"%\",o.cont.width=s.luminanceDelta+\"%\";for(c in p)d=c.split(\"_\"),g.cmyOnly&&(d[0]=d[0].replace(\"k\",\"\")),e=d[1]?m.RND[d[0]][d[1]]:m.RND[d[0]]||m[d[0]],t[c]!==e&&(t[c]=e,p[c].data=e>359.5&&\"HEX\"!==c?0:e,\"HEX\"===c||g.noRangeBackground||(e=m[d[0]][d[1]]!==b?m[d[0]][d[1]]:m[d[0]],\"Lab\"===d[0]&&(e=(e-q[d[0]][d[1]][0])/(q[d[0]][d[1]][1]-q[d[0]][d[1]][0])),o[c].backgroundPosition=u.round(100*(1-e))+\"% 0%\"));d=m._rgb?[m._rgb.r!==m.rgb.r,m._rgb.g!==m.rgb.g,m._rgb.b!==m.rgb.b]:[],d.join(\"\")!==t.outOfGammut&&(n.rgb_r_labl.firstChild.data=d[0]?\"!\":\" \",n.rgb_g_labl.firstChild.data=d[1]?\"!\":\" \",n.rgb_b_labl.firstChild.data=d[2]?\"!\":\" \",t.outOfGammut=d.join(\"\")),s.noRGBZ&&t.noRGBZ!==s.noRGBZ&&(n.curl.className=l+\"curl \"+l+\"curl-\"+s.noRGBZ,U||(n.curr.className=l+\"curr \"+l+\"curr-\"+s.noRGBZ),t.noRGBZ=s.noRGBZ),t.HUEContrast!==s.HUEContrast&&\"h\"===h.z?(n.slds.className=n.slds.className.replace(/\\s+hue-(?:dark|light)/,\"\")+\" hue-\"+s.HUEContrast,U||(n.curr.className=l+\"curr \"+l+\"curr-\"+s.HUEContrast),t.HUEContrast=s.HUEContrast):t.RGBLuminance!==s.RGBLuminance&&(n.colorPicker.className=n.colorPicker.className.replace(/\\s+(?:dark|light)/,\"\")+\" \"+s.RGBLuminance,U||\"h\"===h.z||s.noRGBZ||(n.curr.className=l+\"curr \"+l+\"curr-\"+s.RGBLuminance),t.RGBLuminance=s.RGBLuminance),(t.contrast!==s.contrast||t.readabiltiy!==s.readabiltiy)&&(n.ctrl.className=n.ctrl.className.replace(\" contrast\",\"\").replace(/\\s*(?:orange|green)/,\"\")+(s.contrast?\" \"+s.contrast:\"\")+(s.readabiltiy?\" \"+s.readabiltiy:\"\"),t.contrast=s.contrast,t.readabiltiy=s.readabiltiy),t.saveColor!==m.saveColor&&(n.HEX_labl.firstChild.data=m.saveColor?\"web save\"===m.saveColor?\"W\":\"M\":\"!\",t.saveColor=m.saveColor),g.renderCallback&&g.renderCallback(m,h),I&&(L=a[fb](w))}function x(a){var b={};for(var c in a)b[c]=a[c];return b}function y(a,b){for(var c=\"\",d=(b||\"rgb\").split(\"\"),e=d.length;e--;)c=\", \"+a[d[e]]+c;return(b||\"rgb\")+\"(\"+c.substr(2)+\")\"}function z(a,b,c){return a>c?c:b>a?b:a}function A(a){return a===b&&(a=1),R?\"opacity: \"+db.round(1e10*a)/1e10+\";\":\"filter: alpha(opacity=\"+db.round(100*a)+\");\"}function B(b,c){return b.preventDefault?b.preventDefault():b.returnValue=!1,c||(a.getSelection?a.getSelection().removeAllRanges():document.selection.empty()),!1}function C(a,c,d){return a?a.className=d!==b?a.className.replace(new RegExp(\"\\\\s+?\"+c,\"g\"),d?\" \"+d:\"\"):a.className+\" \"+c:!1}function D(b){var c=b.getBoundingClientRect?b.getBoundingClientRect():{top:0,left:0},d=b&&b.ownerDocument,e=d.body,f=d.defaultView||d.parentWindow||a,g=d.documentElement||e.parentNode,h=g.clientTop||e.clientTop||0,i=g.clientLeft||e.clientLeft||0;return{left:c.left+(f.pageXOffset||g.scrollLeft)-i,top:c.top+(f.pageYOffset||g.scrollTop)-h}}function E(b){var c=a.document;return{X:b.pageX||b.clientX+c.body.scrollLeft+c.documentElement.scrollLeft,Y:b.pageY||b.clientY+c.body.scrollTop+c.documentElement.scrollTop}}function F(a,b,c){F.cache=F.cache||{_get:function(a,b,c,d){for(var e=F.cache[b]||[],f=e.length;f--;)if(a===e[f].obj&&\"\"+c==\"\"+e[f].func)return c=e[f].func,d||(e[f]=e[f].obj=e[f].func=null,e.splice(f,1)),c},_set:function(a,b,c){var d=F.cache[b]=F.cache[b]||[];return F.cache._get(a,b,c,!0)?!0:void d.push({func:c,obj:a})}},!c.name&&F.cache._set(a,b,c)||\"function\"!=typeof c||(a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent(\"on\"+b,c))}function G(a,b,c){\"function\"==typeof c&&(c.name||(c=F.cache._get(a,b,c)||c),a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent(\"on\"+b,c))}function H(c,d){var e={};if(d===b){if(a.getSelection){c.focus();var f=a.getSelection().getRangeAt(0),g=f.cloneRange();g.selectNodeContents(c),g.setEnd(f.endContainer,f.endOffset),e={end:g.toString().length,range:f.toString().length}}else{c.focus();var f=document.selection.createRange(),g=document.body.createTextRange();g.moveToElementText(c),g.setEndPoint(\"EndToEnd\",f),e={end:g.text.length,range:f.text.length}}return e.start=e.end-e.range,e}if(-1==d&&(d=c.text().length),a.getSelection)c.focus(),a.getSelection().collapse(c.firstChild,d);else{var h=document.body.createTextRange();h.moveToElementText(c),h.moveStart(\"character\",d),h.collapse(!0),h.select()}return d}var I,J,K,L,M,N,O=a.ColorPicker,P=!O,Q=document.createStyleSheet!==b&&document.getElementById||!!a.MSInputMethodContext,R=\"undefined\"!=typeof document.body.style.opacity,S={},T={w:\"White\",b:\"Black\",c:\"Custom\"},U=\"\",V=1,W={},X={},Y=!0,Z={},$={},_={},ab={},bb={},cb={},db=Math,eb=\"AnimationFrame\",fb=\"request\"+eb,gb=\"cancel\"+eb,hb=[\"ms\",\"moz\",\"webkit\",\"o\"],ib=function(a){this.options={color:\"rgba(204, 82, 37, 0.8)\",mode:\"rgb-b\",fps:60,delayOffset:8,CSSPrefix:\"cp-\",allMixDetails:!0,alphaBG:\"w\",imagePath:\"\"},c(this,a||{})};a.ColorPicker=ib,ib.addEvent=F,ib.removeEvent=G,ib.getOrigin=D,ib.limitValue=z,ib.changeClass=C,ib.prototype.setColor=function(a,b,c,e){d(this),K=!0,v(_.setColor.apply(_,arguments)),e&&this.startRender(!0)},ib.prototype.saveAsBackground=function(){return d(this),u(!0)},ib.prototype.setCustomBackground=function(a){return d(this),_.setCustomBackground(a)},ib.prototype.startRender=function(b){d(this),b?(I=!1,w(),this.stopRender()):(I=1,L=a[fb](w))},ib.prototype.stopRender=function(){d(this),a[gb](L),K&&(I=1,i(b,\"external\"))},ib.prototype.setMode=function(a){d(this),q(a),r(),w()},ib.prototype.destroyAll=function(){var a=this.nodes.colorPicker,b=function(a){for(var c in a)(a[c]&&\"[object Object]\"===a[c].toString()||a[c]instanceof Array)&&b(a[c]),a[c]=null,delete a[c]};this.stopRender(),h(this,!0),b(this),a.parentNode.removeChild(a),a=null},ib.prototype.renderMemory=function(a){var c=this.nodes.memos,d=[];\"string\"==typeof a&&(a=a.replace(/^'|'$/g,\"\").replace(/\\s*/,\"\").split(\"','\"));for(var e=c.length;e--;)a&&\"string\"==typeof a[e]&&(d=a[e].replace(\"rgba(\",\"\").replace(\")\",\"\").split(\",\"),a[e]={r:d[0],g:d[1],b:d[2],a:d[3]}),c[e].style.cssText=\"background-color: \"+(a&&a[e]!==b?y(a[e])+\";\"+A(a[e].a||1):\"rgb(0,0,0);\")},F(Q?document.body:a,\"mouseup\",i);for(var jb=hb.length;jb--&&!a[fb];)a[fb]=a[hb[jb]+\"Request\"+eb],a[gb]=a[hb[jb]+\"Cancel\"+eb]||a[hb[jb]+\"CancelRequest\"+eb];a[fb]=a[fb]||function(b){return a.setTimeout(b,1e3/bb.fps)},a[gb]=a[gb]||function(b){return a.clearTimeout(b),L=null}}(window),function(a,b){a.fn.extend({colorPicker:function(c){var d=function(b,c){var d=this,e=a(d.input),f=a(d.patch),g=b.RND.rgb,h=b.RND.hsl,i=d.isIE8?(b.alpha<.16?\"0\":\"\")+Math.round(100*b.alpha).toString(16).toUpperCase()+b.HEX:\"\",j=g.r+\", \"+g.g+\", \"+g.b,k=\"rgba(\"+j+\", \"+b.alpha+\")\",l=1!==b.alpha&&!d.isIE8,m=e.data(\"colorMode\");f.css({color:b.rgbaMixCustom.luminance>.22?\"#222\":\"#ddd\",\"background-color\":k,filter:d.isIE8?\"progid:DXImageTransform.Microsoft.gradient(startColorstr=#\"+i+\",endColorstr=#\"+i+\")\":\"\"}),e.val(\"HEX\"!==m||l?\"rgb\"===m||\"HEX\"===m&&l?l?k:\"rgb(\"+j+\")\":\"hsl\"+(l?\"a(\":\"(\")+h.h+\", \"+h.s+\"%, \"+h.l+\"%\"+(l?\", \"+b.alpha:\"\")+\")\":\"#\"+(d.isIE8?i:b.HEX)),d.displayCallback&&d.displayCallback(b,c,d)},e=function(a){return a.value||a.getAttribute(\"value\")||a.style.backgroundColor||\"#FFFFFF\"},f=function(b,c){var d=this,e=j.current;if(\"toMemery\"===c){for(var f,g=e.nodes.memos,h=\"\",i=0,k=[],l=0,m=g.length;m>l;l++)f=a(g[l]),h=f.css(\"background-color\"),i=Math.round(100*f.css(\"opacity\"))/100,k.push(h.replace(/, /g,\",\").replace(\"rgb(\",\"rgba(\").replace(\")\",\",\"+i+\")\"));k=\"'\"+k.join(\"','\")+\"'\",a.docCookies(\"colorPickerMemos\"+(d.noAlpha?\"NoAlpha\":\"\"),k)}else if(\"resizeApp\"===c)a.docCookies(\"colorPickerSize\",e.color.options.currentSize);else if(\"modeChange\"===c){var n=e.color.options.mode;a.docCookies(\"colorPickerMode\",n.type+\"-\"+n.z)}},g=function(c,g){var h={klass:b.ColorPicker,input:c,patch:c,isIE8:!!document.all&&!document.addEventListener,animationSpeed:200,draggable:!0,margin:{left:-1,top:2},customBG:\"#FFFFFF\",color:e(c),initStyle:\"display: none\",mode:a.docCookies(\"colorPickerMode\")||\"hsv-h\",memoryColors:a.docCookies(\"colorPickerMemos\"+((g||{}).noAlpha?\"NoAlpha\":\"\")),size:a.docCookies(\"colorPickerSize\")||1,renderCallback:d,actionCallback:f};for(var i in g)h[i]=g[i];return new h.klass(h)},h=function(d,f,h){var k=h?\"off\":\"on\";a(d)[k](\"focus.colorPicker\",function(){var b=a(this),h=b.offset(),k=f?a(i).index(this):0,l=j[k]||(j[k]=g(this,c)),m=l.color.options,n=a.ui&&m.draggable?a(l.nodes.colorPicker).draggable({cancel:\".\"+m.CSSPrefix+\"app div\"}):a(l.nodes.colorPicker);m.color=e(d),n.css({position:\"absolute\",left:h.left+m.margin.left,top:h.top+ +b.outerHeight(!0)+m.margin.top}),f||(m.input=d,m.patch=d,l.setColor(e(d),void 0,void 0,!0),l.saveAsBackground()),j.current=j[k],a(m.appendTo||document.body).append(n),setTimeout(function(){n.show(l.color.options.animationSpeed)},0)}),a(b)[k](\"mousedown.colorPicker\",function(b){var c=j.current,d=a(c?c.nodes.colorPicker:void 0),e=c?c.color.options.animationSpeed:0,f=a(b.target).closest(\".cp-app\")[0],g=a(i).index(b.target);f&&c&&a(j).index(f)?b.target===c.nodes.exit&&(d.hide(e),a(\":focus\").trigger(\"blur\")):-1!==g||d.hide(e)})},i=this,j=a.fn.colorPicker.colorPickers||[],k=new b.Colors({customBG:c&&c.customBG||\"#FFFFFF\",allMixDetails:!0});return a.fn.colorPicker.colorPickers=j,a(this).each(function(d,f){if(a(f).off(\".colorPicker\"),a(b).off(\".colorPicker\"),\"destroy\"!==c){var g=e(f),i=g.split(\"(\");a(f).data(\"colorMode\",i[1]?i[0].substr(0,3):\"HEX\"),h(f,c&&c.multipleInstances,!1),c&&c.readOnly&&(f.readOnly=!0),k.setColor(g),c&&c.init&&c.init(f,k.colors)}}),this}}),a.docCookies=function(a,b,c){var d,e,f,g,h=encodeURIComponent,i=decodeURIComponent,j={};if(void 0===b){for(d=document.cookie.split(\"; \")||[],e=d.length;e--;)f=d[e].split(\"=\"),f[0]&&(j[i(f.shift())]=i(f.join(\"=\")));return a?j[a]:j}c=c||{},(\"\"===b||c.expires<0)&&(c.expires=-1),void 0!==c.expires&&(g=new Date,g.setDate(g.getDate()+c.expires)),document.cookie=h(a)+\"=\"+h(b)+(g?\"; expires=\"+g.toUTCString():\"\")+(c.path?\"; path=\"+c.path:\"\")+(c.domain?\"; domain=\"+c.domain:\"\")+(c.secure?\"; secure\":\"\")}}(jQuery,this);\r\n","module LS.Client3DEditor.Ajax {\r\n\r\n const cacheKeyEditor3DData = 'Editor3DData';\r\n const cacheKeyEditorClientObjectData = 'EditorClientObjectData';\r\n\r\n var initialized = false;\r\n\r\n export var defaultModuleAppearance: IModuleAppearance = null;\r\n export var selectableModuleIds: string[] = null;\r\n\r\n export var clientObjectConfiguration: { [type: string]: IClientObjectConfiguration } = {};\r\n\r\n var layoutClientObjectType: string = null;\r\n var layoutModuleId: string = null;\r\n\r\n var loadingManager = new THREE.LoadingManager();\r\n\r\n export function init(roofTexturesLoaded: () => void) {\r\n if (initialized)\r\n return;\r\n initialized = true;\r\n\r\n loadingManager.onLoad = roofTexturesLoaded;\r\n\r\n var bindings: AManager.IAjaxBindings = {\r\n \"/WebServices/AppServices.asmx/CheckLoadBackup\": null,\r\n \"/WebServices/AppServices.asmx/SaveKonstrukctionValuesAnordnung\": null,\r\n \"/Areas/Electric/WebServices/ElectricServices.asmx/CreateModuleConnection\": null,\r\n \"/Areas/Electric/WebServices/ElectricServices.asmx/DeleteModuleConnection\": null,\r\n \"/Areas/Electric/WebServices/ElectricServices.asmx/GetConduitComponentSets\": null,\r\n \"/Areas/Electric/WebServices/ElectricServices.asmx/SetConduitObjects\": null,\r\n \"/WebServices/ShadeService.asmx/CalculateAllShadowObjects\": null,\r\n \"/WebServices/ShadeService.asmx/DeleteShadowObjects\": null,\r\n \"/WebServices/ShadeService.asmx/HasShadowsToCalculate\": null,\r\n \"/WebServices/Anordnung3DService.asmx/GetAnlagen\": null,\r\n \"/WebServices/Anordnung3DService.asmx/GetAnordnungObjects\": GetAnordnungObjects,\r\n \"/WebServices/Anordnung3DService.asmx/GetAutoCADObjects\": null,\r\n \"/WebServices/Anordnung3DService.asmx/GetCurrentRoofObject\": GetCurrentRoofObject,\r\n \"/WebServices/Anordnung3DService.asmx/GetElectricObjects\": null,\r\n \"/WebServices/Anordnung3DService.asmx/GetStaticObjects\": null,\r\n \"/WebServices/Anordnung3DService.asmx/HandleClientObjectChanges\": { method: HandleClientObjectChanges, onFinished: SaveChanges },\r\n \"/WebServices/Anordnung3DService.asmx/SetInterferenceStates\": { method: SetInterferenceStates, onFinished: SaveInterferences },\r\n \"/WebServices/Anordnung3DService.asmx/ChangeModuleObjectAppearance\": null,\r\n \"/WebServices/Anordnung3DService.asmx/ChangeModuleObjectTypes\": null,\r\n \"/WebServices/Anordnung3DService.asmx/DeleteClientObjects\": { method: DeleteClientObjects, onFinished: SaveChanges },\r\n \"/WebServices/Anordnung3DService.asmx/DeleteDimensionAligned\": null,\r\n \"/WebServices/Anordnung3DService.asmx/FillWithGetClient3DObects\": null,\r\n \"/WebServices/Anordnung3DService.asmx/GenerateWithGetClient3DObects\": GenerateWithGetClient3DObects,\r\n \"/WebServices/Anordnung3DService.asmx/GetAllClient3DObects\": null,\r\n \"/WebServices/Anordnung3DService.asmx/InsertClientObjects\": { method: InsertClientObjects, onFinished: SaveChanges },\r\n \"/WebServices/Anordnung3DService.asmx/InsertClientObjectByRect\": { method: InsertClientObjectByRect, onFinished: SaveChanges },\r\n \"/WebServices/Anordnung3DService.asmx/ResetConstructed\": null,\r\n \"/WebServices/Anordnung3DServiceBuildings.asmx/EditBuilding\": null,\r\n \"/WebServices/Anordnung3DServiceBuildings.asmx/EditBuildings\": null,\r\n \"/WebServices/Anordnung3DServiceBuildings.asmx/GetBuilding\": null,\r\n \"/WebServices/Anordnung3DServiceBuildings.asmx/RemoveBuildings\": null,\r\n \"/WebServices/ProjectServices.asmx/SwitchInstanceholder\": null\r\n };\r\n\r\n AManager.RegisterAjaxBindings(bindings);\r\n\r\n }\r\n\r\n //#region save and load\r\n\r\n async function GetAnordnungObjects(compressData: boolean) {\r\n var { result, editorData, clientObjectData } = await GetEditorData();\r\n\r\n await Promise.all([SaveDataForEditor3D(editorData), SaveDataForClientObjects(clientObjectData)]);\r\n\r\n return result;\r\n }\r\n\r\n async function GetCurrentRoofObject() {\r\n var { result } = await GetEditorData();\r\n\r\n return result;\r\n }\r\n\r\n async function GetEditorData(withClientObjects = true) {\r\n var instanceHolderId = spt.Utils.GenerateGuid();\r\n\r\n var result: SolarProTool.IEditorViewObject = {\r\n InstanceHolderId: instanceHolderId,\r\n InstanceHolderConfiguration: {\r\n PvModuleId: null,\r\n InstanceHolderType: \"RoofAreaObject\",\r\n MountingSystemType: \"FixationTypeObject\",\r\n MountingSystemId: null,\r\n IsElevation: false,\r\n IsEastWest: false\r\n },\r\n RoofObject: {\r\n LayerType: null,\r\n position: null,\r\n rotation: null,\r\n quaternion: null,\r\n scale: null,\r\n visible: true,\r\n castShadow: false,\r\n receiveShadow: false,\r\n layers: null,\r\n renderOrder: 0,\r\n Id: null,\r\n ThreeJSType: \"Object3D\"\r\n },\r\n RoofPolygons: [],\r\n SurfacePolygons: null,\r\n RoofWidth: 17137,\r\n RoofHeight: 7863,\r\n BoundsWidth: 17137,\r\n BoundsHeight: 7863,\r\n BoundsDepth: 21000,\r\n BoundsX: 0,\r\n BoundsY: 0,\r\n BoundsZ: -16677.300115434184,\r\n RoofOrientation: 164.96,\r\n GlobalOrientationRadian: 0.26249751949994706,\r\n Orientation: 164.96,\r\n LayoutOrientation: 0,\r\n LayoutOrientationMoveToZero: {\r\n x: 0,\r\n y: 0,\r\n z: 0,\r\n ThreeJSType: \"Vector3\"\r\n },\r\n RoofAngle: 33.35,\r\n RoofAngleX: 0.286942563603662,\r\n RoofAngleY: 0,\r\n RoofAngleZ: 0,\r\n RoofAngleW: 0.9579477883436854,\r\n ModuleNominalPower: 325,\r\n HasShadows: false,\r\n ClientObjects: [],\r\n RoofAreaStartX: \"100\",\r\n RoofAreaStartY: \"100\",\r\n RoofAreaDistanceToRoofBorder: \"\",\r\n GroundZ: -16677.300115434184,\r\n IsElevation: false,\r\n ElevationType: null,\r\n FixationType: \"GenericFixationLayoutCalculator\",\r\n RoofBackgroundType: 0,\r\n HasMapsBackground: true,\r\n DisplayMode: 0,\r\n Layers: null,\r\n MeasureObjects: [],\r\n BuildingClassName: \"SolarCalcObjects.BuildingObject\",\r\n BuildingSettings: [],\r\n LatLngPolygon: [],\r\n WorldOrigin: {\r\n Latitude: 46.62681167293274,\r\n Longitude: 14.300340820531794\r\n },\r\n WorldCenter: {\r\n Latitude: 46.6268601385711,\r\n Longitude: 14.30043791760981\r\n },\r\n EditorViewObjects: [],\r\n ProcessStep: 5,\r\n HeatmapDataPoints: null,\r\n HeatMapMinValue: 0,\r\n HeatMapMaxValue: 100,\r\n HeatMapRadius: 10,\r\n ConduitObjects: null,\r\n DirectedAreas: [],\r\n InterferenceObjects: []\r\n };\r\n\r\n return (await setData(result, withClientObjects));\r\n }\r\n\r\n async function setData(result: SolarProTool.IEditorViewObject, withClientObjects: boolean) {\r\n let [editorData, clientObjectData] = await Promise.all([GetDataForEditor3D(), GetDataForClientObjects()]);\r\n\r\n //if (!editorData)\r\n //\teditorData = extractMapDrawerData(await MapDrawing.Ajax.GetDataForMapDrawer());\r\n\r\n if (!editorData)\r\n return { result, editorData, clientObjectData };\r\n\r\n var pvModuleId: string,\r\n clientObjectType: string,\r\n pvModule: IPVModule,\r\n pvModuleViewmodel = LS.Client3DEditor.Controller.Current.viewModel.additionalViewmodels[\"PVModuleViewmodel\"] as lsAo3d.PVModuleViewmodel;\r\n\r\n //debugger;\r\n\r\n if (!clientObjectData || !clientObjectData.clientObjects.length || !clientObjectData.clientObjects.some(co => !!co.positions.length) || !clientObjectConfiguration[clientObjectData.clientObjects[0].config.ClientObjectType]) {\r\n //automatic layout if no clientobjects present\r\n pvModuleId = selectableModuleIds[0];\r\n clientObjectType = await getDefaultModuleType(editorData.roofType); // Object.keys(clientObjectConfiguration)[0];\r\n pvModule = await lsAo3d.getPvModule(pvModuleId);\r\n clientObjectData = await generateLayout(result.InstanceHolderId, editorData, clientObjectType, pvModule);\r\n } else {\r\n pvModule = clientObjectData.pvModule;\r\n pvModuleId = pvModule.PVModuleId;\r\n clientObjectType = await getDefaultModuleType(editorData.roofType); // clientObjectData.clientObjects[0].config.ClientObjectType;\r\n result.InstanceHolderId = clientObjectData.instanceHolderId;\r\n }\r\n\r\n var config = clientObjectConfiguration[clientObjectType];\r\n\r\n result.ModuleNominalPower = pvModule.MODULENOMINALPOWER;\r\n\r\n //TODO was wenn modul nicht gefunden?\r\n pvModuleViewmodel.setModuleById(pvModule.PVModuleId);\r\n\r\n result.RoofObject = buildRoofObject(editorData.poly, editorData.roofAngle, editorData.roofHeight);\r\n\r\n result.RoofAngle = editorData.roofAngle;\r\n\r\n\r\n var roofAngle = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 0, 1), editorData.roofAngle / 180 * Math.PI);\r\n\r\n var v = new THREE.Vector3(),\r\n bounds = new MapDrawing.Bounds2D(editorData.bounds),\r\n boundsLatLng = new MapDrawing.BoundsLatLng(editorData.boundsLatLng);\r\n\r\n var upperZ = editorData.poly.max(p => v.set(p.x, p.y, 0).applyQuaternion(roofAngle).z);\r\n var lowerZ = Math.min(0, upperZ - editorData.roofHeight);\r\n\r\n result.GroundZ = lowerZ;\r\n\r\n result.RoofAngleX = roofAngle.x;\r\n result.RoofAngleY = roofAngle.y;\r\n result.RoofAngleZ = roofAngle.z;\r\n result.RoofAngleW = roofAngle.w;\r\n\r\n result.LatLngPolygon = editorData.poly.map(p => { return { Latitude: p.latitude, Longitude: p.longitude }; });\r\n result.WorldOrigin = { Latitude: boundsLatLng.Min.Latitude, Longitude: boundsLatLng.Min.Longitude };\r\n result.WorldCenter = { Latitude: boundsLatLng.Center.Latitude, Longitude: boundsLatLng.Center.Longitude };\r\n\r\n result.RoofPolygons = [editorData.poly.map(p => new THREE.Vector3(p.x, p.y, 0))];\r\n result.RoofAreaPolygons = offsetPolygon(result.RoofPolygons, -config.DistanceToRoofBorder);\r\n result.RoofWidth = bounds.Delta.x;\r\n result.RoofHeight = bounds.Delta.y;\r\n result.BoundsWidth = bounds.Delta.x;\r\n result.BoundsHeight = bounds.Delta.y;\r\n result.BoundsDepth = editorData.buildingHeight;\r\n result.BoundsX = 0;\r\n result.BoundsY = 0;\r\n result.BoundsZ = lowerZ;\r\n\r\n if (withClientObjects) {\r\n result.ClientObjects = buildClientObjects(clientObjectData);\r\n result.InterferenceObjects = mapShapesToInterferences(result.InstanceHolderId, editorData.interferenceMapShapes);\r\n }\r\n\r\n return { result, editorData, clientObjectData };\r\n }\r\n\r\n export async function EraseDataForEditor3D() {\r\n await localforage.removeItem(cacheKeyEditor3DData);\r\n }\r\n\r\n export async function GetDataForEditor3D() {\r\n return (await localforage.getItem(cacheKeyEditor3DData)) || null;\r\n }\r\n\r\n export async function SaveDataForEditor3D(data: IEditorData) {\r\n await localforage.setItem(cacheKeyEditor3DData, data || null);\r\n }\r\n\r\n export async function EraseDataForClientObjects() {\r\n await localforage.removeItem(cacheKeyEditorClientObjectData);\r\n }\r\n\r\n export async function GetDataForClientObjects() {\r\n const clientObjectData = await localforage.getItem(cacheKeyEditorClientObjectData);\r\n \r\n // there are some wrong serialized eco clientObjects where the GeneratorTyp is a number.\r\n // if the GeneratorTyp is a number please map to string like below:\r\n // 0 => \"Module\"\r\n // 1 => \"NorthSouth\"\r\n // 2 => \"EastWest\"\r\n if (clientObjectData && clientObjectData.clientObjects && clientObjectData.clientObjects.length) {\r\n\r\n for (let clientObject of clientObjectData.clientObjects) {\r\n if (!clientObject.config)\r\n continue;\r\n \r\n const generatorTyp = clientObject.config.GeneratorType as any;\r\n if (typeof generatorTyp === 'number') {\r\n let correctMappedGeneratorType = \"\";\r\n if (generatorTyp === 0) {\r\n correctMappedGeneratorType = \"Module\";\r\n }\r\n else if (generatorTyp === 1) {\r\n correctMappedGeneratorType = \"NorthSouth\";\r\n }\r\n else if (generatorTyp === 2) {\r\n correctMappedGeneratorType = \"EastWest\";\r\n } else {\r\n correctMappedGeneratorType = \"Module\";\r\n }\r\n (clientObject.config.GeneratorType as any) = correctMappedGeneratorType;\r\n }\r\n\r\n if (!clientObject.moduleAppearance)\r\n continue;\r\n\r\n // all properties of clientObject.moduleAppearance object will be lowerFirstLetter\r\n for (const [oldKey, value] of Object.entries(clientObject.moduleAppearance)) {\r\n const newKey = lowerFirstLetter(oldKey);\r\n if (newKey === oldKey)\r\n continue; // to prevent deleting existing propertys from object\r\n delete Object.assign(clientObject.moduleAppearance, { [newKey]: value })[oldKey];\r\n }\r\n }\r\n }\r\n\r\n return clientObjectData || null;\r\n }\r\n\r\n function lowerFirstLetter(source: string) {\r\n return source.charAt(0).toLowerCase() + source.slice(1);\r\n }\r\n\r\n export async function SaveDataForClientObjects(data: IEditorClientObjectData) {\r\n await localforage.setItem(cacheKeyEditorClientObjectData, data || null);\r\n }\r\n\r\n export async function SaveChanges() {\r\n LoaderManager.addLoadingJob();\r\n\r\n await asyncTimeout(0);\r\n\r\n let controller = LS.Client3DEditor.Controller.Current,\r\n clientObjectData = await GetDataForClientObjects(),\r\n pvModule = clientObjectData.pvModule,\r\n instanceHolderId = clientObjectData.instanceHolderId,\r\n clientObjects = Object.keys(controller.Objects).map(key => controller.Objects[key]),\r\n moduleAppearance = generateAppearanceFromModule(pvModule);\r\n\r\n var clientObjectsData: IClientObjectsData[] = clientObjects.map(clientObject => {\r\n var instances = clientObject.ClientObjectInstances,\r\n config = clientObjectConfiguration[clientObject.dataType],\r\n { width, height } = calculateModuleDimension(config, pvModule.MODULEWIDTH, pvModule.MODULELENGTH),\r\n positions = instances.map(inst => { return { X: inst.instanceData.X, Y: inst.instanceData.Y }; });\r\n return { positions, width, height, config, moduleAppearance };\r\n });\r\n\r\n clientObjectData = {\r\n instanceHolderId,\r\n pvModule,\r\n clientObjects: clientObjectsData\r\n };\r\n\r\n await SaveDataForClientObjects(clientObjectData);\r\n\r\n LoaderManager.finishLoadingJob();\r\n }\r\n\r\n export async function SaveInterferences() {\r\n LoaderManager.addLoadingJob();\r\n\r\n var [editorData, mapDrawerData] = await Promise.all([GetDataForEditor3D(), MapDrawing.Ajax.GetDataForMapDrawer()]),\r\n roofShape = editorData.roofShape,\r\n controller = LS.Client3DEditor.Controller.Current,\r\n viewModel = controller.viewModel,\r\n interferenceObjects = viewModel.interferenceObjects as DynamicInterferenceObject[],\r\n roofPoly = roofShape.borders[0],\r\n roofCoords = roofPoly.points,\r\n slopeRad = roofPoly.slope / 180 * Math.PI,\r\n orientationRad = MapDrawing.calculateOrientationRad(roofCoords),\r\n worldOrigin = MapDrawing.calculateWorldOrigin(orientationRad, roofCoords),\r\n interMapShapes = interferenceObjects.map(inter => interferenceToMapShape(inter, worldOrigin, orientationRad, slopeRad, true));\r\n\r\n //replace interference shapes\r\n mapDrawerData.Shapes = mapDrawerData.Shapes.filter(s => !s.TypeName.startsWith(InterfernceTypeName)).concat(interMapShapes);\r\n\r\n await MapDrawing.Ajax.SaveMapDrawerData({ data: mapDrawerData });\r\n\r\n LoaderManager.finishLoadingJob();\r\n }\r\n\r\n //#endregion\r\n\r\n //#region roofobject, interferences and module layout\r\n\r\n export function calculateModuleDimension(config: IClientObjectConfiguration, moduleWidth: number, moduleHeight: number) {\r\n var width: number,\r\n height: number;\r\n\r\n if (config.ModuleHorizontal) {\r\n width = moduleHeight;\r\n height = moduleWidth;\r\n } else {\r\n width = moduleWidth;\r\n height = moduleHeight;\r\n }\r\n\r\n switch (config.GeneratorType) {\r\n case \"Module\":\r\n break;\r\n case \"NorthSouth\":\r\n height = Math.cos(config.ElevationAngle / 180 * Math.PI) * height;\r\n break;\r\n case \"EastWest\":\r\n width = Math.cos(config.ElevationAngle / 180 * Math.PI) * width * 2 + config.DistanceBetweenLeftAndRight;\r\n break;\r\n }\r\n\r\n if (config.GeometricWidth > 0)\r\n width = config.GeometricWidth;\r\n\r\n if (config.GeometricHeight > 0)\r\n height = config.GeometricHeight;\r\n\r\n width += config.GeometricMarginX;\r\n height += config.GeometricMarginY;\r\n\r\n return { width, height };\r\n }\r\n\r\n export async function generateLayout(instanceHolderId: string, data: IEditorData, clientObjectType: string, pvModule: IPVModule, layoutMask?: SolarProTool.Point2D[], additionalInterferences: SolarProTool.Point2D[][] = []) {\r\n var config = clientObjectConfiguration[clientObjectType],\r\n roofPolys: SolarProTool.Point2D[][] = data.roofShape.borders.map(b => b.points.map(p => { return { X: p.x, Y: p.y } })),\r\n interPolys: SolarProTool.Point2D[][] = [],\r\n { width, height } = calculateModuleDimension(config, pvModule.MODULEWIDTH, pvModule.MODULELENGTH);\r\n\r\n data.interferenceMapShapes.forEach(inter => {\r\n interPolys.pushAll(inter.borders.map(b => b.points.map(p => { return { X: p.x, Y: p.y } })));\r\n });\r\n\r\n var layoutResult = await lsAo3d.calculateLayout({\r\n LayoutAreas: roofPolys,\r\n Interferences: interPolys.concat(additionalInterferences),\r\n LayoutMask: layoutMask || null,\r\n LayoutShapeWidth: width,\r\n LayoutShapeHeight: height,\r\n Config: config\r\n });\r\n\r\n var positions = layoutResult.positions;\r\n\r\n var moduleAppearance = generateAppearanceFromModule(pvModule);\r\n\r\n var result: IEditorClientObjectData = {\r\n instanceHolderId,\r\n pvModule,\r\n clientObjects: [{ positions, width, height, config, moduleAppearance }]\r\n };\r\n\r\n return result;\r\n }\r\n\r\n export function extractMapDrawerData(data: SolarProTool.MapDrawerData) {\r\n if (!data)\r\n return null;\r\n\r\n var mapShapes = data.Shapes;\r\n\r\n if (!mapShapes || !mapShapes.length)\r\n return null;\r\n\r\n var { boundsLatLng, bounds } = MapDrawing.extractBounds(mapShapes);\r\n if (!boundsLatLng.isValid())\r\n return null;\r\n\r\n var buildingShape = mapShapes.find(s => s.TypeName == BuildingTypeName && s.borders != null && s.borders.length);\r\n var buildingOrientation = 180;\r\n\r\n if (buildingShape.mapSouthMarker != null) {\r\n var buildingOrientationRad = buildingShape.mapSouthMarker.Orientation;\r\n var buildingOrientation = (180 - buildingOrientationRad / Math.PI * 180) % 360;\r\n if (buildingOrientation < 0)\r\n buildingOrientation += 360;\r\n buildingOrientation = Math.round(buildingOrientation * 100) / 100;\r\n }\r\n\r\n var buildingBorder = buildingShape.borders[0];\r\n var useProjection = buildingBorder.useProjection;\r\n var buildingPoints = buildingBorder.points;\r\n\r\n if (buildingPoints == null || buildingPoints.length <= 2)\r\n return null;\r\n\r\n if (buildingBorder.isClockwise) {\r\n buildingPoints.reverse();\r\n buildingBorder.isClockwise = false;\r\n }\r\n\r\n var latitude = buildingPoints.sum(p => p.latitude) / buildingPoints.length;\r\n var longitude = buildingPoints.sum(p => p.longitude) / buildingPoints.length;\r\n\r\n var projectLocation = new MapDrawing.LatLng(latitude, longitude);\r\n\r\n if (!projectLocation.IsValid())\r\n return null;\r\n\r\n var roofShapes = mapShapes.filter(s => s.TypeName == RoofTypeName && s.borders != null && s.borders.length);\r\n\r\n if (!roofShapes.length)\r\n return null;\r\n\r\n var buildingHeight = roofShapes.max(s => s.borders[0].points.max(p => p.z));\r\n var roofShape = roofShapes.find(s => s.IsActive);\r\n\r\n if (!roofShape)\r\n return null;\r\n\r\n var border = roofShape.borders[0];\r\n\r\n var roofAngle = border.slope;\r\n\r\n var roofType = border.slope > 5 ? LS.Client3DEditor.RoofType.SlopingRoof : LS.Client3DEditor.RoofType.FlatRoof;\r\n\r\n var poly = border.points;\r\n\r\n if (!poly || poly.length <= 2)\r\n return null;\r\n\r\n if (border.isClockwise) {\r\n poly.reverse();\r\n border.isClockwise = false;\r\n }\r\n\r\n var roofHeight = poly.max(p => p.z);\r\n\r\n var interferenceMapShapes = mapShapes.filter(s => s.TypeName.startsWith(InterfernceTypeName));\r\n\r\n var result: IEditorData = {\r\n buildingOrientation,\r\n buildingHeight,\r\n projectLocation: { Latitude: projectLocation.Latitude, Longitude: projectLocation.Longitude },\r\n useProjection,\r\n roofAngle,\r\n roofType,\r\n roofShapes,\r\n roofShape,\r\n poly,\r\n boundsLatLng: { Min: { Latitude: boundsLatLng.Min.Latitude, Longitude: boundsLatLng.Min.Longitude }, Max: { Latitude: boundsLatLng.Max.Latitude, Longitude: boundsLatLng.Max.Longitude } },\r\n bounds: { Min: { X: bounds.Min.X, Y: bounds.Min.Y }, Max: { X: bounds.Max.X, Y: bounds.Max.Y } },\r\n roofHeight,\r\n interferenceMapShapes\r\n };\r\n\r\n return result;\r\n }\r\n\r\n export function offsetPolygon(polys: { x: number, y: number, z?: number }[][], offset: number, pointPrecision = 1000) {\r\n var arcSamplingLength = 10, //10 mm\r\n paths = spt.ThreeJs.utils.PointsToPaths(polys, pointPrecision),\r\n offsetPaths = new ClipperLib.Paths(),\r\n co = new ClipperLib.ClipperOffset(),\r\n dist = offset * pointPrecision;\r\n\r\n co.ArcTolerance = Math.abs(offset) * pointPrecision * (1 - Math.cos(arcSamplingLength / Math.abs(offset) * 0.5));\r\n co.AddPaths(paths, ClipperLib.JoinType.jtRound, ClipperLib.EndType.etClosedPolygon);\r\n co.Execute(offsetPaths, dist);\r\n\r\n return spt.ThreeJs.utils.PathsToPoints(offsetPaths, pointPrecision);\r\n }\r\n\r\n export function buildRoofObject(poly: SolarProTool.MapCoord[], slope: number, height: number) {\r\n\r\n var obj = new THREE.Object3D(),\r\n textureLoader = new THREE.TextureLoader(loadingManager);\r\n if (!poly)\r\n return obj;\r\n\r\n var latLngs = poly.map(p => new MapDrawing.LatLng(p.latitude, p.longitude)),\r\n tilemapCalculator = new MapDrawing.TiledMapCalculator(latLngs, 21),\r\n tilemapCalculatorSides = new MapDrawing.TiledMapCalculator(latLngs, 19, 32),\r\n geo = new THREE.Geometry(),\r\n geoSides = new THREE.Geometry(),\r\n index = 0;\r\n\r\n //build geometry\r\n var count = poly.length;\r\n\r\n var uvs = tilemapCalculator.CalculateUvs(poly.map(p => new MapDrawing.LatLng(p.latitude, p.longitude))),\r\n uvsSides = tilemapCalculatorSides.CalculateUvs(poly.map(p => new MapDrawing.LatLng(p.latitude, p.longitude))),\r\n vIndizes = THREE.ShapeUtils.triangulateShape(poly.map(p => new THREE.Vector2(p.x, p.y)), []),\r\n slopeRad = slope / 180 * Math.PI,\r\n transform = new THREE.Matrix4().makeRotationX(slopeRad),\r\n upperZ = 0;\r\n\r\n for (var i = 0; i < count; i++) {\r\n var v = poly[i],\r\n p = new THREE.Vector3(v.x, v.y, 0).applyMatrix4(transform);\r\n upperZ = Math.max(upperZ, p.z);\r\n geo.vertices.push(p);\r\n geoSides.vertices.push(p);\r\n }\r\n\r\n var lowerZ = Math.min(0, upperZ - height);\r\n\r\n for (var m = 0, l2 = vIndizes.length; m < l2; m++) {\r\n var ind = vIndizes[m];\r\n\r\n var a = ind[0], b = ind[1], c = ind[2];\r\n\r\n geo.faces.push(new THREE.Face3(a + index, b + index, c + index));\r\n geoSides.faces.push(new THREE.Face3(a + index + count, c + index + count, b + index + count));\r\n\r\n geo.faceVertexUvs[0].push([new THREE.Vector2(uvs[a].x, uvs[a].y), new THREE.Vector2(uvs[b].x, uvs[b].y), new THREE.Vector2(uvs[c].x, uvs[c].y)]);\r\n geoSides.faceVertexUvs[0].push([new THREE.Vector2(uvsSides[a].x, uvsSides[a].y), new THREE.Vector2(uvsSides[c].x, uvsSides[c].y), new THREE.Vector2(uvsSides[b].x, uvsSides[b].y)]);\r\n }\r\n\r\n for (var i = count - 1, j = 0; j < count; j++) {\r\n\r\n var a = i + count,\r\n b = j + count,\r\n c = j,\r\n d = i;\r\n\r\n geoSides.vertices.push(geo.vertices[j + index].clone().setZ(lowerZ));\r\n\r\n geoSides.faces.push(new THREE.Face3(a + index, b + index, c + index));\r\n geoSides.faces.push(new THREE.Face3(a + index, c + index, d + index));\r\n\r\n geoSides.faceVertexUvs[0].push([new THREE.Vector2(uvsSides[i].x, uvsSides[i].y), new THREE.Vector2(uvsSides[j].x, uvsSides[j].y), new THREE.Vector2(uvsSides[j].x, uvsSides[j].y)]);\r\n geoSides.faceVertexUvs[0].push([new THREE.Vector2(uvsSides[i].x, uvsSides[i].y), new THREE.Vector2(uvsSides[j].x, uvsSides[j].y), new THREE.Vector2(uvsSides[i].x, uvsSides[i].y)]);\r\n\r\n i = j;\r\n }\r\n\r\n geo.computeFaceNormals();\r\n geo.computeBoundingSphere();\r\n\r\n geoSides.computeFaceNormals();\r\n geoSides.computeBoundingSphere();\r\n\r\n index = geo.vertices.length;\r\n\r\n //https://localhost:44324/handler/StaticImagesHandler.ashx?ID=GoogleSatellite¢er=-33.86464287175366,151.20835304260254&zoom=21&size=256x256&scale=1\r\n var map = spt.ThreeJs.JsonConverter.loadTextureFromUrlStatic(\"/handler/StaticImagesHandler.ashx?\" + tilemapCalculator.GetMapsUrlParameter(\"GoogleSatellite\"), textureLoader);\r\n map.anisotropy = 16;\r\n map.minFilter = THREE.LinearFilter;\r\n\r\n var mat = new THREE.MeshLambertMaterial({\r\n color: new THREE.Color(0xFFFFFF),\r\n fog: false,\r\n map: map,\r\n transparent: false,\r\n side: THREE.FrontSide\r\n });\r\n\r\n var mesh = new THREE.Mesh(new THREE.BufferGeometry().fromGeometry(geo), mat);\r\n\r\n obj.add(mesh);\r\n\r\n var mapBlurred = spt.ThreeJs.JsonConverter.loadTextureFromUrlStatic(\"/handler/StaticImagesHandler.ashx?\" + tilemapCalculatorSides.GetMapsUrlParameter(\"GoogleSatellite\"), textureLoader);\r\n mapBlurred.minFilter = THREE.LinearFilter;\r\n\r\n var matSides = new THREE.MeshLambertMaterial({\r\n color: new THREE.Color(0xFFFFFF),\r\n fog: false,\r\n map: mapBlurred,\r\n transparent: false,\r\n side: THREE.FrontSide\r\n });\r\n\r\n var meshSides = new THREE.Mesh(new THREE.BufferGeometry().fromGeometry(geoSides), matSides);\r\n\r\n obj.add(meshSides);\r\n\r\n return obj;\r\n }\r\n\r\n export function mapShapesToInterferences(baseParentId: string, mapShapes: SolarProTool.MapShape[]) {\r\n var index = 1;\r\n\r\n var result = mapShapes.map(mapShape => {\r\n var poly = mapShape.borders[0],\r\n data: number[] = [];\r\n\r\n if (poly.isClockwise) {\r\n poly.isClockwise = false;\r\n poly.points.reverse();\r\n }\r\n\r\n poly.points.forEach(p => { data.push(p.x, p.y, p.z); });\r\n\r\n var res: SolarProTool.IInterference3DObject = {\r\n IsParallel: mapShape.IsParallel,\r\n Name: mapShape.Title || (\"Störfläche \" + index),\r\n Type: \"DynamicInterferenceObject\",\r\n TypeId: null,\r\n Settings: null,\r\n BaseParentId: baseParentId.toLowerCase(),\r\n IdString: (mapShape.IdString || spt.Utils.GenerateGuid()).toLowerCase(),\r\n ClientOptions: 0,\r\n Data: data\r\n };\r\n\r\n ++index;\r\n\r\n return res;\r\n });\r\n\r\n return result;\r\n }\r\n\r\n export function interferenceToMapShape(inter: DynamicInterferenceObject, globalOrigin: MapDrawing.LatLng, globalOrientationRad = 0, slopeRad = 0, useProjection = true) {\r\n var poly = inter.localPolygon.array.map(p => new MapDrawing.Point2D(p.x, p.y)),\r\n coords = MapDrawing.calculateGlobalCoordinates(poly, globalOrigin, globalOrientationRad, useProjection ? slopeRad : 0, inter.height, 0),\r\n latLngs = coords.map(c => new MapDrawing.LatLng(c.latitude, c.longitude)),\r\n boundsLatLng = MapDrawing.BoundsLatLng.FromLatLngs(latLngs),\r\n bounds = MapDrawing.Bounds2D.FromPoints(poly),\r\n mapPoly: SolarProTool.MapPolygon = {\r\n points: coords,\r\n isClockwise: MapDrawing.Point2D.isClockwise(poly),\r\n minLat: boundsLatLng.Min.Latitude,\r\n minLng: boundsLatLng.Min.Longitude,\r\n maxLat: boundsLatLng.Max.Latitude,\r\n maxLng: boundsLatLng.Max.Longitude,\r\n minx: bounds.Min.x,\r\n miny: bounds.Min.y,\r\n maxx: bounds.Max.x,\r\n maxy: bounds.Max.y,\r\n width: bounds.Delta.x,\r\n height: bounds.Delta.y,\r\n slope: 0,\r\n useProjection: useProjection\r\n };\r\n\r\n var result: SolarProTool.MapShape = {\r\n IdString: inter.IdString.toLowerCase(),\r\n TypeName: InterfernceTypeName,\r\n Title: inter.Name || \"\",\r\n borders: [mapPoly],\r\n IsParallel: inter.IsParallel,\r\n mapSouthMarker: null,\r\n IsActive: true,\r\n separationPolylines: null,\r\n cuttingPolylines: null,\r\n SlopeOverride: false\r\n };\r\n\r\n return result;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region generate client objects (geometry, material, etc.)\r\n\r\n function calculateBounds(clientObject: ClientObject, x = 0, y = 0, target?: THREE.Box3) {\r\n if (!target)\r\n target = new THREE.Box3();\r\n\r\n let bb = clientObject.ClientObjectGeometry.boundingBox,\r\n sizeX = 1, //instanceData.SizeX,\r\n sizeY = 1, //instanceData.SizeY,\r\n w = clientObject.userData.GeoWidth || ((bb.max.x - bb.min.x) * sizeX),\r\n h = clientObject.userData.GeoHeight || ((bb.max.y - bb.min.y) * sizeY),\r\n d = bb.max.z;\r\n\r\n target.min.set(x, y, 0);\r\n target.max.set(x + w, y + h, d);\r\n\r\n return target;\r\n }\r\n\r\n export function generateAppearanceFromModule(pvModule: IPVModule): IModuleAppearance {\r\n return $.extend({}, defaultModuleAppearance, {\r\n appearanceWidth: pvModule.MODULEWIDTH,\r\n appearanceHeight: pvModule.MODULELENGTH,\r\n appearanceDepth: pvModule.MODULETHICKNESS\r\n });\r\n }\r\n\r\n function getModuleAppearance(mod?: IModuleAppearance, modWidth = 900, modHeight = 1900, notInstanced = false, blending = THREE.NormalBlending, opacity = 1, reflection: THREE.CubeTexture = null, reflect90Degree = false, makeGray = false) {\r\n if (!mod)\r\n mod = defaultModuleAppearance;\r\n\r\n var frameColor = new THREE.Color(mod.moduleFramingDrawingColor);\r\n var color = new THREE.Color(mod.moduleDrawingColor);\r\n var backsheetColor = new THREE.Color(mod.moduleBacksheetDrawingColor);\r\n\r\n var cellType = mod.moduleCellType;\r\n var cellRows = mod.solarCellRows;\r\n var cellCols = mod.solarCellColumns;\r\n var framingWidth = mod.moduleFramingWidth;\r\n var dimension = new THREE.Vector2(modWidth, modHeight);\r\n var cellEdgeRound = mod.solarCellEdgeRoundness;\r\n var cellEColumn = mod.solarCellECols;\r\n var cellPadding = mod.solarCellPadding;\r\n var cellWidth = (modWidth - framingWidth * 2) / cellCols;\r\n var cellHeight = (modHeight - framingWidth * 2) / cellRows;\r\n\r\n if (makeGray) {\r\n frameColor = spt.ThreeJs.utils.colorToGrayscale(frameColor);\r\n color = spt.ThreeJs.utils.colorToGrayscale(color);\r\n backsheetColor = spt.ThreeJs.utils.colorToGrayscale(backsheetColor);\r\n }\r\n\r\n return new THREE.ModuleAppearanceShader(cellType, color.getHex(), cellCols, cellRows, dimension.x, dimension.y, framingWidth, notInstanced, blending, opacity, reflection, frameColor.getHex(), backsheetColor.getHex(), cellWidth, cellHeight, cellEdgeRound, cellEColumn, cellPadding, reflect90Degree);\r\n }\r\n\r\n function GetDefaultAppearance(color?: THREE.Color, map?: THREE.Texture, transparent = false, side = THREE.FrontSide, notInstanced = false, noDepth = false, isDistanceMap = false, alpha = 1, noInstanceColors = false, hasScale = false) {\r\n return new THREE.DefaultAppearanceShader(map, color || new THREE.Color(0xFFFFFF), side, transparent, notInstanced, noDepth, isDistanceMap, alpha, noInstanceColors, hasScale);\r\n }\r\n\r\n function getModuleFrameAppearance(mod?: IModuleAppearance) {\r\n if (!mod)\r\n mod = defaultModuleAppearance;\r\n return GetDefaultAppearance(new THREE.Color(mod.moduleFramingDrawingColor));\r\n }\r\n\r\n function getModuleElevationAppearance(mod?: IModuleAppearance) {\r\n return GetDefaultAppearance(new THREE.Color(\"#333333\"));\r\n }\r\n\r\n export function buildModuleMeshes(mod: IModuleAppearance, config: IClientObjectConfiguration, transforms?: THREE.Matrix4[]) {\r\n\r\n \r\n if (!transforms || transforms.length === 0)\r\n transforms = [new THREE.Matrix4()];\r\n\r\n var withElevationObject = config.WithElevationObject,\r\n withGroundPlane = config.WithGroundPlane,\r\n elevationHas90SlopeOnGround = config.ElevationHas90SlopeOnGround,\r\n modWidth = mod.appearanceWidth,\r\n modHeight = mod.appearanceHeight,\r\n depth = mod.appearanceDepth;\r\n\r\n if (depth <= 0)\r\n depth = 5;\r\n\r\n var vertices = [\r\n new THREE.Vector3(0, 0, depth), new THREE.Vector3(modWidth, 0, depth), new THREE.Vector3(modWidth, modHeight, depth), new THREE.Vector3(0, modHeight, depth),\r\n new THREE.Vector3(0, 0, 0), new THREE.Vector3(modWidth, 0, 0), new THREE.Vector3(modWidth, modHeight, 0), new THREE.Vector3(0, modHeight, 0),\r\n ];\r\n var uvs = [\r\n new THREE.Vector2(0, 0), new THREE.Vector2(1, 0), new THREE.Vector2(1, 1), new THREE.Vector2(0, 1),\r\n new THREE.Vector2(0, 0), new THREE.Vector2(1, 0), new THREE.Vector2(1, 1), new THREE.Vector2(0, 1),\r\n ];\r\n\r\n var normalMatrix = new THREE.Matrix3(),\r\n moduleNormal = new THREE.Vector3(0, 0, 1),\r\n pt = new THREE.Vector3(0, 0, 0),\r\n off = new THREE.Vector3(config.GeometricStartX || 0, config.GeometricStartY || 0, 0),\r\n groundPlane = new THREE.Plane().setFromNormalAndCoplanarPoint(moduleNormal, pt),\r\n ray = new THREE.Ray(),\r\n geoMod = new THREE.Geometry(),\r\n geoSides = new THREE.Geometry(),\r\n geoElevation = new THREE.Geometry();\r\n\r\n transforms.forEach(transform => {\r\n var geoIndex = geoMod.vertices.length,\r\n sideIndex = geoSides.vertices.length,\r\n eleIndex = geoElevation.vertices.length;\r\n\r\n for (var i = 0; i < 8; ++i) {\r\n var v = vertices[i].clone().applyMatrix4(transform).add(off);\r\n if (i < 4)\r\n geoMod.vertices.push(v);\r\n geoSides.vertices.push(v);\r\n if (withElevationObject && i >= 4)\r\n geoElevation.vertices.push(v);\r\n }\r\n\r\n geoMod.faces.push(new THREE.Face3(0 + geoIndex, 1 + geoIndex, 2 + geoIndex));\r\n geoMod.faces.push(new THREE.Face3(0 + geoIndex, 2 + geoIndex, 3 + geoIndex));\r\n\r\n geoMod.faceVertexUvs[0].push([uvs[0], uvs[1], uvs[2]]);\r\n geoMod.faceVertexUvs[0].push([uvs[0], uvs[2], uvs[3]]);\r\n\r\n if (!withElevationObject) {\r\n geoSides.faces.push(new THREE.Face3(4 + geoIndex, 7 + geoIndex, 6 + geoIndex));\r\n geoSides.faces.push(new THREE.Face3(4 + geoIndex, 6 + geoIndex, 5 + geoIndex));\r\n\r\n geoSides.faceVertexUvs[0].push([uvs[4], uvs[7], uvs[6]]);\r\n geoSides.faceVertexUvs[0].push([uvs[4], uvs[6], uvs[5]]);\r\n }\r\n\r\n for (var i = 3, j = 0; j < 4; j++) {\r\n\r\n var a = i + 4,\r\n b = j + 4,\r\n c = j,\r\n d = i;\r\n\r\n geoSides.faces.push(new THREE.Face3(a + sideIndex, b + sideIndex, c + sideIndex));\r\n geoSides.faces.push(new THREE.Face3(a + sideIndex, c + sideIndex, d + sideIndex));\r\n\r\n geoSides.faceVertexUvs[0].push([uvs[a], uvs[b], uvs[c]]);\r\n geoSides.faceVertexUvs[0].push([uvs[a], uvs[c], uvs[d]]);\r\n\r\n i = j;\r\n }\r\n\r\n if (withElevationObject) {\r\n moduleNormal.set(0, 0, -1);\r\n if (!elevationHas90SlopeOnGround) {\r\n normalMatrix.getNormalMatrix(transform);\r\n moduleNormal.applyMatrix3(normalMatrix);\r\n }\r\n\r\n if (moduleNormal.z >= 0)\r\n moduleNormal.set(0, 0, -1);\r\n\r\n for (var i = 0; i < 4; ++i) {\r\n var v = geoElevation.vertices[eleIndex + i];\r\n if (v.z > 0) {\r\n var p = ray.set(v, moduleNormal).intersectPlane(groundPlane, pt);\r\n geoElevation.vertices.push(p.clone());\r\n } else\r\n geoElevation.vertices.push(v.clone());\r\n }\r\n\r\n geoElevation.faces.push(new THREE.Face3(4 + eleIndex, 7 + eleIndex, 6 + eleIndex));\r\n geoElevation.faces.push(new THREE.Face3(4 + eleIndex, 6 + eleIndex, 5 + eleIndex));\r\n\r\n geoElevation.faceVertexUvs[0].push([uvs[4], uvs[7], uvs[6]]);\r\n geoElevation.faceVertexUvs[0].push([uvs[4], uvs[6], uvs[5]]);\r\n\r\n for (var i = 3, j = 0; j < 4; j++) {\r\n\r\n var a = i + 4,\r\n b = j + 4,\r\n c = j,\r\n d = i;\r\n\r\n if (geoElevation.vertices[a + eleIndex].z > 0 || geoElevation.vertices[b + eleIndex].z || geoElevation.vertices[c + eleIndex].z) {\r\n geoElevation.faces.push(new THREE.Face3(a + eleIndex, b + eleIndex, c + eleIndex));\r\n geoElevation.faceVertexUvs[0].push([uvs[a], uvs[b], uvs[c]]);\r\n }\r\n\r\n if (geoElevation.vertices[a + eleIndex].z > 0 || geoElevation.vertices[c + eleIndex].z || geoElevation.vertices[d + eleIndex].z) {\r\n geoElevation.faces.push(new THREE.Face3(a + eleIndex, c + eleIndex, d + eleIndex));\r\n geoElevation.faceVertexUvs[0].push([uvs[a], uvs[c], uvs[d]]);\r\n }\r\n\r\n i = j;\r\n }\r\n }\r\n });\r\n\r\n if (withGroundPlane) {\r\n var eleIndex = geoElevation.vertices.length,\r\n { width, height } = calculateModuleDimension(config, mod.appearanceWidth, mod.appearanceHeight),\r\n zOff = 10;\r\n\r\n geoElevation.vertices.push(new THREE.Vector3(0, 0, zOff), new THREE.Vector3(width, 0, zOff), new THREE.Vector3(width, height, zOff), new THREE.Vector3(0, height, zOff));\r\n geoElevation.faces.push(new THREE.Face3(0 + eleIndex, 1 + eleIndex, 2 + eleIndex));\r\n geoElevation.faces.push(new THREE.Face3(0 + eleIndex, 2 + eleIndex, 3 + eleIndex));\r\n\r\n geoElevation.faceVertexUvs[0].push([new THREE.Vector2(0, 0), new THREE.Vector2(1, 0), new THREE.Vector2(1, 1)]);\r\n geoElevation.faceVertexUvs[0].push([new THREE.Vector2(0, 0), new THREE.Vector2(1, 1), new THREE.Vector2(0, 1)]);\r\n }\r\n\r\n var result: THREE.Mesh[] = [];\r\n\r\n geoMod.computeFaceNormals();\r\n geoMod.computeBoundingSphere();\r\n\r\n geoSides.computeFaceNormals();\r\n geoSides.computeBoundingSphere();\r\n\r\n var modMat = getModuleAppearance(mod, modWidth, modHeight);\r\n var sidesMat = getModuleFrameAppearance(mod);\r\n\r\n var modMesh = new THREE.Mesh(new THREE.BufferGeometry().fromGeometry(geoMod), modMat);\r\n var sidesMesh = new THREE.Mesh(new THREE.BufferGeometry().fromGeometry(geoSides), sidesMat);\r\n\r\n result.push(modMesh);\r\n result.push(sidesMesh);\r\n\r\n if (geoElevation.vertices.length > 0 && geoElevation.faces.length > 0) {\r\n\r\n geoElevation.computeFaceNormals();\r\n\r\n geoElevation.computeBoundingSphere();\r\n\r\n var eleMat = getModuleElevationAppearance(mod);\r\n\r\n var eleMesh = new THREE.Mesh(new THREE.BufferGeometry().fromGeometry(geoElevation), eleMat);\r\n\r\n result.push(eleMesh);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n export function buildSingleModule(mod: IModuleAppearance, config: IClientObjectConfiguration) {\r\n //einzelnes Modul\r\n var transform = new THREE.Matrix4();\r\n\r\n var moduleHorizontal = config.ModuleHorizontal,\r\n roofPaddingZ = config.RoofPaddingZ;\r\n\r\n if (moduleHorizontal)\r\n transform.makeTranslation(mod.appearanceHeight, 0, roofPaddingZ).multiply(new THREE.Matrix4().makeRotationZ(Math.PI * 0.5));\r\n else\r\n transform.makeTranslation(0, 0, roofPaddingZ);\r\n\r\n return buildModuleMeshes(mod, config, [transform]);\r\n }\r\n\r\n export function buildElevationNS(mod: IModuleAppearance, config: IClientObjectConfiguration) {\r\n //Südaufständerung\r\n var transform = new THREE.Matrix4(),\r\n moduleAngle = config.ElevationAngle,\r\n moduleHorizontal = config.ModuleHorizontal,\r\n roofPaddingZ = config.RoofPaddingZ;\r\n\r\n if (moduleHorizontal)\r\n transform.makeTranslation(0, 0, roofPaddingZ)\r\n .multiply(new THREE.Matrix4().makeRotationX(moduleAngle / 180 * Math.PI))\r\n .multiply(new THREE.Matrix4().makeTranslation(mod.appearanceHeight, 0, 0))\r\n .multiply(new THREE.Matrix4().makeRotationZ(Math.PI * 0.5));\r\n else\r\n transform.makeTranslation(0, 0, roofPaddingZ)\r\n .multiply(new THREE.Matrix4().makeRotationX(moduleAngle / 180 * Math.PI));\r\n\r\n return buildModuleMeshes(mod, config, [transform]);\r\n }\r\n\r\n export function buildElevationEW(mod: IModuleAppearance, config: IClientObjectConfiguration) {\r\n //Ost-West Aufständerung\r\n var transformLeft = new THREE.Matrix4(),\r\n transformRight = new THREE.Matrix4(),\r\n moduleAngle = config.ElevationAngle,\r\n moduleHorizontal = config.ModuleHorizontal,\r\n roofPaddingZ = config.RoofPaddingZ,\r\n distanceBetweenLeftAndRight = config.DistanceBetweenLeftAndRight;\r\n\r\n if (moduleHorizontal) {\r\n var tw = Math.cos(moduleAngle / 180 * Math.PI) * mod.appearanceHeight;\r\n\r\n transformLeft.makeTranslation(0, 0, roofPaddingZ)\r\n .multiply(new THREE.Matrix4().makeRotationY(-moduleAngle / 180 * Math.PI))\r\n .multiply(new THREE.Matrix4().makeTranslation(mod.appearanceHeight, 0, 0))\r\n .multiply(new THREE.Matrix4().makeRotationZ(Math.PI * 0.5));\r\n\r\n transformRight.makeTranslation(tw * 2 + distanceBetweenLeftAndRight, 0, roofPaddingZ)\r\n .multiply(new THREE.Matrix4().makeRotationY(moduleAngle / 180 * Math.PI))\r\n .multiply(new THREE.Matrix4().makeRotationZ(Math.PI * 0.5));\r\n }\r\n else {\r\n //vertical\r\n var tw = Math.cos(15 / 180 * Math.PI) * mod.appearanceWidth;\r\n\r\n transformLeft.makeTranslation(0, 0, roofPaddingZ)\r\n .multiply(new THREE.Matrix4().makeRotationY(-moduleAngle / 180 * Math.PI));\r\n\r\n transformRight.makeTranslation(tw * 2 + distanceBetweenLeftAndRight, 0, roofPaddingZ)\r\n .multiply(new THREE.Matrix4().makeRotationY(moduleAngle / 180 * Math.PI))\r\n .multiply(new THREE.Matrix4().makeTranslation(-mod.appearanceWidth, 0, 0));\r\n }\r\n\r\n return buildModuleMeshes(mod, config, [transformLeft, transformRight]);\r\n }\r\n\r\n function buildClientObjects(data: IEditorClientObjectData): SolarProTool.IClient3DObect[] {\r\n\r\n var { instanceHolderId, pvModule, clientObjects } = data;\r\n\r\n var result = Object.keys(clientObjectConfiguration).map(clientObjectType => {\r\n var config = clientObjectConfiguration[clientObjectType],\r\n orientation = 0,\r\n count = 0,\r\n width: number,\r\n height: number,\r\n moduleAppearance: IModuleAppearance,\r\n dataArrays: SolarProTool.IClientObectDataArrays = {\r\n X: [],\r\n Y: [],\r\n Z: [],\r\n SizeX: null,\r\n SizeY: null,\r\n Id: [],\r\n IsActive: [],\r\n InstanceColor: null,\r\n OptionCode: null,\r\n Meta: null\r\n },\r\n numModules = 1,\r\n meshes: THREE.Mesh[],\r\n cos = clientObjects.filter(co => co.config.ClientObjectType == clientObjectType);\r\n\r\n if (cos.length) {\r\n cos.forEach(co => {\r\n count += co.positions.length;\r\n\r\n ArrayHelper.iterateArray(co.positions, pos => {\r\n dataArrays.X.push(pos.X);\r\n dataArrays.Y.push(pos.Y);\r\n dataArrays.Z.push(0);\r\n dataArrays.Id.push(spt.Utils.GenerateGuid());\r\n dataArrays.IsActive.push(1);\r\n });\r\n\r\n width = co.width;\r\n height = co.height;\r\n moduleAppearance = co.moduleAppearance;\r\n config = co.config;\r\n });\r\n } else {\r\n var dim = calculateModuleDimension(config, pvModule.MODULEWIDTH, pvModule.MODULELENGTH);\r\n width = dim.width;\r\n height = dim.height;\r\n moduleAppearance = generateAppearanceFromModule(pvModule);\r\n }\r\n \r\n switch (config.GeneratorType) {\r\n case \"Module\":\r\n meshes = buildSingleModule(moduleAppearance, config);\r\n break;\r\n case \"NorthSouth\":\r\n meshes = buildElevationNS(moduleAppearance, config);\r\n break;\r\n case \"EastWest\":\r\n meshes = buildElevationEW(moduleAppearance, config);\r\n numModules = 2;\r\n break;\r\n }\r\n\r\n var clientObject: SolarProTool.IClient3DObect = {\r\n SharedMeshes: meshes,\r\n Count: count,\r\n NumModules: numModules,\r\n ModCount: numModules,\r\n Orientation: orientation,\r\n GeoWidth: width,\r\n GeoHeight: height,\r\n IconInsertSet: config.IconSet,\r\n IconInsertIndex: config.IconIndex,\r\n GroupIconInsert: null,\r\n GroupIconInsertSet: config.IconSet,\r\n GroupIconInsertIndex: config.IconIndex,\r\n DataArrays: dataArrays,\r\n Options: config.Options,\r\n Type: config.ClientObjectType,\r\n TypeId: null,\r\n BaseParentId: instanceHolderId,\r\n Transparency: 0,\r\n IsHidden: false\r\n };\r\n\r\n return clientObject;\r\n });\r\n\r\n return result;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region generate, snapping, insert, delete and move\r\n\r\n export function regenerateLayoutWithModuleId(pvModuleId: string) {\r\n if (LoaderManager.isLoading())\r\n return;\r\n\r\n layoutModuleId = pvModuleId;\r\n\r\n Controller.Current.regenerateModulePlan(false);\r\n }\r\n\r\n export function regenerateLayout(clientObject: ClientObject) {\r\n if (LoaderManager.isLoading() || !clientObject || !clientObject.dataType || !clientObjectConfiguration[clientObject.dataType])\r\n return;\r\n\r\n layoutClientObjectType = clientObject.dataType;\r\n\r\n Controller.Current.regenerateModulePlan(false);\r\n }\r\n\r\n //returns a translation that can be applied to the bounds if snapping is successful. returns null if there are any intersections.\r\n function snap(bounds: THREE.Box3[], config: IClientObjectConfiguration, target: THREE.Vector3, excludeIds: string[] = [], withoutCheck?: boolean, showErrorInfo?: boolean): THREE.Vector3 {\r\n if (!bounds || !bounds.length || !config)\r\n return null;\r\n\r\n var maxSnapDistance = 1000,\r\n controller = LS.Client3DEditor.Controller.Current,\r\n viewModel = controller.viewModel,\r\n instanceContext = viewModel.currentInstance,\r\n searchbox = new THREE.Box3(),\r\n tb = new THREE.Box3(),\r\n paddingx = config.DistanceX,\r\n paddingy = config.DistanceY,\r\n targetDist = Number.MAX_VALUE;\r\n\r\n for (var i = bounds.length; i--;)\r\n searchbox.union(bounds[i]);\r\n\r\n searchbox.expandByScalar(maxSnapDistance);\r\n\r\n var instances = (instanceContext.getBoxIntersections(searchbox) as ClientObjectInstance[]).filter(inst => excludeIds.indexOf(inst.instanceData.Id) === -1);\r\n\r\n target.set(0, 0, 0);\r\n\r\n if (instances.length) {\r\n instances.forEach(instance => {\r\n var dataType = instance.clientObject.dataType,\r\n cfg = dataType ? clientObjectConfiguration[dataType] : null;\r\n\r\n if (!cfg)\r\n return;\r\n\r\n var padx = Math.max(cfg.DistanceX, paddingx),\r\n pady = Math.max(cfg.DistanceY, paddingy),\r\n instanceData = instance.instanceData;\r\n\r\n calculateBounds(instance.clientObject, instanceData.X, instanceData.Y, tb.makeEmpty());\r\n\r\n bounds.forEach(bd => {\r\n var tr = calculateSnappingTranslation(bd, tb, padx, pady),\r\n tdist = tr.lengthSq();\r\n if (tdist < targetDist) {\r\n target.copy(tr);\r\n targetDist = tdist;\r\n }\r\n });\r\n });\r\n }\r\n\r\n if (targetDist > maxSnapDistance * maxSnapDistance)\r\n target.set(0, 0, 0);\r\n\r\n return !withoutCheck && bounds.some(b => hasIntersections(b, config.DistanceToInterferences, excludeIds, target, showErrorInfo)) ? null : target;\r\n }\r\n\r\n var _box = new THREE.Box3(),\r\n _interBox = new THREE.Box3(),\r\n _bdVecs = [new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3()];\r\n\r\n function hasIntersections(bd: THREE.Box3, distanceToInterference: number = 200, excludeIds: string[] = [], offset?: THREE.Vector3, showErrorInfo?: boolean) {\r\n var threshold = -0.5,\r\n controller = LS.Client3DEditor.Controller.Current,\r\n viewModel = controller.viewModel,\r\n instanceContext = viewModel.currentInstance,\r\n bounds = offset ? _box.copy(bd).translate(offset).expandByScalar(threshold) : _box.copy(bd).expandByScalar(threshold),\r\n interferenceObjects = viewModel.interferenceObjects as DynamicInterferenceObject[];\r\n\r\n var pts = setVecsFromBounds(_bdVecs, bounds);\r\n\r\n if (pts.some(p => !MapDrawing.Point2D.isInsidePolygon(p, instanceContext.instanceAreaPolygons[0], 0.01))) {\r\n if (showErrorInfo)\r\n DManager.ShowSmallInfo(window.translations[\"ObjectOutsideRoof\"]);// \"Object is outside of roof.\")\r\n return true;\r\n }\r\n\r\n var boundsForInterference = _interBox.copy(bounds).expandByScalar(distanceToInterference),\r\n interferenceIntersection = interferenceObjects.some(inter => {\r\n console.log(inter.localPolygon.array);\r\n if (pts.some(p => MapDrawing.Point2D.isInsidePolygon(p, inter.localPolygon.array, 0.01)))\r\n return true;\r\n if (!inter.instanceMesh)\r\n return false;\r\n return spt.ThreeJs.utils.BoxisIntersectingMesh(boundsForInterference, inter.instanceMesh);\r\n });\r\n\r\n if (interferenceIntersection) {\r\n if (showErrorInfo)\r\n DManager.ShowSmallInfo(window.translations[\"ObjectIntersectsInterference\"]);// \"Object intersects with interference object.\")\r\n return true;\r\n }\r\n\r\n var instances = (instanceContext.getBoxIntersections(bounds) as ClientObjectInstance[]).filter(inst => excludeIds.indexOf(inst.instanceData.Id) === -1);\r\n\r\n if (instances.length) {\r\n if (showErrorInfo)\r\n DManager.ShowSmallInfo(window.translations[\"ObjectIntersectsObject\"]);//\"Object intersects with another object.\")\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n //when snapping between two bounds, there are exactly 12 possible snap targets. from = index of vertex of target bounds, to = index of vertrex of source bounds, px = apply paddingx, py = apply paddingx\r\n var snappingTargets = [\r\n { from: 0, to: 1, px: -1, py: 0 },\r\n { from: 0, to: 2, px: -1, py: -1 },\r\n { from: 0, to: 3, px: 0, py: -1 },\r\n { from: 1, to: 2, px: 0, py: -1 },\r\n { from: 1, to: 3, px: 1, py: -1 },\r\n { from: 1, to: 0, px: 1, py: 0 },\r\n { from: 2, to: 3, px: 1, py: 0 },\r\n { from: 2, to: 0, px: 1, py: 1 },\r\n { from: 2, to: 1, px: 0, py: 1 },\r\n { from: 3, to: 0, px: 0, py: 1 },\r\n { from: 3, to: 1, px: -1, py: 1 },\r\n { from: 3, to: 2, px: -1, py: 0 }\r\n ];\r\n\r\n var _sourceVecs = [new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3()],\r\n _targetVecs = [new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3()],\r\n _v1 = new THREE.Vector3(),\r\n _v2 = new THREE.Vector3(),\r\n _tb = new THREE.Box3();\r\n\r\n function setVecsFromBounds(vec: THREE.Vector3[], bounds: THREE.Box3) {\r\n var min = bounds.min,\r\n max = bounds.max;\r\n\r\n vec[0].set(min.x, min.y, 0);\r\n vec[1].set(max.x, min.y, 0);\r\n vec[2].set(max.x, max.y, 0);\r\n vec[3].set(min.x, max.y, 0);\r\n\r\n return vec;\r\n }\r\n\r\n //manually check all 12 possible snapping positions and return the translation to the closest target\r\n function calculateSnappingTranslation(source: THREE.Box3, target: THREE.Box3, padx: number, pady: number) {\r\n var toVecs = setVecsFromBounds(_sourceVecs, source),\r\n fromVecs = setVecsFromBounds(_targetVecs, target),\r\n dist = Number.MAX_VALUE,\r\n dt = _v1,\r\n move = _v2,\r\n fromVec: THREE.Vector3,\r\n toVec: THREE.Vector3,\r\n st: { from: number, to: number, px: number, py: number },\r\n d: number;\r\n\r\n for (var i = 12; i--;) {\r\n st = snappingTargets[i];\r\n fromVec = fromVecs[st.from];\r\n toVec = toVecs[st.to];\r\n dt.set(fromVec.x + padx * st.px, fromVec.y + pady * st.py, 0);\r\n d = toVec.distanceToSquared(dt);\r\n if (d < dist) {\r\n dist = d;\r\n move.set(dt.x - toVec.x, dt.y - toVec.y, 0);\r\n }\r\n }\r\n\r\n return move;\r\n }\r\n\r\n async function InsertClientObjects(data: { clientObjectsParams: SolarProTool.InsertClientObjectsParams[], ctrlDown: boolean, disableSnapping: boolean, compressData: boolean }) {\r\n var { clientObjectsParams, ctrlDown, disableSnapping } = data,\r\n controller = LS.Client3DEditor.Controller.Current,\r\n changes: SolarProTool.ClientObjectChanges[] = [],\r\n clientObjectsDatas: SolarProTool.InsertClientObjectsData[] = [],\r\n vt = new THREE.Vector3();\r\n\r\n if (clientObjectsParams && clientObjectsParams.length) {\r\n clientObjectsParams.forEach(clientObjectsParam => {\r\n if (!clientObjectsParam.Positions || !clientObjectsParam.Positions.length)\r\n return;\r\n\r\n var clientObjects: SolarProTool.IClientObject[] = [],\r\n withoutCheck = false, //ctrlDown,\r\n type = clientObjectsParam.TypeString,\r\n config = clientObjectConfiguration[type],\r\n clientObject = controller.Objects[clientObjectsParam.SourceId],\r\n bounds = clientObjectsParam.Positions.map(pos => calculateBounds(clientObject, Math.round(pos.x), Math.round(pos.y))),\r\n offset = snap(bounds, config, vt, [], withoutCheck, !withoutCheck);\r\n\r\n if (offset) {\r\n for (var i = 0, l = bounds.length; i < l; ++i) {\r\n var bd = bounds[i];\r\n\r\n clientObjects.push({\r\n X: bd.min.x + offset.x,\r\n Y: bd.min.y + offset.y,\r\n Z: bd.min.z + offset.z,\r\n Id: spt.Utils.GenerateGuid(),\r\n IsActive: 1,\r\n InstanceColor: 0,\r\n OptionCode: 0\r\n });\r\n }\r\n }\r\n\r\n if (clientObjects.length > 0) {\r\n clientObjects = clientObjects.distinctByKey(m => m.Id);\r\n\r\n var result: SolarProTool.ClientObectDataArrays = {\r\n X: [],\r\n Y: [],\r\n Z: [],\r\n SizeX: [],\r\n SizeY: [],\r\n Id: [],\r\n IsActive: [],\r\n InstanceColor: [],\r\n OptionCode: [],\r\n Meta: []\r\n };\r\n\r\n clientObjects.forEach(co => {\r\n result.X.push(co.X);\r\n result.Y.push(co.Y);\r\n result.Z.push(co.Z);\r\n result.InstanceColor.push(co.InstanceColor);\r\n result.OptionCode.push(co.OptionCode);\r\n result.IsActive.push(co.IsActive);\r\n result.Id.push(co.Id);\r\n });\r\n\r\n if (result.Id.length) {\r\n clientObjectsDatas.push(\r\n {\r\n ClientObectData: result,\r\n SourceId: clientObjectsParam.SourceId\r\n });\r\n }\r\n }\r\n });\r\n }\r\n\r\n var result: SolarProTool.InsertClientObjectsResult =\r\n {\r\n ClientObjectsDatas: clientObjectsDatas,\r\n Changes: changes\r\n };\r\n\r\n return result;\r\n }\r\n\r\n async function InsertClientObjectByRect(data: { x1: number, y1: number, x2: number, y2: number, orientation: number, typeString: string, typeId: string, disableSnapping: boolean }) {\r\n let [editorData, clientObjectData] = await Promise.all([GetDataForEditor3D(), GetDataForClientObjects()]);\r\n var { x1, y1, x2, y2, typeString } = data,\r\n bounds = _tb.makeEmpty()\r\n .expandByPoint(_v1.set(Math.round(x1), Math.round(y1), -4000))\r\n .expandByPoint(_v1.set(Math.round(x2), Math.round(y2), 4000));\r\n\r\n //TODO snap bounds corners to client objects (like in SPT)\r\n\r\n var controller = LS.Client3DEditor.Controller.Current,\r\n viewModel = controller.viewModel,\r\n instanceContext = viewModel.currentInstance,\r\n layoutMask: SolarProTool.Point2D[] = [\r\n { X: bounds.min.x, Y: bounds.min.y },\r\n { X: bounds.max.x, Y: bounds.min.y },\r\n { X: bounds.max.x, Y: bounds.max.y },\r\n { X: bounds.min.x, Y: bounds.max.y }\r\n ];\r\n\r\n var instances = (instanceContext.getBoxIntersections(bounds) as ClientObjectInstance[]),\r\n instancePolys = instances.map(instance => {\r\n var instanceData = instance.instanceData,\r\n bd = calculateBounds(instance.clientObject, instanceData.X, instanceData.Y, _tb.makeEmpty());\r\n var poly: SolarProTool.Point2D[] = [\r\n { X: bd.min.x, Y: bd.min.y },\r\n { X: bd.max.x, Y: bd.min.y },\r\n { X: bd.max.x, Y: bd.max.y },\r\n { X: bd.min.x, Y: bd.max.y }\r\n ];\r\n return poly;\r\n });\r\n\r\n var layoutData = await generateLayout(clientObjectData.instanceHolderId, editorData, typeString, clientObjectData.pvModule, layoutMask, instancePolys);\r\n\r\n if (layoutData && layoutData.clientObjects) {\r\n //add new positions to existing client objects\r\n layoutData.clientObjects.forEach(clientObject => {\r\n var clientObjectType = clientObject.config.ClientObjectType,\r\n co = clientObjectData.clientObjects.find(c => c.config.ClientObjectType === clientObjectType);\r\n if (co)\r\n co.positions.pushAll(clientObject.positions);\r\n });\r\n }\r\n\r\n var result: SolarProTool.InsertClientObjectByRectResult = {\r\n ClientObects: buildClientObjects(clientObjectData),\r\n Changes: []\r\n };\r\n\r\n return result;\r\n }\r\n\r\n async function DeleteClientObjects(data: { changes: LS.Client3DEditor.IChange[] }) {\r\n var result = data.changes.map(change => {\r\n var res: SolarProTool.ClientObjectChanges = {\r\n TypeString: change.TypeString,\r\n UpdateType: change.UpdateType,\r\n IdStrings: change.IdStrings,\r\n ErrorCode: 0\r\n };\r\n return res;\r\n });\r\n\r\n return result;\r\n }\r\n\r\n async function HandleClientObjectChanges(data: { changes: LS.Client3DEditor.IChange[], revert: boolean, disableSnapping: boolean }) {\r\n var result: SolarProTool.ClientObjectChanges[] = [],\r\n { changes, revert, disableSnapping } = data,\r\n controller = LS.Client3DEditor.Controller.Current,\r\n vt = new THREE.Vector3();\r\n\r\n changes.forEach(change => {\r\n\r\n var type = change.TypeString,\r\n clientObjects = change.IdStrings.map(id => controller.Instances[id]).filter(o => !!o),\r\n config = clientObjectConfiguration[type];\r\n\r\n //Move clientObject\r\n if (change.UpdateType == \"translate\") {\r\n if (!revert) {\r\n var bounds = clientObjects.map(inst => calculateBounds(inst.clientObject, Math.round(inst.position.x), Math.round(inst.position.y))),\r\n offset = snap(bounds, config, vt, change.IdStrings, revert, !revert);\r\n\r\n if (!offset) {\r\n //revert change\r\n result.push(\r\n {\r\n ErrorCode: 1,\r\n Uuid: change.Uuid\r\n });\r\n }\r\n else if (offset.lengthSq() > 0) {\r\n //add snapping offset\r\n result.push(\r\n {\r\n TypeString: change.TypeString,\r\n UpdateType: \"translate\",\r\n ErrorCode: 0,\r\n Tx: offset.x,\r\n Ty: offset.y,\r\n Tz: offset.z,\r\n Sx: 0,\r\n Sy: 0,\r\n IdStrings: change.IdStrings\r\n });\r\n }\r\n }\r\n }\r\n });\r\n\r\n return result;\r\n }\r\n\r\n interface ModuleOrientionResponse {\r\n Version: string;\r\n StatusCode: number;\r\n Message: string;\r\n Result: {\r\n DefaultModuleOrientation: string;\r\n };\r\n }\r\n\r\n interface ModuleOrientation {\r\n defaultModuleOrientation: string;\r\n }\r\n\r\n async function fetchModuleOrientation(): Promise {\r\n const response = await fetch('/api/settings/defaultModuleOrientation');\r\n if (!response.ok) {\r\n throw new Error('Failed to fetch defaultModuleOrientation');\r\n }\r\n const data: ModuleOrientionResponse = await response.json();\r\n\r\n const moduleOrientation: ModuleOrientation = {\r\n defaultModuleOrientation: data.Result.DefaultModuleOrientation,\r\n };\r\n\r\n return moduleOrientation;\r\n } \r\n export async function getDefaultModuleType(roofType: RoofType) {\r\n\r\n const moduleOrientation = await fetchModuleOrientation();\r\n\r\n\r\n return roofType === RoofType.FlatRoof ? \"EastWestElevation\" : moduleOrientation.defaultModuleOrientation;\r\n }\r\n\r\n async function GenerateWithGetClient3DObects(data: { withCorridors: boolean }) {\r\n\r\n let [editorData, clientObjectData] = await Promise.all([GetDataForEditor3D(), GetDataForClientObjects()]);\r\n\r\n var pvModuleId: string,\r\n clientObjectType: string,\r\n pvModule: IPVModule;\r\n\r\n //debugger;\r\n\r\n\r\n if (!clientObjectData || !clientObjectData.clientObjects.length) {\r\n //automatic layout if no clientobjects present or pvmodule has changed\r\n pvModuleId = selectableModuleIds[0];\r\n clientObjectType = await getDefaultModuleType(editorData.roofType); // Object.keys(clientObjectConfiguration)[0];\r\n pvModule = await lsAo3d.getPvModule(pvModuleId);\r\n } else {\r\n pvModule = clientObjectData.pvModule;\r\n pvModuleId = pvModule.PVModuleId;\r\n clientObjectType = await getDefaultModuleType(editorData.roofType); // clientObjectData.clientObjects[0].config.ClientObjectType;\r\n }\r\n\r\n if (layoutClientObjectType)\r\n clientObjectType = layoutClientObjectType;\r\n\r\n if (layoutModuleId && layoutModuleId !== pvModuleId) {\r\n pvModuleId = layoutModuleId;\r\n pvModule = await lsAo3d.getPvModule(pvModuleId);\r\n }\r\n\r\n layoutClientObjectType = null;\r\n layoutModuleId = null;\r\n\r\n clientObjectData = await generateLayout(clientObjectData.instanceHolderId, editorData, clientObjectType, pvModule);\r\n\r\n await Promise.all([SaveDataForEditor3D(editorData), SaveDataForClientObjects(clientObjectData)]);\r\n\r\n var result: SolarProTool.Client3DObjectHolder = {\r\n ClientObjects: buildClientObjects(clientObjectData)\r\n };\r\n\r\n return result;\r\n }\r\n\r\n async function SetInterferenceStates(data: { idStrings: string[], baseParentIds: string[], states: SolarProTool.IInterference3DObject[] }) {\r\n return data && data.states && data.states.length ? data.states.filter(state => !!state).map(state => state.IdString) : null;\r\n }\r\n\r\n //#endregion\r\n\r\n}","module LS.Client3DEditor {\r\n export interface ITool {\r\n cursor: string;\r\n init: () => void;\r\n onSelect: (viewModel: ViewModel, params?: any) => void;\r\n onDeselect: (viewModel: ViewModel) => void;\r\n onMouseDown: (viewModel: ViewModel) => boolean;\r\n onMouseUp: (viewModel: ViewModel) => boolean;\r\n onMouseMove: (viewModel: ViewModel) => boolean;\r\n onKeyDown: (viewModel: ViewModel) => boolean;\r\n onKeyUp: (viewModel: ViewModel) => boolean;\r\n onViewLayerChanged: (viewModel: ViewModel, viewLayerName: string) => void;\r\n }\r\n\r\n export class BaseTool implements ITool {\r\n init(): void { }\r\n onSelect(viewModel: ViewModel, params?: any) { }\r\n onDeselect(viewModel: ViewModel) { }\r\n onMouseDown(viewModel: ViewModel): boolean { return false; }\r\n onMouseUp(viewModel: ViewModel): boolean { return false; }\r\n onMouseMove(viewModel: ViewModel): boolean { return false; }\r\n onKeyDown(viewModel: ViewModel): boolean { return false; }\r\n onKeyUp(viewModel: ViewModel): boolean { return false; }\r\n onViewLayerChanged(viewModel: ViewModel, viewLayerName: string) { }\r\n cursor: string = 'default';\r\n }\r\n\r\n export class EmptyTool extends BaseTool {\r\n onMouseDown(viewModel: ViewModel): boolean { return true; }\r\n onMouseUp(viewModel: ViewModel): boolean { return true; }\r\n onMouseMove(viewModel: ViewModel): boolean { return true; }\r\n onKeyDown(viewModel: ViewModel): boolean { return true; }\r\n onKeyUp(viewModel: ViewModel): boolean { return true; }\r\n }\r\n}","module LS.Client3DEditor {\r\n export class CameraControls extends THREE.EventDispatcher {\r\n constructor(object: THREE.OrthographicCamera, domElement: HTMLElement, viewModel: ViewModel) {\r\n super();\r\n var _self = this;\r\n var STATE = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM_PAN: 4 };\r\n\r\n this.STATE = STATE;\r\n\r\n this.object = object;\r\n this.domElement = (domElement !== undefined) ? domElement : document;\r\n\r\n var EPS = 0.000001;\r\n\r\n // API\r\n\r\n this.enabled = true;\r\n this.cancelMouseDown = false;\r\n\r\n this.convertLeftMouse = STATE.NONE;\r\n\r\n this.screen = { left: 0, top: 0, width: 0, height: 0 };\r\n\r\n this.radius = 0;\r\n\r\n this.rotateSpeed = 0.75;\r\n this.zoomSpeed = 1.2;\r\n\r\n this.noRotate = false;\r\n this.noZoom = false;\r\n this.noPan = false;\r\n this.noRoll = false;\r\n\r\n this.staticMoving = false;\r\n this.dynamicDampingFactor = 0.4;\r\n\r\n // How far you can orbit vertically, upper and lower limits.\r\n // Range is 0 to Math.PI radians.\r\n this.minPolarAngle = EPS * 2; // radians\r\n this.maxPolarAngle = (Math.PI * 0.5) - (EPS * 2); // radians\r\n\r\n this.keys = [65 /*A*/, 83 /*S*/, 68 /*D*/];\r\n\r\n // internals\r\n\r\n this.target = new THREE.Vector3();\r\n\r\n this.elevationAngle = new THREE.Quaternion();\r\n this.worldZ = new THREE.Vector3(0, 0, 1);\r\n this.worldX = new THREE.Vector3(1, 0, 0);\r\n\r\n var orbitQuat = new THREE.Quaternion().setFromUnitVectors(new THREE.Vector3(0, 0, 1), new THREE.Vector3(0, 1, 0));\r\n var orbitQuatInverse = orbitQuat.clone().inverse();\r\n\r\n var _changed = true;\r\n\r\n var _state = STATE.NONE,\r\n _prevState = STATE.NONE,\r\n\r\n _eye = new THREE.Vector3(),\r\n\r\n _rotateStart = new THREE.Vector3(),\r\n _rotateEnd = new THREE.Vector3(),\r\n\r\n orbitRotateStart = new THREE.Vector2(),\r\n orbitRotateEnd = new THREE.Vector2(),\r\n orbitRotateDelta = new THREE.Vector2(),\r\n\r\n _refPos = new THREE.Vector3(),\r\n _refTarget = new THREE.Vector3(),\r\n _refUp = new THREE.Vector3(),\r\n\r\n // so camera.up is the orbit axis\r\n\r\n //_quat = new THREE.Quaternion(),\r\n\r\n _rollStart = new THREE.Vector3(),\r\n _rollEnd = new THREE.Vector3(),\r\n\r\n _zoomStartVec = new THREE.Vector2(),\r\n\r\n _touchZoomDistanceStart = 0,\r\n _touchZoomDistanceEnd = 0,\r\n\r\n _panStart = new THREE.Vector2(),\r\n _panEnd = new THREE.Vector2(),\r\n\r\n _moveStart = new THREE.Vector3(),\r\n _moveEnd = new THREE.Vector3();\r\n\r\n this.rotateStart = _rotateStart;\r\n this.rotateEnd = _rotateEnd;\r\n\r\n this.rollStart = _rollStart;\r\n this.rollEnd = _rollEnd;\r\n\r\n this.zoomStart = 1;\r\n this.zoomEnd = 1;\r\n\r\n this.panStart = _panStart;\r\n this.panEnd = _panEnd;\r\n\r\n this.moveStart = _moveStart;\r\n this.moveEnd = _moveEnd;\r\n\r\n // for reset\r\n\r\n this.target0 = this.target.clone();\r\n this.position0 = this.object.position.clone();\r\n this.up0 = this.object.up.clone();\r\n\r\n this.left0 = this.object.left;\r\n this.right0 = this.object.right;\r\n this.top0 = this.object.top;\r\n this.bottom0 = this.object.bottom;\r\n\r\n // events\r\n\r\n var changeEvent = { type: 'change', target: null };\r\n var startEvent = { type: 'start', target: null };\r\n var endEvent = { type: 'end', target: null };\r\n\r\n\r\n // methods\r\n\r\n this.SetElevationAngle = (angle: THREE.Quaternion) => {\r\n _self.elevationAngle.copy(angle).inverse();\r\n _self.worldZ.set(0, 0, 1).applyQuaternion(_self.elevationAngle);\r\n //orbitQuat = new THREE.Quaternion().setFromUnitVectors(_self.worldZ, new THREE.Vector3(0, 1, 0));\r\n //orbitQuatInverse = orbitQuat.clone().inverse();\r\n };\r\n\r\n this.handleResize = function () {\r\n\r\n if (this.domElement === document) {\r\n\r\n this.screen.left = 0;\r\n this.screen.top = 0;\r\n this.screen.width = window.innerWidth;\r\n this.screen.height = window.innerHeight;\r\n\r\n } else {\r\n var $view = $(this.domElement);\r\n var w = $view.innerWidth();\r\n var h = $view.innerHeight();\r\n var offset = $view.offset();\r\n\r\n /*var box = this.domElement.getBoundingClientRect();\r\n // adjustments come from similar code in the jquery offset() function\r\n var d = this.domElement.ownerDocument.documentElement;\r\n this.screen.left = box.left + window.pageXOffset - d.clientLeft;\r\n this.screen.top = box.top + window.pageYOffset - d.clientTop;\r\n this.screen.width = box.width;\r\n this.screen.height = box.height;*/\r\n\r\n this.screen.left = offset.left;\r\n this.screen.top = offset.top;\r\n this.screen.width = w;\r\n this.screen.height = h;\r\n }\r\n\r\n this.radius = 0.5 * Math.min(this.screen.width, this.screen.height);\r\n\r\n this.left0 = this.object.left;\r\n this.right0 = this.object.right;\r\n this.top0 = this.object.top;\r\n this.bottom0 = this.object.bottom;\r\n\r\n _self.zoomStart = _self.zoomEnd = _self.object.zoom;\r\n\r\n };\r\n \r\n this.handleEvent = function (event) {\r\n\r\n if (typeof this[event.type] == 'function') {\r\n\r\n this[event.type](event);\r\n\r\n }\r\n\r\n };\r\n\r\n var getMouseOnScreen = (() => {\r\n\r\n var vector = new THREE.Vector2();\r\n\r\n return (pageX, pageY) => {\r\n\r\n vector.set(\r\n (pageX - _self.screen.left) / _self.screen.width,\r\n (pageY - _self.screen.top) / _self.screen.height\r\n );\r\n return vector;\r\n\r\n };\r\n\r\n })();\r\n\r\n var getMouseProjectionOnBall = (() => {\r\n\r\n var vector = new THREE.Vector3();\r\n var objectUp = new THREE.Vector3();\r\n var mouseOnBall = new THREE.Vector3();\r\n var euler = new THREE.Euler();\r\n var _pi2 = Math.PI * 0.5;\r\n\r\n return (pageX, pageY, refPos, refTarget, refUp) => {\r\n\r\n //refPos = refTarget = refUp = null;\r\n\r\n mouseOnBall.set(\r\n (pageX - _self.screen.width * 0.5 - _self.screen.left) / _self.radius,\r\n (_self.screen.height * 0.5 + _self.screen.top - pageY) / _self.radius,\r\n 0.0\r\n );\r\n\r\n euler.set(mouseOnBall.y * -_pi2, mouseOnBall.x * _pi2, 0);\r\n mouseOnBall.set(0, 0, 1).applyEuler(euler).normalize();\r\n\r\n /*var length = mouseOnBall.length();\r\n \r\n if (_self.noRoll) {\r\n \r\n if (length < Math.SQRT1_2) {\r\n \r\n mouseOnBall.z = Math.sqrt(1.0 - length * length);\r\n \r\n } else {\r\n \r\n mouseOnBall.z = .5 / length;\r\n \r\n }\r\n \r\n } else if (length > 1.0) {\r\n \r\n mouseOnBall.normalize();\r\n \r\n } else {\r\n \r\n mouseOnBall.z = Math.sqrt(1.0 - length * length);\r\n \r\n }*/\r\n\r\n //refVec.cross(mouseOnBall);\r\n\r\n var up = refUp || _self.object.up;\r\n\r\n _eye.copy(refPos || _self.object.position).sub(refTarget || _self.target);\r\n\r\n vector.copy(up).setLength(mouseOnBall.y);\r\n vector.add(objectUp.copy(up).cross(_eye).setLength(mouseOnBall.x));\r\n vector.add(_eye.setLength(mouseOnBall.z));\r\n\r\n return vector;\r\n\r\n };\r\n\r\n })();\r\n\r\n this.rollCamera = (() => {\r\n\r\n var axis = new THREE.Vector3(),\r\n quaternion = new THREE.Quaternion();\r\n\r\n return (immediately?: boolean) => {\r\n if (Math.abs(_rollStart.x - _rollEnd.x) <= EPS && Math.abs(_rollStart.y - _rollEnd.y) <= EPS && Math.abs(_rollStart.z - _rollEnd.z) <= EPS)\r\n return;\r\n\r\n var angle = Math.acos(_rollStart.dot(_rollEnd) / _rollStart.length() / _rollEnd.length());\r\n\r\n axis.crossVectors(_rollStart, _rollEnd).normalize();\r\n\r\n if (!immediately) {\r\n angle *= _self.rotateSpeed;\r\n\r\n if (!_self.staticMoving) {\r\n angle *= _self.dynamicDampingFactor;\r\n }\r\n }\r\n\r\n quaternion.setFromAxisAngle(axis, -angle);\r\n\r\n var objUp = _self.object.up;\r\n\r\n objUp.applyQuaternion(quaternion);\r\n\r\n if (Math.abs(_rollStart.x - objUp.x) <= EPS && Math.abs(_rollStart.y - objUp.y) <= EPS && Math.abs(_rollStart.z - objUp.z) <= EPS)\r\n objUp.copy(_rollStart);\r\n\r\n _rollEnd.copy(objUp);\r\n\r\n _changed = true;\r\n\r\n }\r\n\r\n })();\r\n\r\n this.orbitRotateCamera = (() => {\r\n\r\n var v1 = new THREE.Vector3();\r\n var quat = new THREE.Quaternion();\r\n var nEPS = 1 - (EPS * 2);\r\n\r\n return (immediately?: boolean) => {\r\n\r\n orbitRotateDelta.copy(orbitRotateEnd).sub(orbitRotateStart).multiplyScalar(_self.dynamicDampingFactor);\r\n if (Math.abs(orbitRotateDelta.x) <= EPS && Math.abs(orbitRotateDelta.y) <= EPS)\r\n return;\r\n\r\n var object = _self.object;\r\n\r\n quat.copy(_self.elevationAngle).inverse();\r\n object.up.applyQuaternion(quat);\r\n _eye.applyQuaternion(quat);\r\n\r\n if (object.up.z <= nEPS) {\r\n v1.copy(_eye).normalize();\r\n\r\n if ((Math.abs(v1.x) <= EPS && Math.abs(v1.y) <= EPS) || ((1 - Math.abs(v1.z)) <= EPS)) {\r\n _eye.set(-object.up.x * EPS, -object.up.y * EPS, _eye.z);\r\n }\r\n }\r\n\r\n\r\n // rotate _eye to \"y-axis-is-up\" space\r\n _eye.applyQuaternion(orbitQuat);\r\n\r\n // angle from z-axis around y-axis\r\n\r\n var theta = Math.atan2(_eye.x, _eye.z);\r\n\r\n // angle from y-axis\r\n\r\n var rotateSpeed = _self.rotateSpeed;\r\n\r\n if (immediately)\r\n rotateSpeed = 1;\r\n\r\n var phi = Math.atan2(Math.sqrt(_eye.x * _eye.x + _eye.z * _eye.z), _eye.y);\r\n\r\n var thetaDelta = (0.5 * Math.PI * -orbitRotateDelta.x * rotateSpeed);\r\n\r\n theta += thetaDelta;\r\n phi += (0.5 * Math.PI * orbitRotateDelta.y * rotateSpeed);\r\n\r\n // restrict phi to be between desired limits\r\n phi = Math.max(_self.minPolarAngle, Math.min(_self.maxPolarAngle, phi));\r\n\r\n var radius = _eye.length();\r\n\r\n _eye.x = radius * Math.sin(phi) * Math.sin(theta);\r\n _eye.y = radius * Math.cos(phi);\r\n _eye.z = radius * Math.sin(phi) * Math.cos(theta);\r\n\r\n _eye.applyQuaternion(orbitQuatInverse);\r\n\r\n quat.copy(_self.elevationAngle);\r\n object.up.applyQuaternion(quat);\r\n _eye.applyQuaternion(quat);\r\n\r\n _rollEnd.copy(object.up);\r\n _rollStart.copy(_self.worldZ);\r\n\r\n orbitRotateStart.add(orbitRotateDelta);\r\n //orbitRotateStart.copy(orbitRotateEnd);\r\n\r\n _changed = true;\r\n\r\n }\r\n\r\n })();\r\n\r\n this.rotateCamera = (() => {\r\n\r\n var axis = new THREE.Vector3(),\r\n quaternion = new THREE.Quaternion();\r\n\r\n\r\n return (immediately?: boolean) => {\r\n if (Math.abs(_rotateStart.x - _rotateEnd.x) <= EPS && Math.abs(_rotateStart.y - _rotateEnd.y) <= EPS && Math.abs(_rotateStart.z - _rotateEnd.z) <= EPS)\r\n return;\r\n\r\n var angle = Math.acos(_rotateStart.dot(_rotateEnd) / _rotateStart.length() / _rotateEnd.length());\r\n\r\n axis.crossVectors(_rotateStart, _rotateEnd).normalize();\r\n\r\n if (!immediately) {\r\n angle *= _self.rotateSpeed;\r\n\r\n if (!_self.staticMoving) {\r\n angle *= _self.dynamicDampingFactor;\r\n }\r\n }\r\n\r\n quaternion.setFromAxisAngle(axis, -angle);\r\n\r\n _eye.applyQuaternion(quaternion);\r\n\r\n if (_self.staticMoving) {\r\n\r\n _rotateStart.copy(_rotateEnd);\r\n\r\n } else {\r\n\r\n quaternion.setFromAxisAngle(axis, angle);\r\n _rotateStart.applyQuaternion(quaternion);\r\n\r\n }\r\n\r\n if (Math.abs(_rotateStart.x - _rotateEnd.x) <= EPS && Math.abs(_rotateStart.y - _rotateEnd.y) <= EPS && Math.abs(_rotateStart.z - _rotateEnd.z) <= EPS)\r\n _rotateStart.copy(_rotateEnd);\r\n\r\n _changed = true;\r\n\r\n }\r\n\r\n })();\r\n\r\n this.zoomCamera = function (immediately?: boolean) {\r\n\r\n if (_state === STATE.TOUCH_ZOOM_PAN) {\r\n\r\n var factor = _touchZoomDistanceEnd / _touchZoomDistanceStart;\r\n _touchZoomDistanceStart = _touchZoomDistanceEnd;\r\n\r\n _self.object.zoom *= factor;\r\n\r\n _changed = true;\r\n\r\n } else {\r\n\r\n var zoomDiff = _self.zoomEnd - _self.zoomStart;\r\n\r\n if (!immediately && !_self.staticMoving)\r\n zoomDiff *= this.dynamicDampingFactor;\r\n\r\n //var factor = 1.0 + zoomDiff;\r\n\r\n if (Math.abs(zoomDiff) > EPS) {\r\n if ((_self.object.zoom + zoomDiff) > EPS) {\r\n\r\n _self.object.zoom += zoomDiff;\r\n _self.zoomStart += zoomDiff;\r\n _changed = true;\r\n\r\n } else {\r\n _self.zoomEnd = _self.object.zoom;\r\n }\r\n }\r\n }\r\n\r\n };\r\n\r\n this.panCamera = (() => {\r\n\r\n var mouseChange = new THREE.Vector2(),\r\n //objectUp = new THREE.Vector3(),\r\n targetUp = new THREE.Vector3(),\r\n v1 = new THREE.Vector3(),\r\n targetRight = new THREE.Vector3(),\r\n pan = new THREE.Vector3();\r\n\r\n return (immediately?: boolean) => {\r\n\r\n mouseChange.copy(_panEnd).sub(_panStart);\r\n if (mouseChange.lengthSq() > EPS) {\r\n\r\n v1.copy(_eye).normalize();\r\n\r\n var object = _self.object;\r\n\r\n targetUp.copy(object.up);\r\n\r\n targetRight.copy(v1).cross(targetUp).normalize();\r\n targetUp.copy(targetRight).cross(v1).normalize();\r\n\r\n // Scale movement to keep clicked/dragged position under cursor\r\n var scale_x = (object.right - object.left) / object.zoom;\r\n var scale_y = (object.top - object.bottom) / object.zoom;\r\n mouseChange.x *= scale_x;\r\n mouseChange.y *= scale_y;\r\n\r\n if (immediately || _self.staticMoving) {\r\n pan.copy(targetRight).setLength(mouseChange.x);\r\n pan.add(targetUp.setLength(mouseChange.y));\r\n //pan.copy(_eye).cross(targetUp).setLength(mouseChange.x);\r\n //pan.add(objectUp.copy(targetUp).setLength(mouseChange.y));\r\n } else {\r\n pan.copy(targetRight).setLength(mouseChange.x * _self.dynamicDampingFactor);\r\n pan.add(targetUp.setLength(mouseChange.y * _self.dynamicDampingFactor));\r\n //pan.copy(_eye).cross(targetUp).setLength(mouseChange.x * _self.dynamicDampingFactor);\r\n //pan.add(objectUp.copy(targetUp).setLength(mouseChange.y * _self.dynamicDampingFactor));\r\n }\r\n\r\n object.position.add(pan);\r\n _self.target.add(pan);\r\n\r\n if (_self.staticMoving) {\r\n\r\n _panStart.copy(_panEnd);\r\n\r\n } else {\r\n\r\n _panStart.add(mouseChange.subVectors(_panEnd, _panStart).multiplyScalar(_self.dynamicDampingFactor));\r\n\r\n }\r\n\r\n _changed = true;\r\n\r\n }\r\n\r\n }\r\n\r\n })();\r\n\r\n this.moveCamera = (() => {\r\n\r\n var moveChange = new THREE.Vector3();\r\n\r\n return (immediately?: boolean) => {\r\n\r\n moveChange.copy(_moveEnd).sub(_moveStart);\r\n if (!immediately && !_self.staticMoving)\r\n moveChange.multiplyScalar(_self.dynamicDampingFactor);\r\n\r\n if (moveChange.lengthSq() > EPS) {\r\n\r\n _self.object.position.add(moveChange);\r\n _self.target.add(moveChange);\r\n\r\n if (_self.staticMoving) {\r\n\r\n _moveStart.copy(_moveEnd);\r\n\r\n } else {\r\n\r\n _moveStart.add(moveChange);\r\n\r\n }\r\n\r\n _changed = true;\r\n\r\n }\r\n\r\n }\r\n\r\n })();\r\n\r\n this.update = (immediately?: boolean) => {\r\n\r\n _eye.subVectors(_self.object.position, _self.target);\r\n\r\n if (!_self.noRotate) {\r\n\r\n _self.rotateCamera(immediately);\r\n _self.rollCamera(immediately);\r\n _self.orbitRotateCamera(immediately);\r\n\r\n }\r\n\r\n if (!_self.noZoom) {\r\n\r\n _self.zoomCamera(immediately);\r\n\r\n if (_changed) {\r\n\r\n _self.object.updateProjectionMatrix();\r\n\r\n }\r\n\r\n }\r\n\r\n if (!_self.noPan) {\r\n\r\n _self.panCamera(immediately);\r\n _self.moveCamera(immediately);\r\n }\r\n\r\n _self.object.position.addVectors(_self.target, _eye);\r\n\r\n _self.object.lookAt(_self.target);\r\n\r\n if (_changed || immediately) {\r\n\r\n _self.dispatchEvent(changeEvent);\r\n\r\n _changed = false;\r\n\r\n }\r\n\r\n };\r\n\r\n this.reset = (position, target, left, right, top, bottom) => {\r\n\r\n if (position)\r\n _self.position0.copy(position);\r\n if (target)\r\n _self.target0.copy(target);\r\n\r\n if (left !== undefined)\r\n _self.left0 = left;\r\n\r\n if (right !== undefined)\r\n _self.right0 = right;\r\n\r\n if (top !== undefined)\r\n _self.top0 = top;\r\n\r\n if (bottom !== undefined)\r\n _self.bottom0 = bottom;\r\n\r\n _state = STATE.NONE;\r\n _prevState = STATE.NONE;\r\n\r\n _self.target.copy(_self.target0);\r\n _self.object.position.copy(_self.position0);\r\n _self.object.up.copy(_self.up0);\r\n\r\n _eye.subVectors(_self.object.position, _self.target);\r\n\r\n _self.object.left = _self.left0;\r\n _self.object.right = _self.right0;\r\n _self.object.top = _self.top0;\r\n _self.object.bottom = _self.bottom0;\r\n\r\n _self.object.lookAt(_self.target);\r\n\r\n _self.dispatchEvent(changeEvent);\r\n\r\n _self.zoomStart = _self.zoomEnd = _self.object.zoom;\r\n\r\n _changed = false;\r\n\r\n };\r\n\r\n // listeners\r\n\r\n function keydown(event) {\r\n\r\n if (_self.enabled === false) return;\r\n\r\n window.removeEventListener('keydown', keydown);\r\n\r\n _prevState = _state;\r\n\r\n if (_state !== STATE.NONE) {\r\n\r\n return;\r\n\r\n } else if (event.keyCode === _self.keys[STATE.ROTATE] && !_self.noRotate) {\r\n\r\n _state = STATE.ROTATE;\r\n\r\n } else if (event.keyCode === _self.keys[STATE.ZOOM] && !_self.noZoom) {\r\n\r\n _state = STATE.ZOOM;\r\n\r\n } else if (event.keyCode === _self.keys[STATE.PAN] && !_self.noPan) {\r\n\r\n _state = STATE.PAN;\r\n\r\n }\r\n\r\n }\r\n\r\n function keyup(event) {\r\n\r\n if (_self.enabled === false) return;\r\n\r\n _state = _prevState;\r\n\r\n window.addEventListener('keydown', keydown, false);\r\n\r\n }\r\n\r\n function onMouseDown(px, py) {\r\n if (_state === STATE.ROTATE && !_self.noRotate) {\r\n\r\n _refPos.copy(_self.object.position);\r\n _refTarget.copy(_self.target);\r\n _refUp.copy(_self.object.up);\r\n\r\n //_rotateStart.copy(_eye.copy(_self.object.position).sub(_self.target).normalize());\r\n //_rotateStart.copy(_eye.subVectors(_self.object.position, _self.target));\r\n //_rotateStart.set(1, 0, 0);\r\n\r\n //_rotateStart.copy(getMouseProjectionOnBall(px, py, _refPos, _refTarget, _refUp));\r\n //_rotateEnd.copy(_rotateStart);\r\n\r\n //_rollStart.copy(_self.object.up);\r\n //_rollEnd.copy(_rollStart);\r\n\r\n //orbitRotateStart.copy(getMouseOnScreen(px, py));\r\n orbitRotateStart.set(\r\n (px - _self.screen.width * 0.5 - _self.screen.left) / _self.radius,\r\n (_self.screen.height * 0.5 + _self.screen.top - py) / _self.radius\r\n );\r\n orbitRotateEnd.copy(orbitRotateStart);\r\n } else if (_state === STATE.ZOOM && !_self.noZoom) {\r\n\r\n _zoomStartVec.copy(getMouseOnScreen(px, py));\r\n\r\n } else if (_state === STATE.PAN && !_self.noPan) {\r\n\r\n _panStart.copy(getMouseOnScreen(px, py));\r\n _panEnd.copy(_panStart);\r\n\r\n }\r\n }\r\n\r\n function mousedown(event) {\r\n\r\n if (_self.enabled === false) return;\r\n\r\n if (_self.cancelMouseDown) {\r\n _self.cancelMouseDown = false;\r\n return;\r\n }\r\n\r\n //event.preventDefault();\r\n event.stopPropagation();\r\n\r\n if (_state === STATE.NONE) {\r\n\r\n _state = event.button;\r\n\r\n }\r\n\r\n var isLeftMouse = _state === 0;\r\n\r\n if (isLeftMouse)\r\n _state = _self.convertLeftMouse;\r\n\r\n //if (isLeftMouse && _self.doRotate)\r\n // _state = STATE.ROTATE;\r\n\r\n onMouseDown(event.pageX, event.pageY);\r\n\r\n document.addEventListener('mousemove', mousemove, false);\r\n document.addEventListener('mouseup', mouseup, false);\r\n\r\n _self.dispatchEvent(startEvent);\r\n\r\n }\r\n\r\n function onMouseMove(px, py) {\r\n if (_state === STATE.ROTATE && !_self.noRotate) {\r\n\r\n //_rotateEnd.copy(getMouseProjectionOnBall(px, py, _refPos, _refTarget, _refUp));\r\n\r\n orbitRotateEnd.set(\r\n (px - _self.screen.width * 0.5 - _self.screen.left) / _self.radius,\r\n (_self.screen.height * 0.5 + _self.screen.top - py) / _self.radius\r\n );\r\n\r\n } else if (_state === STATE.ZOOM && !_self.noZoom) {\r\n\r\n var d = getMouseOnScreen(px, py),\r\n z = _self.object.zoom;\r\n _self.zoomEnd += (z * (1.0 + ((d.y - _zoomStartVec.y)))) - z;\r\n\r\n //_self.zoomEnd *= 1.0 + ((d.y - _zoomStartVec.y));\r\n\r\n _zoomStartVec.copy(d);\r\n\r\n } else if (_state === STATE.PAN && !_self.noPan) {\r\n\r\n _panEnd.copy(getMouseOnScreen(px, py));\r\n\r\n }\r\n }\r\n\r\n function mousemove(event) {\r\n\r\n if (_self.enabled === false) return;\r\n\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n onMouseMove(event.pageX, event.pageY);\r\n\r\n }\r\n\r\n function mouseup(event) {\r\n\r\n if (_self.enabled === false) return;\r\n\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n _state = STATE.NONE;\r\n\r\n document.removeEventListener('mousemove', mousemove);\r\n document.removeEventListener('mouseup', mouseup);\r\n _self.dispatchEvent(endEvent);\r\n\r\n }\r\n\r\n function mousewheel(event) {\r\n\r\n if (_self.enabled === false) return;\r\n\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n var delta = 0;\r\n\r\n if (event.wheelDelta) {\r\n\r\n // WebKit / Opera / Explorer 9\r\n\r\n delta = event.wheelDelta / 40;\r\n\r\n } else if (event.detail) {\r\n\r\n // Firefox\r\n\r\n delta = - event.detail / 3;\r\n\r\n }\r\n\r\n var z = _self.object.zoom;\r\n\r\n _self.zoomEnd += (z * (1.0 + (delta * 0.02))) - z;\r\n\r\n //_self.zoomEnd *= 1.0 + (delta * -0.01);\r\n\r\n _self.dispatchEvent(startEvent);\r\n _self.dispatchEvent(endEvent);\r\n\r\n }\r\n\r\n function touchstart(event) {\r\n\r\n if (_self.enabled === false) return;\r\n\r\n switch (event.touches.length) {\r\n\r\n case 1:\r\n _state = _self.convertLeftMouse;\r\n\r\n onMouseDown(event.touches[0].pageX, event.touches[0].pageY);\r\n\r\n break;\r\n\r\n case 2:\r\n _state = STATE.TOUCH_ZOOM_PAN;\r\n var dx = event.touches[0].pageX - event.touches[1].pageX;\r\n var dy = event.touches[0].pageY - event.touches[1].pageY;\r\n _touchZoomDistanceEnd = _touchZoomDistanceStart = Math.sqrt(dx * dx + dy * dy);\r\n\r\n var x = (event.touches[0].pageX + event.touches[1].pageX) / 2;\r\n var y = (event.touches[0].pageY + event.touches[1].pageY) / 2;\r\n _panStart.copy(getMouseOnScreen(x, y));\r\n _panEnd.copy(_panStart);\r\n break;\r\n\r\n default:\r\n _state = STATE.NONE;\r\n\r\n }\r\n _self.dispatchEvent(startEvent);\r\n\r\n }\r\n\r\n function touchmove(event) {\r\n\r\n if (_self.enabled === false) return;\r\n\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n switch (event.touches.length) {\r\n\r\n case 1:\r\n onMouseMove(event.touches[0].pageX, event.touches[0].pageY);\r\n break;\r\n\r\n case 2:\r\n var dx = event.touches[0].pageX - event.touches[1].pageX;\r\n var dy = event.touches[0].pageY - event.touches[1].pageY;\r\n _touchZoomDistanceEnd = Math.sqrt(dx * dx + dy * dy);\r\n\r\n var x = (event.touches[0].pageX + event.touches[1].pageX) / 2;\r\n var y = (event.touches[0].pageY + event.touches[1].pageY) / 2;\r\n _panEnd.copy(getMouseOnScreen(x, y));\r\n break;\r\n\r\n default:\r\n _state = STATE.NONE;\r\n\r\n }\r\n\r\n }\r\n\r\n function touchend(event) {\r\n\r\n if (_self.enabled === false) return;\r\n\r\n switch (event.touches.length) {\r\n\r\n case 1:\r\n\r\n onMouseMove(event.touches[0].pageX, event.touches[0].pageY);\r\n\r\n break;\r\n\r\n case 2:\r\n _touchZoomDistanceStart = _touchZoomDistanceEnd = 0;\r\n\r\n var x = (event.touches[0].pageX + event.touches[1].pageX) / 2;\r\n var y = (event.touches[0].pageY + event.touches[1].pageY) / 2;\r\n _panEnd.copy(getMouseOnScreen(x, y));\r\n _panStart.copy(_panEnd);\r\n break;\r\n\r\n }\r\n\r\n _state = STATE.NONE;\r\n _self.dispatchEvent(endEvent);\r\n\r\n }\r\n\r\n function contextmenu(event) {\r\n\r\n event.preventDefault();\r\n\r\n }\r\n\r\n this.dispose = function () {\r\n\r\n this.domElement.removeEventListener('contextmenu', contextmenu, false);\r\n this.domElement.removeEventListener('mousedown', mousedown, false);\r\n this.domElement.removeEventListener('mousewheel', mousewheel, false);\r\n this.domElement.removeEventListener('DOMMouseScroll', mousewheel, false); // firefox\r\n\r\n this.domElement.removeEventListener('touchstart', touchstart, false);\r\n this.domElement.removeEventListener('touchend', touchend, false);\r\n this.domElement.removeEventListener('touchmove', touchmove, false);\r\n\r\n document.removeEventListener('mousemove', mousemove, false);\r\n document.removeEventListener('mouseup', mouseup, false);\r\n\r\n window.removeEventListener('keydown', keydown, false);\r\n window.removeEventListener('keyup', keyup, false);\r\n\r\n }\r\n\r\n this.domElement.addEventListener('contextmenu', contextmenu, false);\r\n //this.domElement.addEventListener('mousedown', mousedown, false);\r\n viewModel.addListener('afterMouseDown', (e) => { mousedown(e.ev); });\r\n\r\n this.domElement.addEventListener('mousewheel', mousewheel, false);\r\n this.domElement.addEventListener('DOMMouseScroll', mousewheel, false); // firefox\r\n\r\n this.domElement.addEventListener('touchstart', touchstart, false);\r\n this.domElement.addEventListener('touchend', touchend, false);\r\n this.domElement.addEventListener('touchmove', touchmove, false);\r\n\r\n //window.addEventListener('keydown', keydown, false);\r\n //window.addEventListener('keyup', keyup, false);\r\n\r\n this.handleResize();\r\n\r\n // force an update at start\r\n this.update();\r\n }\r\n \r\n STATE: {\r\n NONE: number;\r\n ROTATE: number;\r\n ZOOM: number;\r\n PAN: number;\r\n TOUCH_ROTATE: number;\r\n TOUCH_ZOOM_PAN: number;\r\n };\r\n\r\n convertLeftMouse: number;\r\n\r\n rotateStart: THREE.Vector3;\r\n rotateEnd: THREE.Vector3;\r\n rollEnd: THREE.Vector3;\r\n rollStart: THREE.Vector3;\r\n zoomStart: number;\r\n zoomEnd: number;\r\n panStart: THREE.Vector2;\r\n panEnd: THREE.Vector2;\r\n moveStart: THREE.Vector3;\r\n moveEnd: THREE.Vector3;\r\n target: THREE.Vector3;\r\n object: THREE.OrthographicCamera;\r\n domElement: HTMLElement | Document;\r\n enabled: boolean;\r\n cancelMouseDown: boolean;\r\n radius: number;\r\n screen: { left: number, top: number, width: number, height: number };\r\n rotateSpeed: number;\r\n zoomSpeed: number;\r\n noRotate: boolean;\r\n noZoom: boolean;\r\n noPan: boolean;\r\n noRoll: boolean;\r\n staticMoving: boolean;\r\n dynamicDampingFactor: number;\r\n minPolarAngle: number;\r\n maxPolarAngle: number;\r\n keys: number[];\r\n elevationAngle: THREE.Quaternion;\r\n worldZ: THREE.Vector3;\r\n worldX: THREE.Vector3;\r\n target0: THREE.Vector3;\r\n position0: THREE.Vector3;\r\n up0: THREE.Vector3;\r\n left0: number;\r\n right0: number;\r\n top0: number;\r\n bottom0: number;\r\n //handleEvent: (event: any) => void;\r\n rollCamera: (immediately?: boolean) => void;\r\n orbitRotateCamera: (immediately?: boolean) => void;\r\n SetElevationAngle: (angle: THREE.Quaternion) => void;\r\n handleResize: () => void;\r\n rotateCamera: (immediately?: boolean) => void;\r\n zoomCamera: (immediately?: boolean) => void;\r\n panCamera: (immediately?: boolean) => void;\r\n moveCamera: (immediately?: boolean) => void;\r\n update: (immediately?: boolean) => void;\r\n handleEvent: (event: any) => void;\r\n reset: (position: THREE.Vector3, target: THREE.Vector3, left: number, right: number, top: number, bottom: number) => void;\r\n dispose: () => void;\r\n }\r\n}","module LS.Client3DEditor {\r\n\r\n export enum ClientInstanceOption {\r\n None = 0,\r\n StaticSelected = 1\r\n }\r\n\r\n export interface IInstanceData extends MapWithEvents {\r\n ClientObjectInstance?: ClientObjectInstance;\r\n Id: string;\r\n X: number;\r\n Y: number;\r\n Z: number;\r\n SizeX: number;\r\n SizeY: number;\r\n IsActive: number;\r\n InstanceColor: number;\r\n OptionCode?: number;\r\n ModCount?: number;\r\n Orientation?: number;\r\n Meta: string;\r\n }\r\n\r\n export class ClientObjectInstance extends THREE.Mesh {\r\n constructor(clientObject: ClientObject, data: IInstanceData) {\r\n super(clientObject.ClientObjectGeometry, Controller.Current.CommonMaterial);\r\n\r\n var self = this,\r\n instanceData = (new MapWithEvents(data));\r\n if (!instanceData.SizeX)\r\n instanceData.SizeX = 1;\r\n if (!instanceData.SizeY)\r\n instanceData.SizeY = 1;\r\n\r\n Object.defineProperty(instanceData, 'ClientObjectInstance', { enumerable: false, configurable: true, writable: false, value: self });\r\n instanceData.addListener('update', this.OnDataChanged);\r\n this.clientObject = clientObject;\r\n this.instanceData = instanceData;\r\n this.isSelected = false;\r\n this._needsUpdate = true;\r\n this.instanceColor = new THREE.Color();\r\n this.instanceAlpha = 1.0;\r\n this.instanceAlphaOverride = 0;\r\n this.matrixAutoUpdate = false;\r\n clientObject._positionChanged = true;\r\n Controller.Current.Instances[instanceData.Id] = this;\r\n }\r\n\r\n removeMe(skipCheck?: boolean) {\r\n var clientObject = this.clientObject,\r\n instanceContext = clientObject.instanceContext;\r\n\r\n if (clientObject.canSelectInstances && instanceContext)\r\n instanceContext.removeFromOctree(this);\r\n\r\n var clientObjectInstances = clientObject.ClientObjectInstances;\r\n\r\n var idx = clientObjectInstances.indexOf(this);\r\n if (idx !== -1)\r\n clientObjectInstances.splice(idx, 1);\r\n\r\n clientObject._positionChanged = true;\r\n\r\n this.OnDataChanged(new UpdateManagerChangeEvent(this.instanceData, 'remove', null, null, null, !!skipCheck));\r\n\r\n this.dispose();\r\n }\r\n\r\n dispose() {\r\n if (this._isDisposed)\r\n return;\r\n delete Controller.Current.Instances[this.instanceData.Id];\r\n this.instanceData.removeListener();\r\n delete this.clientObject;\r\n delete this.instanceData.ClientObjectInstance;\r\n this._isDisposed = true;\r\n }\r\n\r\n OnSharedMeshChanged() {\r\n this.geometry = this.clientObject.ClientObjectGeometry;\r\n }\r\n\r\n OnDataChanged(e: IChangeEvent) {\r\n var clientObjectInstance = (e.object as IInstanceData).ClientObjectInstance as ClientObjectInstance;\r\n\r\n if (e.name === 'Id') {\r\n delete Controller.Current.Instances[e.oldValue];\r\n Controller.Current.Instances[e.newValue] = clientObjectInstance;\r\n }\r\n\r\n e.dataType = clientObjectInstance.clientObject.dataType;\r\n\r\n Controller.Current.updateManager.handleClientObjectUpdate(e);\r\n clientObjectInstance.OnChanged();\r\n }\r\n\r\n OnChanged() {\r\n this._needsUpdate = true;\r\n this.clientObject._needsUpdate = true;\r\n }\r\n\r\n setVisible(b: boolean) {\r\n this.visible = !!b;\r\n this.clientObject._positionChanged = true;\r\n this.OnChanged();\r\n }\r\n\r\n setPosition(x: number, y: number, z: number) {\r\n var instanceData = this.instanceData;\r\n instanceData.update(\"X\", x);\r\n instanceData.update(\"Y\", y);\r\n instanceData.update(\"Z\", z);\r\n }\r\n\r\n setSize(x: number, y: number) {\r\n var instanceData = this.instanceData;\r\n instanceData.update(\"SizeX\", x);\r\n instanceData.update(\"SizeY\", y);\r\n }\r\n\r\n setByVector(v: THREE.Vector3) {\r\n this.setPosition(v.x, v.y, v.z);\r\n };\r\n\r\n updateSelectionBounds(selBounds: THREE.Box3) {\r\n\r\n let bb = this.geometry.boundingBox,\r\n instanceData = this.instanceData,\r\n sizeX = instanceData.SizeX,\r\n sizeY = instanceData.SizeY,\r\n w = this.clientObject.userData.GeoWidth || ((bb.max.x - bb.min.x) * sizeX),\r\n h = this.clientObject.userData.GeoHeight || ((bb.max.y - bb.min.y) * sizeY),\r\n d = bb.max.z/* * instanceData.SizeZ*/,\r\n x = instanceData.X + bb.min.x * sizeX,\r\n y = instanceData.Y + bb.min.y * sizeY,\r\n z = instanceData.Z,\r\n selMin = selBounds.min,\r\n selMax = selBounds.max;\r\n \r\n selMin.set(Math.min(selMin.x, x), Math.min(selMin.y, y), Math.min(selMin.z, z));\r\n selMax.set(Math.max(selMax.x, x + w), Math.max(selMax.y, y + h), Math.max(selMax.z, z + d));\r\n\r\n //var mat = this.matrixWorld,\r\n // bb = this.geometry.boundingBox;\r\n //selBounds.expandByPoint(bb.min.clone().applyMatrix4(mat));\r\n //selBounds.expandByPoint(bb.max.clone().applyMatrix4(mat));\r\n }\r\n\r\n update() {\r\n if (!this._needsUpdate)// || !this.visible)\r\n return;\r\n this._needsUpdate = false;\r\n\r\n var data = this.instanceData,\r\n position = this.position,\r\n scale = this.scale;\r\n if (position.x !== data.X || position.y !== data.Y || position.z !== data.Z || scale.x !== data.SizeX || scale.y !== data.SizeY) {\r\n this.position.set(data.X, data.Y, data.Z);\r\n this.scale.set(data.SizeX, data.SizeY, 1)\r\n this.updateMatrix();\r\n this.updateMatrixWorld(true);\r\n //this.matrixWorldNeedsUpdate = true;\r\n this.clientObject._positionChanged = true;\r\n }\r\n\r\n if (data.InstanceColor)\r\n this.instanceColor.setHex(data.InstanceColor).multiplyScalar(2).addScalar(-1);\r\n else if (data.OptionCode & ClientInstanceOption.StaticSelected)\r\n this.instanceColor.setRGB(-0.5, 0.5, -0.5);\r\n else\r\n this.instanceColor.setRGB(0, 0, 0);\r\n\r\n if (this.isSelected)\r\n this.instanceColor.addScalar(0.25);\r\n\r\n if (this.instanceAlphaOverride)\r\n this.instanceAlpha = this.instanceAlphaOverride;\r\n else if (data.IsActive)\r\n this.instanceAlpha = 1;\r\n else\r\n this.instanceAlpha = 0.65;\r\n\r\n }\r\n\r\n clientObject: ClientObject;\r\n instanceData: IInstanceData;\r\n isSelected: boolean;\r\n private _needsUpdate: boolean;\r\n instanceColor: THREE.Color;\r\n instanceAlpha: number;\r\n instanceAlphaOverride: number;\r\n _isDisposed: boolean;\r\n }\r\n\r\n export interface ClientObjectUserData {\r\n Options: number;\r\n Orientation: number;\r\n GeoWidth: number;\r\n GeoHeight: number;\r\n ModCount: number;\r\n IconInsertSet: string;\r\n IconInsertIndex: number;\r\n GroupIconInsert: string;\r\n GroupIconInsertSet?: string;\r\n GroupIconInsertIndex?: number;\r\n NumModules: number;\r\n TypeId: string;\r\n BaseParentId: string;\r\n Transparency: number;\r\n IsHidden: boolean;\r\n }\r\n\r\n export class ClientObject extends THREE.Object3D {\r\n\r\n static GetClientObjectUserData(clientObjectJson: ClientObjectUserData | SolarProTool.IClient3DObect): ClientObjectUserData {\r\n return {\r\n Options: clientObjectJson.Options,\r\n Orientation: clientObjectJson.Orientation,\r\n GeoWidth: clientObjectJson.GeoWidth || 0,\r\n GeoHeight: clientObjectJson.GeoHeight || 0,\r\n ModCount: clientObjectJson.ModCount,\r\n IconInsertSet: clientObjectJson.IconInsertSet,\r\n IconInsertIndex: clientObjectJson.IconInsertIndex,\r\n NumModules: clientObjectJson.NumModules,\r\n TypeId: clientObjectJson.TypeId,\r\n GroupIconInsert: clientObjectJson.GroupIconInsert,\r\n GroupIconInsertSet: clientObjectJson.GroupIconInsertSet,\r\n GroupIconInsertIndex: clientObjectJson.GroupIconInsertIndex,\r\n BaseParentId: null,\r\n Transparency: 0,\r\n IsHidden: false\r\n } as ClientObjectUserData;\r\n }\r\n\r\n constructor(sharedMeshes: THREE.Mesh[], type: string, baseParentId: string, clientObjectData?: ClientObjectUserData | SolarProTool.IClient3DObect) {\r\n super();\r\n\r\n var _clientObjectGeometry = null;\r\n var _clientObjectInstances = [];\r\n\r\n Object.defineProperty(this, 'ClientObjectInstances', { enumerable: true, configurable: true, get: () => { return _clientObjectInstances; }, set: (value) => { _clientObjectInstances = value; this._needsUpdate = true; } });\r\n Object.defineProperty(this, 'ClientObjectGeometry', {\r\n enumerable: true, configurable: true, get: () => {\r\n if (_clientObjectGeometry === null) {\r\n var geometry = new THREE.Geometry(),\r\n sharedMeshes = this.SharedMeshes;\r\n for (var i = sharedMeshes.length; i--;) {\r\n var sharedMesh = sharedMeshes[i];\r\n geometry.merge(sharedMesh.geometry instanceof THREE.BufferGeometry ? new THREE.Geometry().fromBufferGeometry(sharedMesh.geometry) : (sharedMesh.geometry), sharedMesh.matrix, 0);\r\n }\r\n geometry.mergeVertices();\r\n if (geometry.boundingBox == null)\r\n geometry.computeBoundingBox();\r\n _clientObjectGeometry = geometry;\r\n }\r\n return _clientObjectGeometry;\r\n }\r\n });\r\n\r\n this.matrixAutoUpdate = false;\r\n\r\n this.SharedMeshes = sharedMeshes;\r\n\r\n //ClientObjectUserData\r\n var data = ClientObject.GetClientObjectUserData(clientObjectData);\r\n if (!data.GroupIconInsertSet)\r\n data.GroupIconInsertSet = data.IconInsertSet;\r\n if (!data.GroupIconInsertIndex)\r\n data.GroupIconInsertIndex = data.IconInsertIndex;\r\n data.BaseParentId = baseParentId ? baseParentId.toLowerCase() : null;\r\n this.userData = data;\r\n this.dataType = type;\r\n Controller.Current.Objects[this.id] = this;\r\n\r\n if (this.canInsertInstances) {\r\n var instanceContext = this.instanceContext;\r\n if (instanceContext)\r\n instanceContext.insertableClientObjects.push(this);\r\n }\r\n }\r\n\r\n userData: ClientObjectUserData;\r\n _positionChanged: boolean = true;\r\n private _offsetsAttribute: THREE.InstancedBufferAttribute/* | FakeInstancedBufferAttribute*/ = null;\r\n private _scalesAttribute: THREE.InstancedBufferAttribute/* | FakeInstancedBufferAttribute*/ = null;\r\n private _colorsAttribute: THREE.InstancedBufferAttribute/* | FakeInstancedBufferAttribute*/ = null;\r\n SharedMeshes: THREE.Mesh[];\r\n BuildMeshes: THREE.Mesh[] = [];\r\n txtHolder: spt.ThreeJs.utils.SDFTextObjectInstances;\r\n private _buildSphere: THREE.Sphere = new THREE.Sphere();\r\n private _buildBounds: THREE.Box3 = new THREE.Box3();\r\n private _updateBounds: THREE.Box3 = new THREE.Box3();\r\n private _updateBoundingSphere: THREE.Sphere = new THREE.Sphere();\r\n _alpha: number = 1.0;\r\n dataType: string;\r\n isClientObject = true;\r\n private _maxInstancedCount: number;\r\n _needsUpdate: boolean = true;\r\n ClientObjectInstances: ClientObjectInstance[];\r\n //virtual geometry of one instance (used for octree)\r\n ClientObjectGeometry: THREE.Geometry;\r\n _isDisposed: boolean;\r\n isHidden: boolean = false;\r\n\r\n setHidden(v: boolean) {\r\n this.isHidden = !!v;\r\n this._needsUpdate = true;\r\n }\r\n\r\n private _onControllerUpdate: () => void = null;\r\n private _onControllerBeforeDelete: () => void = null;\r\n\r\n get instanceContext(): InstanceContext {\r\n return this.userData && Controller.Current && Controller.Current.getInstanceContext(this.userData.BaseParentId);\r\n }\r\n\r\n //get octree(): THREE.Octree {\r\n // if (this.canSelectInstances) {\r\n // var instanceContext = this.instanceContext;\r\n // return instanceContext && instanceContext.octree;\r\n // }\r\n // return null;\r\n //}\r\n\r\n get userOptions() {\r\n return this.isHidden ? Client3DObectOptions.None : this.userData && this.userData.Options;\r\n }\r\n\r\n get canMoveInstances(): boolean {\r\n return !!(this.userOptions & Client3DObectOptions.CanMoveInstances);\r\n }\r\n\r\n get canSelectInstances(): boolean {\r\n return !!(this.userOptions & Client3DObectOptions.CanSelectInstances);\r\n }\r\n\r\n get canInsertInstances(): boolean {\r\n return !!(this.userOptions & (Client3DObectOptions.CanInsertInstances | Client3DObectOptions.CanInsertScaled));\r\n }\r\n \r\n get canScaleInsertInstances(): boolean {\r\n return !!(this.userOptions & Client3DObectOptions.CanInsertScaled);\r\n }\r\n\r\n get hasNoSimpleGeometry(): boolean {\r\n return !!(this.userOptions & Client3DObectOptions.NoSimpleGeometry);\r\n }\r\n\r\n get hasScale(): boolean {\r\n return !!(this.userOptions & (Client3DObectOptions.ScaleX | Client3DObectOptions.ScaleY));\r\n }\r\n\r\n get hasScaleX(): boolean {\r\n return !!(this.userOptions & Client3DObectOptions.ScaleX);\r\n }\r\n\r\n get hasScaleY(): boolean {\r\n return !!(this.userOptions & Client3DObectOptions.ScaleY);\r\n }\r\n\r\n get canBeScaled(): boolean {\r\n return !!(this.userOptions & (Client3DObectOptions.CanBeScaledX | Client3DObectOptions.CanBeScaledY));\r\n }\r\n\r\n get canBeScaledX(): boolean {\r\n return !!(this.userOptions & Client3DObectOptions.CanBeScaledX);\r\n }\r\n\r\n get canBeScaledY(): boolean {\r\n return !!(this.userOptions & Client3DObectOptions.CanBeScaledY);\r\n }\r\n\r\n dispose() {\r\n if (this._isDisposed)\r\n return;\r\n\r\n this.removeFromScene();\r\n\r\n var controller = Controller.Current;\r\n\r\n if (controller) {\r\n\r\n controller.viewModel.updateModuleCount(this.id, 0);\r\n if (controller.Objects[this.id])\r\n delete controller.Objects[this.id];\r\n\r\n if (this.canInsertInstances) {\r\n var instanceContext = this.instanceContext;\r\n if (instanceContext)\r\n instanceContext.insertableClientObjects.remove(this);\r\n }\r\n }\r\n\r\n this.BuildMeshes = [];\r\n if (this.txtHolder) {\r\n this.txtHolder.dispose();\r\n this.txtHolder = null;\r\n }\r\n\r\n this.clearClientObjectInstances();\r\n\r\n this._isDisposed = true;\r\n }\r\n\r\n updateModuleCount() {\r\n var data = this.userData, modsPerInstance = data.NumModules;\r\n if (modsPerInstance)\r\n Controller.Current.viewModel.updateModuleCount(this.id, modsPerInstance * this.ClientObjectInstances.length);\r\n }\r\n\r\n clearClientObjectInstances() {\r\n ArrayHelper.iterateArray(this.ClientObjectInstances, (m: ClientObjectInstance) => {\r\n m.dispose();\r\n });\r\n this.ClientObjectInstances = [];\r\n }\r\n\r\n insertClientObjectInstance(data: IInstanceData, skipCheck?: boolean) {\r\n if (!data.Id || data.Id === \"\")\r\n data.Id = spt.Utils.GenerateGuid();\r\n var newInstance = new ClientObjectInstance(this, data),\r\n instanceContext = this.instanceContext;\r\n this.ClientObjectInstances.push(newInstance);\r\n newInstance.updateMatrixWorld(true);\r\n\r\n if (this.canSelectInstances && instanceContext)\r\n instanceContext.addToOctree(newInstance);\r\n\r\n newInstance.OnDataChanged(new UpdateManagerChangeEvent(newInstance.instanceData, 'insert', null, null, null, !!skipCheck));\r\n }\r\n\r\n SetClientObjectInstancesFromArrayProperties(genericClientObjectInstanceData: SolarProTool.IClientObectDataArrays, count: number) {\r\n this.clearClientObjectInstances();\r\n var clientObjectInstances = this.ClientObjectInstances,\r\n clientObject = this;\r\n\r\n IterateClientObectDataArrays(genericClientObjectInstanceData, data => {\r\n var newInstance = new ClientObjectInstance(clientObject, data);\r\n clientObjectInstances.push(newInstance);\r\n newInstance.updateMatrixWorld(true);\r\n }, count);\r\n }\r\n\r\n clear() {\r\n\r\n this.BuildMeshes = [];\r\n if (this.txtHolder) {\r\n this.txtHolder.dispose();\r\n this.txtHolder = null;\r\n }\r\n spt.ThreeJs.utils.emptyObject3D(this, true, true, false);\r\n }\r\n\r\n update() {\r\n var bounds = this._updateBounds,\r\n boundingSphere = this._updateBoundingSphere;\r\n\r\n ArrayHelper.iterateArray(this.ClientObjectInstances, (m) => {\r\n //if (m.visible)\r\n m.update();\r\n });\r\n\r\n var clientObjects = this.ClientObjectInstances, //.filter(function (m) { return m.visible; }),\r\n objectsLength = clientObjects.length,\r\n buildMeshes = this.BuildMeshes,\r\n positionsChanges = this._positionChanged,\r\n isDragging = Controller.Current.viewModel.isDragging,\r\n isScaling = Controller.Current.viewModel.isScaling;\r\n\r\n if (!objectsLength || this.isHidden) {\r\n this.visible = false;\r\n this._needsUpdate = false;\r\n return;\r\n }\r\n\r\n if (!isDragging && bounds.isEmpty())\r\n positionsChanges = true;\r\n\r\n if (!buildMeshes.length || this._maxInstancedCount < objectsLength/* || (!Detector.webglParameters.supportsInstancedArrays && this._maxInstancedCount !== objectsLength)*/) {\r\n this.build();\r\n buildMeshes = this.BuildMeshes;\r\n }\r\n\r\n var offsets = this._offsetsAttribute,\r\n scales = this._scalesAttribute,\r\n colors = this._colorsAttribute,\r\n alpha = this._alpha,\r\n maxScale = 1;\r\n\r\n this.visible = true;\r\n\r\n if (offsets != null) {\r\n //multiple instances\r\n\r\n var instanceIndex = 0;\r\n\r\n offsets.needsUpdate = positionsChanges;\r\n if (scales)\r\n scales.needsUpdate = positionsChanges;\r\n colors.needsUpdate = true;\r\n\r\n if (isDragging) {\r\n bounds.makeEmpty();\r\n var diff = Controller.Current.viewModel.diffSnapPosition;\r\n offsets.needsUpdate = true;\r\n ArrayHelper.iterateArray(clientObjects, (m) => {\r\n var pos = m.position;\r\n bounds.expandByPoint(pos);\r\n\r\n if (m.visible) {\r\n var a = m.instanceAlpha * alpha;\r\n if (m.isSelected)\r\n offsets.setXYZ(instanceIndex, pos.x + diff.x, pos.y + diff.y, pos.z + diff.z + 10);\r\n else\r\n offsets.setXYZ(instanceIndex, pos.x, pos.y, pos.z);\r\n var col = m.instanceColor;\r\n colors.setXYZW(instanceIndex, col.r, col.g, col.b, a);\r\n ++instanceIndex;\r\n }\r\n });\r\n } else if (scales && isScaling) {\r\n bounds.makeEmpty();\r\n var dt = Controller.Current.viewModel.diffScalePosition,\r\n ds = Controller.Current.viewModel.diffScale;\r\n\r\n scales.needsUpdate = true;\r\n offsets.needsUpdate = true;\r\n ArrayHelper.iterateArray(clientObjects, (m) => {\r\n var pos = m.position,\r\n sc = m.scale;\r\n bounds.expandByPoint(pos);\r\n maxScale = Math.max(maxScale, sc.x, sc.y, sc.z);\r\n \r\n if (m.visible) {\r\n var a = m.instanceAlpha * alpha;\r\n if (m.isSelected) {\r\n offsets.setXYZ(instanceIndex, pos.x + dt.x, pos.y + dt.y, pos.z + dt.z);\r\n scales.setXYZ(instanceIndex, sc.x * ds.x, sc.y * ds.y, sc.z * ds.z);\r\n }\r\n else {\r\n offsets.setXYZ(instanceIndex, pos.x, pos.y, pos.z);\r\n scales.setXYZ(instanceIndex, sc.x, sc.y, sc.z);\r\n }\r\n var col = m.instanceColor;\r\n colors.setXYZW(instanceIndex, col.r, col.g, col.b, a);\r\n ++instanceIndex;\r\n }\r\n });\r\n } else if (positionsChanges) {\r\n bounds.makeEmpty();\r\n if (scales) {\r\n ArrayHelper.iterateArray(clientObjects, (m) => {\r\n var pos = m.position,\r\n sc = m.scale;\r\n bounds.expandByPoint(pos);\r\n maxScale = Math.max(maxScale, sc.x, sc.y, sc.z);\r\n\r\n if (m.visible) {\r\n var a = m.instanceAlpha * alpha;\r\n offsets.setXYZ(instanceIndex, pos.x, pos.y, pos.z);\r\n scales.setXYZ(instanceIndex, sc.x, sc.y, sc.z);\r\n var col = m.instanceColor;\r\n colors.setXYZW(instanceIndex, col.r, col.g, col.b, a);\r\n ++instanceIndex;\r\n }\r\n });\r\n } else {\r\n ArrayHelper.iterateArray(clientObjects, (m) => {\r\n var pos = m.position;\r\n bounds.expandByPoint(pos);\r\n\r\n if (m.visible) {\r\n var a = m.instanceAlpha * alpha;\r\n offsets.setXYZ(instanceIndex, pos.x, pos.y, pos.z);\r\n var col = m.instanceColor;\r\n colors.setXYZW(instanceIndex, col.r, col.g, col.b, a);\r\n ++instanceIndex;\r\n }\r\n });\r\n }\r\n } else {\r\n ArrayHelper.iterateArray(clientObjects, (m) => {\r\n if (m.visible) {\r\n //var pos = m.position;\r\n //bounds.expandByPoint(pos);\r\n var a = m.instanceAlpha * alpha;\r\n //offsets.setXYZ(instanceIndex, pos.x, pos.y, pos.z);\r\n var col = m.instanceColor;\r\n colors.setXYZW(instanceIndex, col.r, col.g, col.b, a);\r\n ++instanceIndex;\r\n }\r\n });\r\n }\r\n\r\n bounds.getBoundingSphere(boundingSphere);\r\n boundingSphere.center.add(this._buildSphere.center);\r\n boundingSphere.radius += this._buildSphere.radius * maxScale;\r\n\r\n for (var i = buildMeshes.length; i--;) {\r\n var geometry = buildMeshes[i].geometry;\r\n (geometry).maxInstancedCount = instanceIndex;\r\n geometry.boundingSphere = boundingSphere;\r\n }\r\n\r\n this.updateMeta();\r\n }\r\n else\r\n //no instance\r\n this.visible = false;\r\n\r\n if (positionsChanges)\r\n this.notifyOctree();\r\n\r\n this._needsUpdate = false;\r\n this._positionChanged = false;\r\n this.updateModuleCount();\r\n }\r\n\r\n notifyOctree() {\r\n if (this.canSelectInstances) {\r\n var instanceContext = this.instanceContext;\r\n if (instanceContext)\r\n instanceContext.notifyOctree();\r\n }\r\n }\r\n\r\n build() {\r\n var bounds = this._buildBounds;\r\n try {\r\n var maxInstancedCount = this._maxInstancedCount = this.ClientObjectInstances.length,\r\n sharedMeshes: THREE.Mesh[] = this.SharedMeshes,\r\n buildMeshes: THREE.Mesh[] = this.BuildMeshes;\r\n\r\n if (buildMeshes.length) {\r\n this.clear();\r\n buildMeshes = this.BuildMeshes;\r\n }\r\n\r\n bounds.makeEmpty();\r\n\r\n var hasScale = (this.userOptions & Client3DObectOptions.ScaleX) !== 0 || (this.userOptions & Client3DObectOptions.ScaleY) !== 0;\r\n\r\n var canBeTransparent = (this.userOptions & Client3DObectOptions.CanDeactivateInstances) !== 0;\r\n\r\n if (this._offsetsAttribute && (this._offsetsAttribute).dispose)\r\n (this._offsetsAttribute).dispose();\r\n this._offsetsAttribute = null;\r\n\r\n if (this._scalesAttribute && (this._scalesAttribute).dispose)\r\n (this._scalesAttribute).dispose();\r\n this._scalesAttribute = null;\r\n\r\n if (this._colorsAttribute && (this._colorsAttribute).dispose)\r\n (this._colorsAttribute).dispose();\r\n this._colorsAttribute = null;\r\n\r\n if (maxInstancedCount === 0) {\r\n //no instance\r\n return;\r\n }\r\n\r\n var offsets = new THREE.InstancedBufferAttribute(new Float32Array(maxInstancedCount * 3), 3, false, 1),\r\n scales = hasScale ? new THREE.InstancedBufferAttribute(new Float32Array(maxInstancedCount * 3), 3, false, 1) : null,\r\n colors = new THREE.InstancedBufferAttribute(new Float32Array(maxInstancedCount * 4), 4, false, 1);\r\n\r\n if (scales)\r\n scales.setUsage(THREE.DynamicDrawUsage);\r\n offsets.setUsage(THREE.DynamicDrawUsage);\r\n colors.setUsage(THREE.DynamicDrawUsage);\r\n\r\n this._offsetsAttribute = offsets;\r\n this._scalesAttribute = scales;\r\n this._colorsAttribute = colors;\r\n\r\n for (var j = sharedMeshes.length; j--;) {\r\n var sharedMesh = sharedMeshes[j],\r\n sharedMeshGeometry = sharedMesh.geometry instanceof THREE.Geometry ? (new THREE.BufferGeometry()).fromGeometry(sharedMesh.geometry) : (new THREE.BufferGeometry()).copy(sharedMesh.geometry);\r\n\r\n sharedMeshGeometry.applyMatrix4(sharedMesh.matrix);\r\n\r\n if (sharedMeshGeometry.boundingBox === null)\r\n sharedMeshGeometry.computeBoundingBox();\r\n\r\n if (sharedMeshGeometry.boundingSphere === null)\r\n sharedMeshGeometry.computeBoundingSphere();\r\n\r\n bounds.union(sharedMeshGeometry.boundingBox);\r\n\r\n var buildGeometry = (new THREE.InstancedBufferGeometry()).copy(sharedMeshGeometry as THREE.InstancedBufferGeometry);\r\n\r\n (buildGeometry as THREE.InstancedBufferGeometry).maxInstancedCount = maxInstancedCount;\r\n buildGeometry.setAttribute('offseti', offsets);\r\n buildGeometry.setAttribute('colori', colors);\r\n if (scales)\r\n buildGeometry.setAttribute('scalei', scales);\r\n\r\n var mesh = new THREE.Mesh(buildGeometry, sharedMesh.material);\r\n if (canBeTransparent)\r\n (mesh.material).transparent = true;\r\n if (sharedMesh.renderOrder)\r\n mesh.renderOrder = sharedMesh.renderOrder;\r\n this.add(mesh);\r\n buildMeshes.push(mesh);\r\n }\r\n\r\n bounds.getBoundingSphere(this._buildSphere);\r\n\r\n //this.updateMeta();\r\n } catch (e) {\r\n console.trace();\r\n throw e;\r\n }\r\n }\r\n\r\n updateMeta() {\r\n if ((this.userOptions & Client3DObectOptions.ShowMetaData) !== 0) {\r\n\r\n var txtHolder = this.txtHolder,\r\n bounds = this._buildBounds,\r\n clientObjects = this.ClientObjectInstances,\r\n objectsLength = clientObjects.length,\r\n voff = bounds.getCenter(new THREE.Vector3()),\r\n isDragging = Controller.Current.viewModel.isDragging;\r\n\r\n if (!txtHolder) {\r\n var color = new THREE.Color(0xFFFFFF),\r\n txtSize = 180,\r\n alignment = new THREE.Vector2(0.5, 0.25);\r\n txtHolder = this.txtHolder = new spt.ThreeJs.utils.SDFTextObjectInstances(txtSize, color, null, alignment);\r\n this.add(txtHolder);\r\n }\r\n\r\n if (txtHolder.instanceCount > objectsLength)\r\n txtHolder.removeInstances(txtHolder.instanceCount - objectsLength);\r\n\r\n voff.z = bounds.max.z + 20;\r\n\r\n if (isDragging) {\r\n var diff = Controller.Current.viewModel.diffSnapPosition;\r\n\r\n ArrayHelper.iterateArray(clientObjects, (m, i) => {\r\n var pos = m.position;\r\n if (m.isSelected)\r\n txtHolder.setTextXYZ(i, m.instanceData.Meta || \"\", pos.x + voff.x + diff.x, pos.y + voff.y + diff.y, pos.z + voff.z + diff.z + 10);\r\n else\r\n txtHolder.setTextXYZ(i, m.instanceData.Meta || \"\", pos.x + voff.x, pos.y + voff.y, pos.z + voff.z);\r\n });\r\n } else {\r\n ArrayHelper.iterateArray(clientObjects, (m, i) => {\r\n var pos = m.position;\r\n\r\n txtHolder.setTextXYZ(i, m.instanceData.Meta || \"\", pos.x + voff.x, pos.y + voff.y, pos.z + voff.z);\r\n });\r\n }\r\n\r\n txtHolder.update();\r\n }\r\n }\r\n\r\n OnSharedMeshChanged() {\r\n this._needsUpdate = true;\r\n ArrayHelper.iterateArray(this.ClientObjectInstances, (m) => {\r\n m.OnSharedMeshChanged();\r\n });\r\n }\r\n\r\n addToScene() {\r\n\r\n var controller = Controller.Current,\r\n instanceContext = this.instanceContext;\r\n\r\n if (controller && !this._onControllerUpdate) {\r\n controller.addListener('update', this._onControllerUpdate = () => {\r\n if (this._needsUpdate)\r\n this.update();\r\n });\r\n }\r\n\r\n if (controller && !this._onControllerBeforeDelete) {\r\n controller.addListener('beforeDelete', this._onControllerBeforeDelete = () => {\r\n this.dispose();\r\n });\r\n }\r\n\r\n if (instanceContext) {\r\n instanceContext.add(this, true);\r\n\r\n if (this.canSelectInstances)\r\n ArrayHelper.iterateArray(this.ClientObjectInstances, (m) => { instanceContext.addToOctree(m); });\r\n }\r\n\r\n }\r\n\r\n removeFromScene() {\r\n\r\n var controller = Controller.Current,\r\n instanceContext = this.instanceContext;\r\n\r\n if (controller) {\r\n controller.removeListener('update', this._onControllerUpdate);\r\n controller.removeListener('beforeDelete', this._onControllerBeforeDelete);\r\n }\r\n\r\n if (instanceContext) {\r\n if (this.canSelectInstances)\r\n ArrayHelper.iterateArray(this.ClientObjectInstances, (m) => { instanceContext.removeFromOctree(m); });\r\n instanceContext.remove(this, true);\r\n }\r\n }\r\n }\r\n\r\n //export class FakeInstancedBufferAttribute {\r\n // constructor(instancedCount: number, itemSize: number) {\r\n // this.instancedCount = instancedCount;\r\n // this.itemSize = itemSize;\r\n // this.geometryBindings = [];\r\n\r\n // Object.defineProperty(this, 'needsUpdate',\r\n // {\r\n // enumerable: true, configurable: true, get: () => {\r\n // return this.geometryBindings.some((g) => {\r\n // return (g.geometry.attributes[g.name]).needsUpdate;\r\n // });\r\n // }, set: (value) => {\r\n // var geometryBindings = this.geometryBindings;\r\n // for (var i = geometryBindings.length; i--;) {\r\n // var g = geometryBindings[i];\r\n // (g.geometry.attributes[g.name]).needsUpdate = value;\r\n // }\r\n // }\r\n // });\r\n // }\r\n\r\n // instancedCount: number;\r\n // itemSize: number;\r\n // geometryBindings: { geometry: THREE.BufferGeometry, name: string, elementCount: number }[];\r\n // needsUpdate: boolean;\r\n\r\n // addToBufferGeometry(geometry: THREE.BufferGeometry, name: string, elementCount: number) {\r\n // var bufferAttribute = new THREE.BufferAttribute(new Float32Array(elementCount * this.instancedCount * this.itemSize), this.itemSize);\r\n // bufferAttribute.setUsage(THREE.DynamicDrawUsage);\r\n // geometry.setAttribute(name, bufferAttribute);\r\n // this.geometryBindings.push({\r\n // geometry: geometry,\r\n // name: name,\r\n // elementCount: elementCount\r\n // });\r\n // }\r\n\r\n // dispose() {\r\n // this.geometryBindings = [];\r\n // }\r\n\r\n // setXY(index: number, x: number, y: number) {\r\n // var geometryBindings = this.geometryBindings;\r\n\r\n // for (var i = geometryBindings.length; i--;) {\r\n // var g = geometryBindings[i],\r\n // itemSize = this.itemSize,\r\n // elementCount = g.elementCount,\r\n // attribute = g.geometry.attributes[g.name] as THREE.BufferAttribute,\r\n // array = attribute.array as number[],\r\n // idx = index * elementCount * itemSize;\r\n // for (var j = elementCount; j--;) {\r\n // var off = j * itemSize;\r\n // array[idx + off] = x;\r\n // array[idx + off + 1] = y;\r\n // }\r\n // }\r\n // }\r\n\r\n // setXYZ(index: number, x: number, y: number, z: number) {\r\n // var geometryBindings = this.geometryBindings;\r\n\r\n // for (var i = geometryBindings.length; i--;) {\r\n // var g = geometryBindings[i],\r\n // itemSize = this.itemSize,\r\n // elementCount = g.elementCount,\r\n // attribute = g.geometry.attributes[g.name] as THREE.BufferAttribute,\r\n // array = attribute.array as number[],\r\n // idx = index * elementCount * itemSize;\r\n // for (var j = elementCount; j--;) {\r\n // var off = j * itemSize;\r\n // array[idx + off] = x;\r\n // array[idx + off + 1] = y;\r\n // array[idx + off + 2] = z;\r\n // }\r\n // }\r\n // }\r\n\r\n // setXYZW(index: number, x: number, y: number, z: number, w: number) {\r\n // var geometryBindings = this.geometryBindings;\r\n\r\n // for (var i = geometryBindings.length; i--;) {\r\n // var g = geometryBindings[i],\r\n // itemSize = this.itemSize,\r\n // elementCount = g.elementCount,\r\n // attribute = g.geometry.attributes[g.name] as THREE.BufferAttribute,\r\n // array = attribute.array as number[],\r\n // idx = index * elementCount * itemSize;\r\n // for (var j = elementCount; j--;) {\r\n // var off = j * itemSize;\r\n // array[idx + off] = x;\r\n // array[idx + off + 1] = y;\r\n // array[idx + off + 2] = z;\r\n // array[idx + off + 3] = w;\r\n // }\r\n // }\r\n // }\r\n //}\r\n}\r\n\r\nif (!(THREE.InstancedBufferAttribute.prototype).dispose)\r\n (THREE.InstancedBufferAttribute.prototype).dispose = () => { };\r\n","module LS.Client3DEditor {\r\n\r\n export enum RoofBackgroundType {\r\n Default = 0,\r\n Maps\r\n }\r\n\r\n enum DisplayModeEnum {\r\n Default = 0,\r\n CAD\r\n }\r\n\r\n export enum RoofType {\r\n FlatRoof = 0,\r\n SlopingRoof = 1\r\n }\r\n\r\n export interface IRoofOptions {\r\n HasMapsBackground: boolean;\r\n RoofBackgroundType: RoofBackgroundType;\r\n }\r\n\r\n export interface ClientObjectJsonData extends ClientObjectUserData {\r\n SharedMeshes: THREE.Mesh[];\r\n Type: string;\r\n DataArrays: any;\r\n Count: number;\r\n }\r\n\r\n export interface IClientObjectLookup {\r\n [id: string]: ClientObject;\r\n }\r\n\r\n export interface IClientObjectInstanceLookup {\r\n [id: string]: ClientObjectInstance;\r\n }\r\n\r\n var beforeDeleteEvent = { type: 'beforeDelete' };\r\n var updateEvent = { type: 'update' };\r\n var stoppedEvent = { type: 'stopped' };\r\n\r\n export class Controller implements IEventManager {\r\n static Current: Controller = null;\r\n\r\n protected _doAnimation: boolean;\r\n\r\n ViewId: string;\r\n ContainerId: string;\r\n TBId: string;\r\n TBContainerId: string;\r\n ContentHeightClass: string;\r\n ContentId: string;\r\n WrapperId: string;\r\n StatusbarId: string;\r\n CameraPadding: number;\r\n ClickTolerance: number;\r\n ContextMenu: string;\r\n DeferredRendering: boolean = false;\r\n private viewNeedsUpdate: number = 0;\r\n\r\n static viewPaddingX = -10;\r\n static viewPaddingY = 0;\r\n\r\n CommonMaterial = new THREE.MeshBasicMaterial({ color: 0xffffff });\r\n //roofAngle: THREE.Quaternion = new THREE.Quaternion(0, 0, 0, 1);\r\n scene: THREE.Scene;\r\n mainLight: THREE.DirectionalLight;\r\n uiscene: THREE.Scene;\r\n globalBox: THREE.Box3;\r\n globalSphere: THREE.Sphere;\r\n camera: THREE.OrthographicCamera | THREE.PerspectiveCamera;\r\n orthoCamera: THREE.OrthographicCamera;\r\n perspectiveCamera: THREE.PerspectiveCamera;\r\n uicamera: THREE.OrthographicCamera;\r\n renderer: THREE.WebGLRenderer;\r\n light: THREE.Light;\r\n ambient: THREE.AmbientLight;\r\n controls: CameraControls;\r\n private _worldRaycaster = new THREE.Raycaster();\r\n private _localRaycaster = new THREE.Raycaster();\r\n testVolume = new spt.ThreeJs.utils.TestVolume();\r\n selectionHelper: SelectionHelper;\r\n transformControlers: THREE.TransformControls[] = [];\r\n interferenceHelper: LS.Client3DEditor.InterferenceHelper;\r\n controlHelper: NavigationHelper;\r\n BuildingClassName: string = null;\r\n Objects: IClientObjectLookup = {};\r\n Instances: IClientObjectInstanceLookup = {};\r\n Alpha: number = 1.0;\r\n $aoes5View: JQuery;\r\n RoofOptions: IRoofOptions = {\r\n HasMapsBackground: false,\r\n RoofBackgroundType: RoofBackgroundType.Default\r\n };\r\n\r\n get localRaycaster(): THREE.Raycaster {\r\n return this.getLocalRaycaster(this.getWorldRaycaster(this._localRaycaster));\r\n }\r\n\r\n get worldRaycaster(): THREE.Raycaster {\r\n return this.getWorldRaycaster(this._worldRaycaster);\r\n }\r\n\r\n getWorldRaycaster(targetRaycaster?: THREE.Raycaster, mouse?: { x: number, y: number }): THREE.Raycaster {\r\n var camera = this.camera;\r\n\r\n if (!mouse)\r\n mouse = this.viewModel.mouse;\r\n\r\n if (!targetRaycaster)\r\n targetRaycaster = this._worldRaycaster;\r\n\r\n targetRaycaster.setFromCamera(mouse, camera);\r\n\r\n targetRaycaster.params.Line.threshold = this.linePrecision;\r\n\r\n return targetRaycaster;\r\n }\r\n\r\n getLocalRaycaster(targetWorldRaycaster: THREE.Raycaster, instanceContext?: InstanceContext): THREE.Raycaster {\r\n targetWorldRaycaster.ray.applyMatrix4((instanceContext || this.viewModel.currentInstance).worldToLocalTransform);\r\n return targetWorldRaycaster;\r\n }\r\n\r\n get boxHelper(): THREE.BoxHelper {\r\n return this.viewModel.currentInstance.boxHelper;\r\n }\r\n\r\n get instanceSelectionHelper(): SelectionHelper {\r\n return this.viewModel.currentInstance.selectionHelper;\r\n }\r\n\r\n get pointingHelper(): PointingHelper {\r\n return this.viewModel.currentInstance.pointingHelper;\r\n }\r\n\r\n get segmentsHelper(): SegmentsHelper {\r\n return this.viewModel.currentInstance.segmentsHelper;\r\n }\r\n\r\n get segmentHighlightHelper(): SegmentHighlightHelper {\r\n return this.viewModel.currentInstance.segmentHighlightHelper;\r\n }\r\n\r\n get edgeHighlightHelper(): SegmentHighlightHelper {\r\n return this.viewModel.currentInstance.edgeHighlightHelper;\r\n }\r\n\r\n get linesHelper(): LinesHelper {\r\n return this.viewModel.currentInstance.linesHelper;\r\n }\r\n\r\n get measureObjectHolder(): MeasureObjectHolder {\r\n return this.viewModel.currentInstance.measureObjectHolder;\r\n }\r\n\r\n get objectHolders(): GenericObjectHolder[] {\r\n return this.viewModel.currentInstance.objectHolders;\r\n }\r\n\r\n get stringObjectHolder(): StringObjectHolder {\r\n return this.viewModel.currentInstance.stringObjectHolder;\r\n }\r\n\r\n get conduitObjectHolder(): ConduitObjectHolder {\r\n return this.viewModel.currentInstance.conduitObjectHolder;\r\n }\r\n\r\n get directedAreaHolder(): DirectedAreaHolder {\r\n return this.viewModel.currentInstance.directedAreaHolder;\r\n }\r\n\r\n get measureVisualizer(): MeasureVisualizer {\r\n return this.viewModel.currentInstance.measureVisualizer;\r\n }\r\n\r\n get lineSegmentsHelper(): LineSegmentsHelper {\r\n return this.viewModel.currentInstance.lineSegmentsHelper;\r\n }\r\n\r\n get linePrecision() {\r\n return this.ClickTolerance / this.orthoCamera.zoom;\r\n }\r\n\r\n static viewModelInstance: ViewModel = null;\r\n static updateManagerInstance: UpdateManager = null;\r\n private static viewModelChangeListener: () => void = null;\r\n\r\n get viewModel() {\r\n return Controller.viewModelInstance;\r\n }\r\n\r\n set viewModel(vm: ViewModel) {\r\n Controller.viewModelInstance = vm;\r\n }\r\n\r\n get updateManager() {\r\n return Controller.updateManagerInstance;\r\n }\r\n\r\n set updateManager(um: UpdateManager) {\r\n Controller.updateManagerInstance = um;\r\n }\r\n\r\n animate: () => void;\r\n\r\n public static init() {\r\n if (Controller.Current) {\r\n Controller.Current.dispose();\r\n Controller.Current = null;\r\n }\r\n return new Controller();\r\n }\r\n\r\n public async getImageBlob() {\r\n\r\n return new Promise(resolve => {\r\n // pre\r\n this.renderer.setClearColor(0xFFFFFF, 0);\r\n this.uiscene.visible = false;\r\n\r\n // render\r\n this.BeforeRendering();\r\n this.Render();\r\n\r\n var canvas = this.renderer.domElement;\r\n canvas.toBlob((blob) => {\r\n //this.saveBlob(blob, `screencapture-${canvas.width}x${canvas.height}.png`);\r\n\r\n // post\r\n this.renderer.setClearColor(0xFFFFFF);\r\n this.uiscene.visible = true;\r\n\r\n resolve(blob);\r\n });\r\n });\r\n }\r\n\r\n public saveBlob(blob, fileName) {\r\n const a = document.createElement('a');\r\n document.body.appendChild(a);\r\n a.style.display = 'none';\r\n const url = window.URL.createObjectURL(blob);\r\n a.href = url;\r\n a.download = fileName;\r\n a.click();\r\n }\r\n\r\n constructor() {\r\n var options = LS.Client3DEditor.globalParams;\r\n\r\n this._doAnimation = false;\r\n\r\n var animate: () => void;\r\n\r\n if (options.DeferredRendering) {\r\n animate = () => {\r\n if (this._doAnimation) {\r\n requestAnimationFrame(animate);\r\n this.BeforeRendering();\r\n if (this.viewNeedsUpdate) {\r\n //ko.tasks.runEarly();\r\n this.Render();\r\n --this.viewNeedsUpdate;\r\n }\r\n } else\r\n this.dispatchEvent(stoppedEvent);\r\n };\r\n } else {\r\n animate = () => {\r\n if (this._doAnimation) {\r\n requestAnimationFrame(animate);\r\n this.BeforeRendering();\r\n this.Render();\r\n } else\r\n this.dispatchEvent(stoppedEvent);\r\n };\r\n }\r\n\r\n this.animate = animate;\r\n for (let key in options) {\r\n if (options.hasOwnProperty(key))\r\n this[key] = options[key];\r\n }\r\n\r\n if (Controller.Current) {\r\n throw new Error(\"Single instance error: Instantiation failed: Use Controller.init instead of new.\");\r\n }\r\n\r\n Controller.Current = this;\r\n\r\n this.$aoes5View = $(this.ViewId);\r\n\r\n var scene = this.scene = new THREE.Scene();\r\n var uiscene = this.uiscene = new THREE.Scene();\r\n\r\n //CAMERAS\r\n var orthoCameraDistance = 500000;\r\n var camera = this.orthoCamera = new THREE.OrthographicCamera(-10000, 10000, 10000, -10000, 100, orthoCameraDistance * 2);\r\n camera.position.set(0, 0, orthoCameraDistance);\r\n\r\n var globalBox = this.globalBox = new THREE.Box3(new THREE.Vector3(0, 0, -5000), new THREE.Vector3(10000, 10000, 5000));\r\n var globalSphere = this.globalSphere = globalBox.getBoundingSphere(new THREE.Sphere());//new THREE.Sphere(new THREE.Vector3(5000, 5000, 0), 5000);\r\n\r\n var perspectiveCamera = this.perspectiveCamera = this.camera = new THREE.PerspectiveCamera(40, 1, 10, 100000);\r\n camera.add(perspectiveCamera);\r\n\r\n var _orthoZoom = camera.zoom;\r\n Object.defineProperty(camera, 'zoom', { enumerable: true, configurable: true, get: () => { return _orthoZoom; }, set: (value) => { _orthoZoom = value; spt.ThreeJs.utils.ComputeProjectionUpdate(perspectiveCamera, camera, globalSphere, orthoCameraDistance); } });\r\n\r\n camera.updateProjectionMatrix = perspectiveCamera.updateProjectionMatrix = () => { spt.ThreeJs.utils.ComputeProjectionUpdate(perspectiveCamera, camera, globalSphere, orthoCameraDistance); };\r\n\r\n var uicamera = this.uicamera = new THREE.OrthographicCamera(-10000, 10000, 10000, -10000, 10, 10000);\r\n uicamera.position.set(0, 0, 5000);\r\n\r\n //CAMERAS END\r\n\r\n //RENDERER\r\n\r\n var renderer = this.renderer = new THREE.WebGLRenderer({\r\n antialias: false,\r\n preserveDrawingBuffer: true,\r\n alpha: true // makes it possible to make a screenshot/image blob in transparent\r\n });\r\n renderer.sortObjects = true;\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n renderer.setClearColor(0xFFFFFF); // to make the image blob transparent set alpha to 0\r\n\r\n //console.log(\"test:\" + this.viewModel.view.css('width'));\r\n\r\n renderer.setSize(this.viewModel.ContainerWidth, this.viewModel.ContainerHeight);\r\n renderer.autoClear = false;\r\n var domTarget = $(this.ViewId).get(0);\r\n domTarget.appendChild(renderer.domElement);\r\n DManager.makeUnselectable($(renderer.domElement));\r\n\r\n if (!Detector.webglParameters.supportsInstancedArrays) {\r\n DManager.showErrorMessage($('#ao-WebGLWarningMessage').html() + ' (MISSING_EXTENSION:ANGLE_instanced_arrays)');\r\n WriteTraceSimple(\"AO 2.0 ERROR - WEBGL Feature ANGLE_instanced_arrays Missing: \" + Detector.browserInfo.name + \" v \" + Detector.browserInfo.version, \"Anordnung\");\r\n }\r\n\r\n spt.ThreeJs.utils.SDFFontMaterial.textureAnisotropy = Detector.webglParameters.maxAnisotropy;\r\n spt.ThreeJs.utils.SDFFontMaterial.precision = Detector.webglParameters.maxFloatPrecision;\r\n spt.ThreeJs.utils.SDFFontMaterial.imagePath = SDFFontPath;\r\n\r\n //renderer.gammaInput = true;\r\n //renderer.gammaOutput = true;\r\n\r\n //renderer.domElement.addEventListener('mousemove', ViewModel.onMouseMove.bind(ViewModel), false);\r\n\r\n //3D control Ui\r\n var controlHelper = this.controlHelper = new NavigationHelper(camera, uicamera);\r\n uiscene.add(controlHelper);\r\n\r\n //Axis\r\n //var axisHelper = new THREE.AxesHelper(1000);\r\n //scene.add(axisHelper);\r\n\r\n //Grid helper\r\n //if (window.isDebugMode) {\r\n // var gridHelper = new THREE.GridHelper(1000000, 100, 0x888888, 0x8888DD);\r\n // gridHelper.rotation.x = Math.PI * 0.5;\r\n // scene.add(gridHelper);\r\n //}\r\n\r\n //LIGHTS\r\n var light = this.light = this.mainLight = new THREE.DirectionalLight(0xffffff, 0.8);\r\n light.position.set(1.2, -1, 2).normalize();\r\n scene.add(light);\r\n\r\n var ambient = this.ambient = new THREE.AmbientLight(0x505050);\r\n scene.add(ambient);\r\n\r\n // camera controls\r\n var controls = this.controls = new CameraControls(camera, domTarget, Controller.viewModelInstance);\r\n //controls.noRotate = true;\r\n //controls.staticMoving = true;\r\n controls.addEventListener('change', controlHelper.UpdateOrientation.bind(controlHelper));\r\n\r\n //Boxhelper\r\n //var boxHelper = this.boxHelper = new THREE.BoxHelper();\r\n //(boxHelper.geometry as any).dynamic = true;\r\n //boxHelper.visible = false;\r\n //scene.add(boxHelper);\r\n\r\n //roofPlane\r\n //var roofOrigin = this.roofOrigin = new THREE.Vector3();\r\n //var roofPlane = this.roofPlane = new THREE.Plane().setFromNormalAndCoplanarPoint(new THREE.Vector3(0, 0, 1), roofOrigin);\r\n\r\n //this.testScene(scene);\r\n\r\n //selection helper\r\n var selectionHelper = this.selectionHelper = new SelectionHelper();\r\n uiscene.add(selectionHelper);\r\n\r\n this.interferenceHelper = new InterferenceHelper();\r\n\r\n this.viewModel.genericParameters.setOverloadEntries([\r\n { name: \"X\", displayName: \"X\", value: 0, inputType: \"int\" },\r\n { name: \"Y\", displayName: \"Y\", value: 0, inputType: \"int\" },\r\n //{ name: \"Z\", displayName: \"Z\", value: 0, inputType: \"int\" },\r\n { name: \"Width\", displayName: \"Width\", value: 0, inputType: \"int\" },\r\n { name: \"Height\", displayName: \"Height\", value: 0, inputType: \"int\" },\r\n { name: \"Rotation\", displayName: \"Rotation\", value: 0, inputType: \"float\", precision: 2, isAngle: true }\r\n ]);\r\n\r\n if (options.DeferredRendering) {\r\n var updateView = Controller.viewModelChangeListener = this.notifyRefreshView.bind(this);\r\n\r\n controls.addEventListener('change', updateView);\r\n controls.addEventListener('start', updateView);\r\n controls.addEventListener('end', updateView);\r\n this.viewModel.addListener('change', updateView);\r\n this.updateManager.addListener('change', updateView);\r\n LoaderManager.addListener('finished', updateView);\r\n LoaderManager.addListener('resourceLoaded', updateView);\r\n }\r\n\r\n }\r\n\r\n notifyRefreshView() {\r\n this.viewNeedsUpdate = 2;\r\n }\r\n\r\n Start() {\r\n setTimeout(() => {\r\n if (!this._doAnimation) {\r\n this._doAnimation = true;\r\n this.animate();\r\n }\r\n }, 0);\r\n }\r\n\r\n Stop(callback?: () => void): void {\r\n if (this._doAnimation) {\r\n if (callback) {\r\n var stopfunction = () => {\r\n this.removeListener('stopped', stopfunction);\r\n callback();\r\n };\r\n this.addListener('stopped', stopfunction);\r\n }\r\n this._doAnimation = false;\r\n } else if (callback) {\r\n callback();\r\n }\r\n }\r\n\r\n addListener(type: string, listener: (event: IEventManagerEvent) => void): EventManager { return this; }\r\n\r\n hasListener(type: string, listener: (event: IEventManagerEvent) => void): boolean { return false; }\r\n\r\n removeListener(type?: string, listener?: (event: IEventManagerEvent) => void): void { }\r\n\r\n dispatchEvent(event: IEventManagerEvent): void { }\r\n\r\n dispose(): void {\r\n if (this.viewModel && Controller.viewModelChangeListener) {\r\n this.viewModel.removeListener('change', Controller.viewModelChangeListener);\r\n this.updateManager.removeListener('change', Controller.viewModelChangeListener);\r\n LoaderManager.removeListener('finished', Controller.viewModelChangeListener);\r\n LoaderManager.removeListener('resourceLoaded', Controller.viewModelChangeListener);\r\n Controller.viewModelChangeListener = null;\r\n }\r\n\r\n var childs = this.scene.children;\r\n for (var i = childs.length; i--;) {\r\n var child = childs[i];\r\n if (child instanceof ClientObject) {\r\n var coChildren = child.children;\r\n for (var j = coChildren.length; j--;) {\r\n var coChild = coChildren[j] as THREE.Mesh;\r\n if (coChild.geometry && coChild.geometry && (coChild.geometry as any).attributes) {\r\n var attributes = (coChild.geometry as any).attributes;\r\n if (attributes.position)\r\n delete (coChild.geometry as any).attributes.position;\r\n if (attributes.normal)\r\n delete (coChild.geometry as any).attributes.normal;\r\n if (attributes.uv)\r\n delete (coChild.geometry as any).attributes.uv;\r\n }\r\n }\r\n }\r\n }\r\n\r\n this.Stop();\r\n this.dispatchEvent(beforeDeleteEvent);\r\n if (this.renderer)\r\n this.renderer.state.reset();\r\n spt.ThreeJs.utils.disposeObject3D(this.scene);\r\n if (this.renderer && typeof this.renderer.dispose == \"function\")\r\n this.renderer.dispose();\r\n }\r\n\r\n BeforeRendering() {\r\n var pointingHelper = this.pointingHelper;\r\n this.controls.update();\r\n if (pointingHelper.visible) {\r\n var sc = this.ClickTolerance / this.orthoCamera.zoom;\r\n pointingHelper.scale.set(sc, sc, sc);\r\n }\r\n\r\n this.update();\r\n this.updateManager.update();\r\n this.viewModel.update();\r\n this.objectHolders.forEach(o => o.updateObjects());\r\n this.interferenceHelper.update(this);\r\n this.lineSegmentsHelper.update();\r\n }\r\n\r\n Render(): void {\r\n var renderer = this.renderer;\r\n renderer.clear();\r\n renderer.render(this.scene, this.camera);\r\n renderer.clearDepth();\r\n renderer.render(this.uiscene, this.uicamera);\r\n }\r\n\r\n update(): void {\r\n this.dispatchEvent(updateEvent);\r\n }\r\n\r\n getInstanceContext(id: string) {\r\n return this.viewModel.getInstanceContext(id, this);\r\n }\r\n\r\n clearClientObjects(clearAllInstances?: boolean) {\r\n var viewModel = this.viewModel;\r\n\r\n if (clearAllInstances) {\r\n //remove instances\r\n viewModel.instances.forEach((inst: InstanceContext) => {\r\n inst.measureObjectHolder.clear();\r\n inst.objectHolders.forEach(o => o.clear());\r\n inst.directedAreaHolder.clear();\r\n });\r\n\r\n var clientObjects = this.Objects;\r\n for (var id in clientObjects) {\r\n clientObjects[id].dispose();\r\n }\r\n this.Objects = {};\r\n viewModel.selected.removeAll();\r\n viewModel.clearInstances();\r\n } else {\r\n\r\n //empty only current instance\r\n var currentInstance = viewModel.currentInstance;\r\n currentInstance.measureObjectHolder.clear();\r\n currentInstance.objectHolders.forEach(o => o.clear());\r\n currentInstance.directedAreaHolder.clear();\r\n currentInstance.getClientObjects().forEach(co => {\r\n co.dispose();\r\n });\r\n viewModel.selected.removeAll();\r\n }\r\n\r\n }\r\n\r\n addClientObjects(clientObjects: ClientObjectJsonData[] | SolarProTool.IClient3DObect[]) {\r\n for (var i = clientObjects.length; i--;) {\r\n var clientObjectJson = clientObjects[i],\r\n baseParentId = clientObjectJson.BaseParentId || spt.Utils.GenerateGuid(),\r\n clientObject = new ClientObject(spt.ThreeJs.utils.ConvertThreeJsObject(clientObjectJson.SharedMeshes), clientObjectJson.Type, baseParentId, clientObjectJson);\r\n clientObject.SetClientObjectInstancesFromArrayProperties(clientObjectJson.DataArrays as SolarProTool.IClientObectDataArrays, clientObjectJson.Count);\r\n clientObject.addToScene();\r\n\r\n if (clientObjectJson.Transparency/* this.viewModel.EditorViewMode === \"Electric\" && clientObjectJson.Type.indexOf(\"ModuleObject\") !== -1*/) {\r\n var opacity = 1 - clientObjectJson.Transparency;\r\n clientObject.ClientObjectInstances.forEach(ci => {\r\n ci.instanceAlphaOverride = opacity;\r\n });\r\n }\r\n\r\n if (clientObjectJson.IsHidden)\r\n clientObject.setHidden(true);\r\n\r\n if (clientObject.SharedMeshes && clientObject.SharedMeshes.length) {\r\n for (var j = clientObject.SharedMeshes.length; j--;) {\r\n var sharedMesh = clientObject.SharedMeshes[j],\r\n material = sharedMesh.material;\r\n if ((material).isModuleAppearanceShader) {\r\n this.viewModel.setModuleAppearance(material as LS.Client3DEditor.ModuleAppearanceShader);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n this.setAlpha(1);\r\n this.notifyRefreshView();\r\n }\r\n\r\n setEditorViewObject(data: SolarProTool.IEditorViewObject, resetView: boolean) {\r\n\r\n var viewModel = this.viewModel,\r\n controlHelper = this.controlHelper,\r\n measureObjectHolder = this.measureObjectHolder,\r\n objectHolders = this.objectHolders,\r\n directedAreaHolder = this.directedAreaHolder,\r\n buildingSettings = data.BuildingSettings as IEntrySetting[],\r\n updateManager = this.updateManager;\r\n\r\n //this.roofAngle.set(data.RoofAngleX, data.RoofAngleY, data.RoofAngleZ, data.RoofAngleW);\r\n\r\n directedAreaHolder.clear();\r\n measureObjectHolder.clear();\r\n objectHolders.forEach(o => o.clear());\r\n\r\n var globalOrientationRadian = data.GlobalOrientationRadian || 0;\r\n var groundZ = data.GroundZ || 0;\r\n var worldOrigin = new MapDrawing.LatLng(data.WorldOrigin.Latitude, data.WorldOrigin.Longitude);\r\n var layoutOrientationRad = data.LayoutOrientation == 0 ? 0 : data.LayoutOrientation / 180 * Math.PI;\r\n var layoutOrientationMoveToZero = new THREE.Vector3().copy(data.LayoutOrientationMoveToZero as any);\r\n\r\n //set roof objects\r\n this.setEditorViewObjectIntern(data, worldOrigin, globalOrientationRadian, groundZ, layoutOrientationRad, layoutOrientationMoveToZero);\r\n\r\n if (data.EditorViewObjects && data.EditorViewObjects.length) {\r\n data.EditorViewObjects.forEach(reditorViewObject => {\r\n this.setEditorViewObjectIntern(reditorViewObject, worldOrigin, globalOrientationRadian, groundZ, layoutOrientationRad, layoutOrientationMoveToZero);\r\n });\r\n }\r\n\r\n viewModel.currentInstance = this.getInstanceContext(data.InstanceHolderId) || null;\r\n\r\n var globalBox = this.globalBox.set(new THREE.Vector3(data.BoundsX, data.BoundsY, data.BoundsZ), new THREE.Vector3(data.BoundsX + data.BoundsWidth, data.BoundsY + data.BoundsHeight, data.BoundsZ + data.BoundsDepth));\r\n var boxPadding = new THREE.Vector3(5000, 5000, 5000);\r\n viewModel.instances.forEach((inst) => {\r\n globalBox.expandByObject(inst.root);\r\n });\r\n globalBox.min.sub(boxPadding);\r\n globalBox.max.add(boxPadding);\r\n globalBox.getBoundingSphere(this.globalSphere);\r\n\r\n controlHelper.SetCompassOrientation(data.RoofOrientation);\r\n //controlHelper.SetElevationAngle(this.roofAngle);\r\n controlHelper.UpdateOrientation();\r\n\r\n if (data.HasShadows) {\r\n $('#shadevisible').hide();\r\n $('#shadehide, #aoShadowLegend').show();\r\n } else {\r\n $('#shadevisible').show();\r\n $('#shadehide, #aoShadowLegend').hide();\r\n }\r\n\r\n if (resetView) {\r\n\r\n onWindowResize();\r\n this.resetView(true);\r\n\r\n //var w = this.ContainerWidth,\r\n // h = this.ContainerHeight,\r\n // vw2 = w / 2,\r\n // vh2 = h / 2,\r\n // rw2 = rw / 2.0,\r\n // rh2 = rh / 2.0;\r\n\r\n //camera.zoom = Math.min((this.ContainerWidth - this.CameraPadding) / rw, (this.ContainerHeight - this.CameraPadding) / rh);\r\n //camera.far = Math.ceil(roofSizeVectorLength * 2.0);\r\n\r\n //var roofUp = new THREE.Vector3(0, 0, 1).applyQuaternion(this.roofAngle),\r\n // roofyAngle = Math.atan2(roofUp.x, roofUp.z),\r\n // roofyAngleDegree = Math.abs(roofyAngle / Math.PI * 180),\r\n // roofxAngle = Math.atan2(roofUp.y, roofUp.z),\r\n // roofxAngleDegree = roofxAngle / Math.PI * 180,\r\n // yUp = new THREE.Vector3(0, 0, 1);\r\n\r\n //if (roofxAngleDegree > 0 && roofxAngleDegree < 45)\r\n // yUp.applyAxisAngle(new THREE.Vector3(1, 0, 0), roofxAngle);\r\n\r\n //if (roofyAngleDegree > 0 && roofyAngleDegree < 45)\r\n // yUp.applyAxisAngle(new THREE.Vector3(0, 1, 0), -roofyAngle);\r\n\r\n //yUp.multiplyScalar(roofSizeVectorLength);\r\n\r\n //var viewTarget = new THREE.Vector3(rw2, rh2, 0),\r\n // camPos = viewTarget.clone().add(yUp);\r\n\r\n //controls.reset(camPos, viewTarget, -vw2, vw2, vh2, -vh2);\r\n //controls.handleResize();\r\n //controls.SetElevationAngle(this.roofAngle);\r\n\r\n //camera.updateProjectionMatrix();\r\n\r\n //uicamera.left = -vw2;\r\n //uicamera.right = vw2;\r\n //uicamera.top = vh2;\r\n //uicamera.bottom = -vh2;\r\n //uicamera.updateProjectionMatrix();\r\n }\r\n\r\n if (data.InstanceholderAppearance && typeof (data.InstanceholderAppearance) === \"object\") {\r\n var appearance = data.InstanceholderAppearance,\r\n roofAppearance = viewModel.roofAppearance;\r\n Object.keys(appearance).forEach(k => {\r\n roofAppearance[k] = appearance[k];\r\n });\r\n viewModel.hideRoofAppearance = false;\r\n } else {\r\n viewModel.hideRoofAppearance = true;\r\n }\r\n\r\n this.BuildingClassName = data.BuildingClassName || null;\r\n\r\n this.viewModel.genericParameters.setPossibleEntrySettings(buildingSettings);\r\n\r\n this.setAlpha(1);\r\n\r\n this.RoofOptions.RoofBackgroundType = data.RoofBackgroundType;\r\n this.RoofOptions.HasMapsBackground = !!data.HasMapsBackground;\r\n\r\n //rotate mainlight\r\n this.mainLight.position.set(1.2, -1, 2).applyQuaternion(new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 0, 1), THREE.MathUtils.degToRad(180 - data.RoofOrientation))).normalize();\r\n\r\n if (viewModel.selectedTool === \"dimensionLines\" && viewModel.currentRoofLayers.indexOf(StrCustomDimensioning) === -1)\r\n viewModel.deselectTool();\r\n\r\n this.conduitObjectHolder.setConduitObjects(data.ConduitObjects);\r\n\r\n updateManager.clearHistory();\r\n\r\n this.notifyRefreshView();\r\n }\r\n\r\n private setEditorViewObjectIntern(data: SolarProTool.IEditorViewObject, origin: MapDrawing.LatLng, orientationRad: number, groundz: number, layoutOrientationRad: number, layoutOrientationMoveToZero: THREE.Vector3) {\r\n var viewModel = this.viewModel,\r\n instanceContext = this.getInstanceContext(data.InstanceHolderId);\r\n\r\n if (instanceContext) {\r\n viewModel.currentInstance = instanceContext;\r\n instanceContext.setByEditorViewObject(data, origin, orientationRad, groundz, layoutOrientationRad, layoutOrientationMoveToZero, this);\r\n }\r\n }\r\n\r\n loadAnordnungObjects(callBack?: () => void) {\r\n LoaderManager.addLoadingJob();\r\n this.Stop(() => {\r\n //AManager.Service('ProjectServices.asmx').Method('GetProjectOverviewData')\r\n SolarProTool.Ajax('WebServices/Anordnung3DService.asmx').Call('GetAnordnungObjects').Data({ compressData: true }).CallBack(data => {\r\n if (data) {\r\n window.CheckStaticAndLoadBackup();\r\n\r\n var clientObjects = data.ClientObjects;\r\n\r\n this.setEditorViewObject(data, true);\r\n\r\n if (clientObjects)\r\n this.addClientObjects(clientObjects);\r\n\r\n if (callBack)\r\n callBack();\r\n\r\n } else {\r\n DManager.showErrorMessage(\"Error on loading roof. Please try again.\");\r\n }\r\n this.Start();\r\n LoaderManager.finishLoadingJob();\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on loading roof. Please try again.\");\r\n this.Start();\r\n LoaderManager.finishLoadingJob();\r\n });\r\n });\r\n }\r\n\r\n loadCADObjects(resetView: boolean, checkStatic?: boolean, callBack?: () => void) {\r\n LoaderManager.addLoadingJob();\r\n var layers: string[] = [];\r\n $('input[name=Layer]:checked').each((idx, elem) => {\r\n layers.push($(elem).val() as any);\r\n });\r\n if (!this._doAnimation)\r\n resetView = true;\r\n this.Stop(() => {\r\n SolarProTool.Ajax('WebServices/Anordnung3DService.asmx').Call('GetAutoCADObjects').Data({ layer: layers }).CallBack(data => {\r\n if (data) {\r\n\r\n if (checkStatic)\r\n window.CheckStaticAndLoadBackup();\r\n\r\n var clientObjects = data.ClientObjects;\r\n\r\n this.setEditorViewObject(data, resetView);\r\n\r\n if (clientObjects)\r\n this.addClientObjects(clientObjects);\r\n\r\n if (callBack)\r\n callBack();\r\n\r\n } else {\r\n DManager.showErrorMessage(\"Error on loading roof. Please try again.\");\r\n }\r\n this.Start();\r\n LoaderManager.finishLoadingJob();\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on loading roof. Please try again.\");\r\n this.Start();\r\n LoaderManager.finishLoadingJob();\r\n });\r\n });\r\n }\r\n\r\n loadStaticObjects(resetView: boolean, checkStatic?: boolean, callBack?: () => void) {\r\n LoaderManager.addLoadingJob();\r\n var layers = [];\r\n $('input[name=Layer]:checked').each((idx, elem) => {\r\n layers.push($(elem).val());\r\n });\r\n\r\n if (layers.indexOf('Statics') === -1)\r\n layers.unshift('Statics');\r\n if (!this._doAnimation)\r\n resetView = true;\r\n this.Stop(() => {\r\n SolarProTool.Ajax('WebServices/Anordnung3DService.asmx').Call('GetStaticObjects').Data({ layer: layers }).CallBack(data => {\r\n if (data) {\r\n\r\n if (checkStatic)\r\n window.CheckStaticAndLoadBackup();\r\n\r\n var clientObjects = data.ClientObjects;\r\n\r\n this.setEditorViewObject(data, resetView);\r\n\r\n if (clientObjects)\r\n this.addClientObjects(clientObjects);\r\n\r\n if (callBack)\r\n callBack();\r\n\r\n } else {\r\n DManager.showErrorMessage(\"Error on loading roof. Please try again.\");\r\n }\r\n this.Start();\r\n LoaderManager.finishLoadingJob();\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on loading roof. Please try again.\");\r\n this.Start();\r\n LoaderManager.finishLoadingJob();\r\n });\r\n });\r\n }\r\n\r\n loadElectricObjects(resetView: boolean, callBack?: () => void) {\r\n LoaderManager.addLoadingJob();\r\n if (!this._doAnimation)\r\n resetView = true;\r\n this.Stop(() => {\r\n SolarProTool.Ajax('WebServices/Anordnung3DService.asmx').Call('GetElectricObjects').Data().CallBack(data => {\r\n if (data) {\r\n var clientObjects = data.ClientObjects;\r\n\r\n this.setEditorViewObject(data, resetView);\r\n\r\n if (clientObjects)\r\n this.addClientObjects(clientObjects);\r\n\r\n if (callBack)\r\n callBack();\r\n\r\n } else {\r\n DManager.showErrorMessage(\"Error on loading roof. Please try again.\");\r\n }\r\n this.Start();\r\n LoaderManager.finishLoadingJob();\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on loading roof. Please try again.\");\r\n this.Start();\r\n LoaderManager.finishLoadingJob();\r\n });\r\n });\r\n\r\n }\r\n\r\n onObjectsInitialized() {\r\n if (window[\"OnStart\" + window.EditorViewMode])\r\n window[\"OnStart\" + window.EditorViewMode]();\r\n }\r\n\r\n getPositionOnRoof(viewPosition: { x: number, y: number }) {\r\n var raycaster = this._worldRaycaster,\r\n camera = this.camera,\r\n viewModel = this.viewModel,\r\n v = new THREE.Vector2();\r\n\r\n v.set((viewPosition.x / viewModel.width) * 2 - 1, -(viewPosition.y / viewModel.height) * 2 + 1);\r\n\r\n raycaster.setFromCamera(v, camera);\r\n\r\n return viewModel.currentInstance.getLocalPosition(raycaster.ray) || null;\r\n }\r\n\r\n doUndo() {\r\n var boxHelper = this.boxHelper;\r\n if (boxHelper.visible)\r\n setBoxhelper(null);\r\n this.updateManager.Undo();\r\n this.notifyRefreshView();\r\n }\r\n\r\n doRedo() {\r\n var boxHelper = this.boxHelper;\r\n if (boxHelper.visible)\r\n setBoxhelper(null);\r\n this.updateManager.Redo();\r\n this.notifyRefreshView();\r\n }\r\n\r\n switchActiveStates() {\r\n this.viewModel.selected.forEach((o) => {\r\n o.instanceData.update(\"IsActive\", o.instanceData.IsActive ? 0 : 1);\r\n });\r\n }\r\n\r\n switchVisibleStates() {\r\n this.viewModel.selected.forEach((o) => {\r\n o.setVisible(!o.visible);\r\n });\r\n }\r\n\r\n switchStaticSelected(b: boolean) {\r\n this.viewModel.selected.forEach((o) => {\r\n o.instanceData.update(\"OptionCode\", b ? (o.instanceData.OptionCode | ClientInstanceOption.StaticSelected) : (o.instanceData.OptionCode & ~ClientInstanceOption.StaticSelected));\r\n });\r\n }\r\n\r\n moveSelectedStatic(x: number, y: number, z: number, applyDirect?: boolean, allowMouseDown?: boolean) {\r\n var viewModel = this.viewModel,\r\n _v1 = new THREE.Vector3();\r\n\r\n if (viewModel.selectedUi.length) {\r\n if (viewModel.selectedTool === 'keyboardSteps')\r\n viewModel.deselectTool();\r\n\r\n _v1.set(x || 0, y || 0, z || 0);\r\n for (var i = viewModel.selectedUi.length; i--;) {\r\n viewModel.selectedUi[i].moveBy(_v1);\r\n }\r\n viewModel.selectionUiNeedsUpdate = true;\r\n return;\r\n }\r\n\r\n if (viewModel.selectedTool == null)\r\n viewModel.setTool('keyboardSteps?enforce=' + (allowMouseDown ? \"1\" : \"0\"));\r\n if (viewModel.selectedTool === 'keyboardSteps')\r\n (viewModel.tools[viewModel.selectedTool] as KeyboardSteps).moveSelected(x, y, z);\r\n if (applyDirect)\r\n viewModel.deselectTool();\r\n }\r\n\r\n scaleSelectedStatic(len: number, lenNew: number, dirX: number, dirY: number) {\r\n var viewModel = this.viewModel;\r\n viewModel.deselectTool();\r\n\r\n var dt = new THREE.Vector3(),\r\n ds = new THREE.Vector3();\r\n\r\n var dl = lenNew / len;\r\n var t = lenNew - len;\r\n\r\n ds.set(Math.abs(dl * dirX), Math.abs(dl * dirY), 1);\r\n dt.set(t * dirX * 0.5, t * dirY * 0.5, 0);\r\n\r\n viewModel.ApplyDiffScalePosition(dt, ds);\r\n }\r\n\r\n startRotate() {\r\n if (this.viewModel.selectedUi.length)\r\n this.viewModel.setTool(\"rotateObjectTool\");\r\n }\r\n\r\n switchTransparenceAll() {\r\n var controller = this;\r\n var alpha = controller.Alpha;\r\n var objects = controller.Objects;\r\n if (alpha >= 1.0)\r\n alpha = 0.3;\r\n else\r\n alpha = 1.0;\r\n for (var id in objects) {\r\n var clientObject = objects[id] as ClientObject;\r\n clientObject._alpha = alpha;\r\n clientObject._needsUpdate = true;\r\n }\r\n controller.setAlpha(alpha);\r\n\r\n this.notifyRefreshView();\r\n }\r\n\r\n setAlpha(alpha: number) {\r\n var controller = this;\r\n if (controller.Alpha != alpha) {\r\n var objects = controller.Objects;\r\n for (var id in objects) {\r\n var clientObject = objects[id];\r\n clientObject._alpha = alpha;\r\n clientObject._needsUpdate = true;\r\n }\r\n controller.directedAreaHolder.setAlpha(alpha);\r\n controller.Alpha = alpha;\r\n }\r\n }\r\n\r\n selectAll() {\r\n var viewModel = this.viewModel;\r\n var objects = viewModel.currentInstance.getClientObjects();\r\n var co = objects.filter((o) => {\r\n return !!(o.userOptions & Client3DObectOptions.CanSelectInstances);\r\n });\r\n var allInstances: ClientObjectInstance[] = [];\r\n for (var i = co.length; i--;) {\r\n allInstances = allInstances.concat(co[i].ClientObjectInstances);\r\n }\r\n viewModel.selectedUi.removeAll();\r\n viewModel.addToSelection(allInstances, true);\r\n }\r\n\r\n deleteSelected() {\r\n var viewModel = this.viewModel;\r\n var controller = this;\r\n var types: { [type: string]: LS.Client3DEditor.IChange } = {};\r\n\r\n var selUi = viewModel.selectedUi.slice();\r\n if (selUi.length) {\r\n viewModel.selectedUi.removeAll();\r\n for (var k = 0, l = selUi.length; k < l; k++) {\r\n selUi[k].removeInstance();\r\n }\r\n }\r\n\r\n viewModel.selected.forEach((o) => {\r\n var instanceData = o.instanceData,\r\n type = o.clientObject.dataType;\r\n if (o.clientObject.userOptions & Client3DObectOptions.CanDeleteInstances) {\r\n if (!types[type])\r\n types[type] = {\r\n Uuid: THREE.MathUtils.generateUUID(),\r\n TypeString: type,\r\n UpdateType: 'remove',\r\n NewValueString: null,\r\n OldValueString: null,\r\n Name: null,\r\n IdStrings: [],\r\n skipCheck: true\r\n };\r\n\r\n types[type].IdStrings.push(instanceData.Id);\r\n }\r\n });\r\n\r\n var changes: LS.Client3DEditor.IChange[] = [];\r\n for (var type in types) {\r\n changes.push(types[type]);\r\n }\r\n\r\n viewModel.selected.removeAll();\r\n if (changes.length) {\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"DeleteClientObjects\").Data({ changes: changes as SolarProTool.ClientObjectChanges[] }).CallBack(changes => {\r\n if (window.EditorViewMode === \"Electric\") {\r\n controller.reloadElectricPlan();\r\n return;\r\n }\r\n\r\n var hasErrors = false;\r\n var deletedCount = 0;\r\n var additionalChanges: LS.Client3DEditor.IChange[] = [];\r\n for (var m = 0, n = changes.length; m < n; m++) {\r\n var change = changes[m];\r\n if (change.ErrorCode != ErrorLevel.NoError) {\r\n hasErrors = true;\r\n controller.updateManager.handleErrorChange(change as LS.Client3DEditor.IChange);\r\n } else if (change.UpdateType === \"remove\") {\r\n var ids = change.IdStrings;\r\n for (var i = 0, j = ids.length; i < j; i++) {\r\n (controller.Instances[ids[i]]).removeMe(true);\r\n }\r\n deletedCount += ids.length;\r\n } else {\r\n additionalChanges.push(change as LS.Client3DEditor.IChange);\r\n }\r\n }\r\n if (!hasErrors)\r\n controller.updateManager.onNoError();\r\n if (deletedCount > 200)\r\n controller.updateManager.doClearHistory = true;\r\n if (additionalChanges.length) {\r\n Controller.Current.updateManager.handleModifiedChanges(additionalChanges, false);\r\n }\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n });\r\n }\r\n\r\n }\r\n\r\n connectModules(so?: StringObjectInstance, skipReload?: boolean) {\r\n var controller = this,\r\n viewModel = controller.viewModel;\r\n\r\n if (so && !so.modulesStringObjectValid())\r\n so = null;\r\n\r\n var moduleObjects: ClientObjectInstance[];\r\n if (so)\r\n moduleObjects = so.Joints.map(j => j.getClientObjectInstance(this)).filter(m => !!m);\r\n else\r\n moduleObjects = viewModel.selected.filter(o => o.clientObject.dataType.indexOf(\"ModuleObject\") != -1);\r\n\r\n var diffusionPointObjects = viewModel.selected.filter(o => o.clientObject.dataType.indexOf(\"DiffusionPointObject\") != -1);\r\n\r\n if (!moduleObjects.length) {\r\n DManager.ShowSmallInfo(window.electricTranslation[\"PolyDes_ElectricSelectModules\"]);\r\n return;\r\n }\r\n\r\n var parentList: { [id: string]: number } = {};\r\n\r\n moduleObjects.forEach(m => {\r\n var bpId = m.clientObject.userData.BaseParentId;\r\n if (!parentList[bpId])\r\n parentList[bpId] = 0;\r\n parentList[bpId]++;\r\n });\r\n\r\n var baseParentId: string = null;\r\n var bpCount = 0;\r\n\r\n Object.keys(parentList).forEach(id => {\r\n if (parentList[id] > bpCount) {\r\n bpCount = parentList[id];\r\n baseParentId = id;\r\n }\r\n });\r\n\r\n var moduleObjectsIds = moduleObjects.map(m => m.instanceData.Id);\r\n var diffusionPointObjectId = diffusionPointObjects.length ? diffusionPointObjects[0].instanceData.Id : null;\r\n\r\n LS.Electric.CreateModuleConnectionGroup(moduleObjectsIds, baseParentId, diffusionPointObjectId, so ? so.IdString : LS.Electric.InvertersModel.selectedString, (b: boolean) => {\r\n if (!skipReload && b)\r\n controller.reloadOnlyElectric();\r\n });\r\n }\r\n\r\n setModuleClientConnections(moduleConnections: SolarProTool.IModuleConnectionGroup[]) {\r\n var stringObjectHolder = this.stringObjectHolder;\r\n\r\n stringObjectHolder.clear();\r\n\r\n if (moduleConnections) {\r\n var stringingTool = this.viewModel.tools.stringingTool,\r\n invertersModel = LS.Electric.InvertersModel;\r\n\r\n moduleConnections.forEach(mcg => {\r\n var mso = invertersModel.getModulesStringObject(mcg.ModulesStringObjectId);\r\n var diffPointId = mcg.DiffusionPointObjectId;\r\n\r\n if (mso) {\r\n var newSo = stringObjectHolder.getById(mso.Id);\r\n if (newSo)\r\n newSo.removeAll();\r\n else\r\n newSo = stringObjectHolder.addNewStringObject(mso.Id);\r\n newSo.setStringColor(mso.Color);\r\n\r\n newSo.DiffusionPointObjectId = diffPointId;\r\n\r\n if (mcg.Joints && mcg.Joints.length) {\r\n mcg.Joints.forEach(jt => {\r\n newSo.addJoint(new THREE.Vector3(jt.X, jt.Y, jt.Z), jt.ModuleObjectIdString);\r\n });\r\n } else {\r\n mcg.ModuleObjectIds.forEach(modid => {\r\n var mid = modid.toLowerCase(),\r\n pos = stringingTool.getPositionFromClientObjectInstance(this.Instances[mid]);\r\n newSo.addJoint(pos, mid);\r\n });\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n reloadOnlyElectric() {\r\n LS.Electric.GetElectricObjects();\r\n }\r\n\r\n reloadElectricPlan() {\r\n this.reloadModulePlan(false, LS.Electric.GetElectricObjects);\r\n }\r\n\r\n reloadModulePlan(reload?: boolean, callBack?: () => void, opts?: string) {\r\n if (window.EditorViewMode === \"Anordnung\" || window.EditorViewMode === \"Electric\") {\r\n this.viewModel.selected.removeAll();\r\n LoaderManager.addLoadingJob();\r\n this.Stop(() => {\r\n AManager.Ajax('Anordnung3DService.asmx', 'GetAllClient3DObects', JSON.stringify({ reload: !!reload, opts: opts || null, mode: window.EditorViewMode }), (clientObjects: SolarProTool.Client3DObjectHolder) => {\r\n this.setClientObjects(clientObjects);\r\n if (callBack)\r\n callBack();\r\n this.Start();\r\n LoaderManager.finishLoadingJob();\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n this.Start();\r\n LoaderManager.finishLoadingJob();\r\n });\r\n });\r\n }\r\n }\r\n\r\n reloadAll(keepView?: boolean, reload?: boolean, callBack?: () => void) {\r\n var controller = this;\r\n\r\n controller.updateManager.clearHistory();\r\n controller.clearClientObjects(true);\r\n //controller.removeRoofObject();\r\n\r\n switch (window.EditorViewMode) {\r\n case \"Anordnung\":\r\n controller.loadAnordnungObjects(callBack);\r\n break;\r\n case \"Electric\":\r\n controller.loadElectricObjects(!keepView, callBack);\r\n break;\r\n case \"AutoCAD\":\r\n controller.loadCADObjects(!keepView, !!reload, callBack);\r\n break;\r\n case \"Static\":\r\n controller.loadStaticObjects(!keepView, true, callBack);\r\n break;\r\n }\r\n\r\n }\r\n\r\n regenerateModulePlan(withCorridors?: boolean, callBack?: () => void) {\r\n if (LoaderManager.isLoading())\r\n return;\r\n\r\n this.viewModel.selected.removeAll();\r\n this.Stop(() => {\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"GenerateWithGetClient3DObects\").Data({ withCorridors: !!withCorridors }).CallBack(clientObjects => {\r\n if (clientObjects) {\r\n this.setClientObjects(clientObjects);\r\n this.Start();\r\n if (callBack)\r\n callBack();\r\n } else {\r\n this.Start();\r\n setTimeout(() => {\r\n this.reloadAll(true, true, callBack);\r\n }, 0);\r\n }\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n this.Start();\r\n });\r\n });\r\n }\r\n\r\n fillRoof(callBack?: () => void) {\r\n if (LoaderManager.isLoading())\r\n return;\r\n\r\n this.viewModel.selected.removeAll();\r\n LoaderManager.addLoadingJob();\r\n this.Stop(() => {\r\n AManager.Ajax('Anordnung3DService.asmx', 'FillWithGetClient3DObects', \"{}\", (clientObjects: SolarProTool.Client3DObjectHolder) => {\r\n this.setClientObjects(clientObjects);\r\n this.Start();\r\n LoaderManager.finishLoadingJob();\r\n if (callBack)\r\n callBack();\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n this.Start();\r\n LoaderManager.finishLoadingJob();\r\n });\r\n });\r\n }\r\n\r\n resetConstructed() {\r\n if (LoaderManager.isLoading())\r\n return;\r\n var controller = this;\r\n this.viewModel.selected.removeAll();\r\n LoaderManager.addLoadingJob();\r\n AManager.Ajax('Anordnung3DService.asmx', 'ResetConstructed', null, (result: SolarProTool.Client3DObjectHolder) => {\r\n controller.setClientObjects(result);\r\n LoaderManager.finishLoadingJob();\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n LoaderManager.finishLoadingJob();\r\n });\r\n }\r\n\r\n setClientObjects(client3DObjectHolder: SolarProTool.Client3DObjectHolder, keepView?: boolean) {\r\n var controller = this;\r\n controller.updateManager.clearHistory();\r\n controller.clearClientObjects();\r\n if (this.viewModel.selectedInsertable)\r\n this.viewModel.deselectTool();\r\n\r\n if (client3DObjectHolder) {\r\n\r\n var instanceHolderIds: { [id: string]: boolean } = {},\r\n clientObjects = client3DObjectHolder.ClientObjects;\r\n\r\n clientObjects.forEach(co => { if (co.BaseParentId) instanceHolderIds[co.BaseParentId.toLowerCase()] = true; });\r\n\r\n controller.viewModel.instances.forEach(inst => {\r\n if (instanceHolderIds[inst.Id.toLowerCase()]) {\r\n var clientObjects = inst.getClientObjects();\r\n if (clientObjects && clientObjects.length)\r\n clientObjects.forEach(co => {\r\n co.dispose();\r\n });\r\n }\r\n });\r\n\r\n if (clientObjects && clientObjects.length)\r\n controller.addClientObjects(clientObjects);\r\n var directedAreas = client3DObjectHolder.DirectedAreas;\r\n if (directedAreas && directedAreas.length)\r\n controller.directedAreaHolder.addDirectedAreaDefinitions(directedAreas);\r\n var conduitObjects = client3DObjectHolder.ConduitObjects;\r\n if (conduitObjects && conduitObjects.length)\r\n controller.conduitObjectHolder.setConduitObjects(conduitObjects);\r\n var measureObjects = client3DObjectHolder.MeasureObjects;\r\n if (measureObjects && measureObjects.length)\r\n this.viewModel.currentInstance.measureObjectHolder.addMeasureObjects(measureObjects);\r\n }\r\n if (!keepView)\r\n controller.resetView();\r\n this.setAlpha(1);\r\n }\r\n\r\n onDblclick() {\r\n if (this.viewModel.selectedTool || window.EditorViewMode !== \"Anordnung\" || LoaderManager.isLoading())\r\n return;\r\n\r\n var viewModel = this.viewModel,\r\n worldRayCaster = this.worldRaycaster;\r\n\r\n var instanceContext = viewModel.findInstanceContext(worldRayCaster.ray, null, 5);\r\n\r\n if (instanceContext && viewModel.currentInstance !== instanceContext)\r\n this.switchInstanceHolder(instanceContext);\r\n }\r\n\r\n switchInstanceHolder(instanceContext: InstanceContext, callBack?: () => void) {\r\n var viewModel = this.viewModel;\r\n if (window.EditorViewMode !== \"Anordnung\" || LoaderManager.isLoading() || !instanceContext || viewModel.currentInstance.Id === instanceContext.Id) {\r\n if (callBack)\r\n callBack();\r\n return;\r\n }\r\n\r\n viewModel.currentInstance.onDeactivate();\r\n\r\n viewModel.currentInstance = instanceContext;\r\n\r\n instanceContext.onActivate();\r\n\r\n this.resetView();\r\n\r\n SolarProTool.Ajax(\"WebServices/ProjectServices.asmx\").Call(\"SwitchInstanceholder\").Data({ instanceHolderId: instanceContext.Id }).CallBack(result => {\r\n window.OnProjectInfoCallBack(result);\r\n\r\n if (viewModel.currentInstance.Id !== result.InstanceHolderId)\r\n viewModel.currentInstance = viewModel.getInstanceContext(result.InstanceHolderId, this);\r\n\r\n if (callBack)\r\n callBack();\r\n });\r\n }\r\n\r\n SetupElectricView(viewLayer: IViewLayer) {\r\n if (!viewLayer)\r\n return;\r\n\r\n var clientObjects = this.Objects;\r\n var viewLayerName = viewLayer.Name;\r\n\r\n if (viewLayerName === \"Stringing\") {\r\n for (var id in clientObjects) {\r\n var clientObject = clientObjects[id];\r\n if (clientObject.dataType.indexOf(\"RailObject\") !== -1)\r\n clientObject.setHidden(true);\r\n }\r\n this.stringObjectHolder.getAllStringObjects().forEach(so => {\r\n so.isHidden = false;\r\n });\r\n if (this.viewModel.selectedTool !== \"conduitTool\") {\r\n this.viewModel.deselectTool();\r\n if (!this.viewModel.FlyoutVisible || !this.viewModel.ShowInverterFlyout)\r\n ToolBox.showInverterFlyout();\r\n }\r\n } else { //viewLayer.Name === \"Grounding\"\r\n for (var id in clientObjects) {\r\n var clientObject = clientObjects[id];\r\n if (clientObject.dataType.indexOf(\"RailObject\") !== -1)\r\n clientObject.setHidden(false);\r\n }\r\n this.stringObjectHolder.getAllStringObjects().forEach(so => {\r\n so.isHidden = true;\r\n });\r\n if (this.viewModel.selectedTool !== \"conduitTool\") {\r\n this.viewModel.deselectTool();\r\n if (this.viewModel.FlyoutVisible)\r\n ToolBox.closeFlyout();\r\n }\r\n }\r\n\r\n //if (viewLayerName) {\r\n // var componentSetById = this.viewModel.tools.conduitTool.viewModel.ComponentSetById;\r\n // Controller.Current.conduitObjectHolder.getAllConduitObjects().forEach(co => {\r\n // var componentSet = co && co.ComponentSetId && componentSetById[co.ComponentSetId];\r\n // if (componentSet && componentSet.ViewLayer && componentSet.ViewLayer !== viewLayerName)\r\n // co.isHidden = true;\r\n // else \r\n // co.isHidden = false;\r\n // });\r\n //}\r\n\r\n if (this.viewModel.selectedTool !== \"conduitTool\") {\r\n this.viewModel.deselectTool();\r\n }\r\n }\r\n\r\n resetView(fast?: boolean) {\r\n var controller = this,\r\n camera = controller.orthoCamera,\r\n controls = controller.controls,\r\n currentInstance = controller.viewModel.currentInstance;\r\n\r\n var rw = currentInstance.Width,\r\n rh = currentInstance.Height,\r\n angleQuat = currentInstance.AngleQuat,\r\n transform = new THREE.Matrix4().makeRotationFromQuaternion(angleQuat).premultiply(currentInstance.root.matrix),\r\n transformNormal = new THREE.Matrix3().getNormalMatrix(transform),\r\n rw2 = rw / 2,\r\n rh2 = rh / 2,\r\n roofUp = new THREE.Vector3(0, 0, 1).applyQuaternion(angleQuat),\r\n roofyAngle = Math.atan2(roofUp.x, roofUp.z),\r\n roofyAngleDegree = Math.abs(roofyAngle / Math.PI * 180),\r\n roofxAngle = Math.atan2(roofUp.y, roofUp.z),\r\n roofxAngleDegree = roofxAngle / Math.PI * 180,\r\n yUp = new THREE.Vector3(0, 0, 1);\r\n\r\n if (roofxAngleDegree > 0 && roofxAngleDegree < 45)\r\n yUp.applyAxisAngle(new THREE.Vector3(1, 0, 0), roofxAngle);\r\n\r\n if (roofyAngleDegree > 0 && roofyAngleDegree < 45)\r\n yUp.applyAxisAngle(new THREE.Vector3(0, 1, 0), -roofyAngle);\r\n\r\n controls.rotateStart.copy(yUp).applyMatrix3(transformNormal);\r\n camera.getWorldDirection(controls.rotateEnd).negate();\r\n\r\n controls.rollStart.set(0, 1, 0).applyMatrix3(transformNormal);\r\n controls.rollEnd.copy(camera.up);\r\n\r\n controls.zoomStart = camera.zoom;\r\n controls.zoomEnd = Math.min((controller.viewModel.ContainerWidth - this.CameraPadding) / rw, (controller.viewModel.ContainerHeight - this.CameraPadding) / rh);\r\n\r\n controls.panStart.set(0, 0);\r\n controls.panEnd.set(0, 0);\r\n\r\n controls.moveStart.copy(controls.target);\r\n controls.moveEnd.set(rw2, rh2, 0).applyMatrix4(transform);\r\n\r\n controls.update(fast);\r\n if (fast)\r\n this.controlHelper.UpdateOrientation();\r\n }\r\n\r\n switchCamera() {\r\n var controller = this;\r\n var orthoCamera = controller.orthoCamera,\r\n perspectiveCamera = controller.perspectiveCamera,\r\n camera: THREE.Camera;\r\n\r\n if (controller.camera === orthoCamera) {\r\n camera = controller.camera = perspectiveCamera;\r\n\r\n this.transformControlers.forEach(tc => {\r\n tc.camera = camera;\r\n tc.setSize(0.5);\r\n });\r\n } else {\r\n camera = controller.camera = orthoCamera;\r\n this.transformControlers.forEach(tc => {\r\n tc.camera = camera;\r\n tc.setSize(0.1);\r\n });\r\n }\r\n controller.camera.updateProjectionMatrix();\r\n this.notifyRefreshView();\r\n }\r\n\r\n switchMapsBackground() {\r\n if (this.RoofOptions.HasMapsBackground && this.RoofOptions.RoofBackgroundType !== RoofBackgroundType.Maps) {\r\n this.RoofOptions.RoofBackgroundType = RoofBackgroundType.Maps;\r\n this.reloadRoofObject();\r\n } else if (this.RoofOptions.RoofBackgroundType === RoofBackgroundType.Maps) {\r\n this.RoofOptions.RoofBackgroundType = RoofBackgroundType.Default;\r\n this.reloadRoofObject();\r\n }\r\n }\r\n\r\n calculateShadowing() {\r\n LoaderManager.addLoadingJob();\r\n AManager.Ajax('ShadeService.asmx', 'HasShadowsToCalculate', \"{}\", (hasShadows) => {\r\n if (hasShadows) {\r\n AManager.Ajax('ShadeService.asmx', 'CalculateAllShadowObjects', \"{}\", () => {\r\n this.RoofOptions.RoofBackgroundType = RoofBackgroundType.Default;\r\n //this.reloadRoofObject();\r\n this.reloadAll(true, false);\r\n LoaderManager.finishLoadingJob();\r\n }, () => {\r\n LoaderManager.finishLoadingJob();\r\n });\r\n }\r\n else {\r\n LoaderManager.finishLoadingJob();\r\n }\r\n }, () => {\r\n LoaderManager.finishLoadingJob();\r\n });\r\n }\r\n\r\n hideShadowing() {\r\n LoaderManager.addLoadingJob();\r\n AManager.Ajax('ShadeService.asmx', 'DeleteShadowObjects', \"{}\", () => {\r\n //this.reloadRoofObject();\r\n this.reloadAll(true, false);\r\n LoaderManager.finishLoadingJob();\r\n }, () => {\r\n LoaderManager.finishLoadingJob();\r\n });\r\n }\r\n\r\n showShadowLegend(b: boolean) {\r\n if (b) {\r\n $('#shadevisible').hide();\r\n $('#shadehide, #aoShadowLegend').show();\r\n } else {\r\n $('#shadevisible').show();\r\n $('#shadehide, #aoShadowLegend').hide();\r\n }\r\n }\r\n\r\n reloadRoofObject(reloadProject?: boolean, resetView = true) {\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"GetCurrentRoofObject\").Data({ backgroundType: this.RoofOptions.RoofBackgroundType, editorViewMode: this.viewModel.EditorViewMode, reloadProject: !!reloadProject }).CallBack(data => {\r\n if (data) {\r\n this.setEditorViewObject(data, resetView);\r\n } else {\r\n DManager.showErrorMessage(\"Error on returning loading roof.\");\r\n }\r\n });\r\n }\r\n\r\n ToggleDirectedAreaDirection() {\r\n if (this.viewModel.selectedTool)\r\n return;\r\n if (this.viewModel.selectedUi && this.viewModel.selectedUi.length)\r\n this.directedAreaHolder.changeAreaDirection((this.viewModel.selectedUi.filter(s => s instanceof spt.ThreeJs.utils.DirectedAreaDefinition)) as any);\r\n }\r\n\r\n ToggleCopyDirectedArea() {\r\n $(\".copyDirectedArea\").slideToggle(\"fast\");\r\n }\r\n\r\n ApplyCopyDirectedArea() {\r\n var count = spt.Utils.GetFloatFromInput(\"#copy_da_count\", { min: 1, max: 50, isFeet: false, applyArithmetic: true, notImperial: true, precision: 0 });\r\n var distance = spt.Utils.GetFloatFromInput(\"#copy_da_distance\", { min: 0, max: 100000, isFeet: false, applyArithmetic: true, notImperial: true, precision: 0 });\r\n var direction = parseInt($(\"#copy_da_direction\").val() as any) || 0;\r\n\r\n var dir: THREE.Vector3 = null;\r\n\r\n switch (direction) {\r\n case 0:\r\n dir = new THREE.Vector3(0, 1, 0);\r\n break;\r\n case 1:\r\n dir = new THREE.Vector3(1, 0, 0);\r\n break;\r\n case 2:\r\n dir = new THREE.Vector3(0, -1, 0);\r\n break;\r\n case 3:\r\n dir = new THREE.Vector3(-1, 0, 0);\r\n break;\r\n }\r\n\r\n if (dir)\r\n this.doDuplicate(count, distance, dir);\r\n\r\n this.ToggleCopyDirectedArea();\r\n }\r\n\r\n doDuplicate(count?: number, distance?: number, direction?: THREE.Vector3) {\r\n if (LoaderManager.isLoading())\r\n return;\r\n if (this.viewModel.selected && this.viewModel.selected.length) {\r\n this.viewModel.selectedToolUri = 'insertSingle?multiple=1';\r\n ko.tasks.runEarly();\r\n }\r\n if (this.viewModel.selectedTool)\r\n return;\r\n if (this.viewModel.selectedUi && this.viewModel.selectedUi.length)\r\n this.viewModel.selectedUi.forEach(s => s.duplicate(count, distance, direction));\r\n }\r\n\r\n DuplicateModules() {\r\n if (LoaderManager.isLoading())\r\n return;\r\n if (this.viewModel.selected && this.viewModel.selected.length) {\r\n this.viewModel.selectedToolUri = 'insertSingle?multiple=1';\r\n } else {\r\n DManager.ShowSmallInfo(\"Please select one or more modules.\")\r\n }\r\n }\r\n\r\n SaveConstructionValues() {\r\n var controller = this;\r\n var viewModel = this.viewModel;\r\n\r\n var roofAreaStartX = spt.Utils.ConvertStringToValue(viewModel.RoofAreaStartX || \"0\");\r\n var roofAreaStartY = spt.Utils.ConvertStringToValue(viewModel.RoofAreaStartY || \"0\");\r\n var roofAreaDistanceToRoofBorder = spt.Utils.ConvertStringToValue(viewModel.RoofAreaDistanceToRoofBorder + '');\r\n var roofOrientation = spt.Utils.ConvertStringToValue(viewModel.RoofOrientation + '') || 0;\r\n var optimizeBlockLayout = !!$('#RoofArea_GenericRoofAreaSettings_OptimizeBlockLayout').is(':checked');\r\n if (roofAreaStartX !== null && roofAreaStartX >= -500000 && roofAreaStartY !== null && roofAreaStartY >= -500000) {\r\n if (roofAreaDistanceToRoofBorder === null || roofAreaDistanceToRoofBorder < 0)\r\n roofAreaDistanceToRoofBorder = -1;\r\n\r\n LoaderManager.addLoadingJob();\r\n AManager.Ajax('AppServices.asmx', 'SaveKonstrukctionValuesAnordnung', JSON.stringify({ xstart: roofAreaStartX, ystart: roofAreaStartY, distanceToRoof: roofAreaDistanceToRoofBorder, roofOrientation: roofOrientation, optimizeBlockLayout: optimizeBlockLayout }), (result: string) => {\r\n LoaderManager.finishLoadingJob();\r\n if (result && result.indexOf('success') !== -1) {\r\n var reloadRoof = result.indexOf('reloadRoof') !== -1;\r\n var recreate = result.indexOf('recreate') !== -1;\r\n\r\n if (recreate) {\r\n controller.regenerateModulePlan(false,\r\n reloadRoof\r\n ? () => {\r\n controller.reloadRoofObject();\r\n }\r\n : null);\r\n } else {\r\n controller.reloadRoofObject(true);\r\n }\r\n\r\n } else {\r\n DManager.showErrorMessage(result);\r\n }\r\n\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on saving construction values.\");\r\n LoaderManager.finishLoadingJob();\r\n });\r\n }\r\n }\r\n\r\n ShowModuleMetaDialog() {\r\n if (LoaderManager.isLoading())\r\n return;\r\n\r\n var ids = this.viewModel.selected.filter(sel => !sel._isDisposed && !!sel.instanceData).map(sel => sel.instanceData.Id);\r\n\r\n if (!ids.length) {\r\n DManager.ShowSmallInfo(\"Please select one or more modules.\")\r\n return;\r\n }\r\n\r\n if (!$('#ModuleMetaEditDia').length) {\r\n DManager.showDialogDynamic(\"/Anordnung/GetEditModuleMetaDialog\", \"ModuleMetaEditDia\", 'auto', 'auto', () => {\r\n ko.applyBindings(Controller.Current.viewModel.moduleMetaEdit, $('#ModuleMetaEditDia').get(0));\r\n this.GetModuleMetaEditData(ids);\r\n });\r\n } else {\r\n this.GetModuleMetaEditData(ids);\r\n DManager.show('ModuleMetaEditDia');\r\n }\r\n }\r\n\r\n GetModuleMetaEditData(ids: string[]) {\r\n var metaEdit = Controller.Current.viewModel.moduleMetaEdit;\r\n\r\n metaEdit.genericParams.unbindAll();\r\n metaEdit.moduleIds.removeAll();\r\n metaEdit.genericParams.setEntries([]);\r\n metaEdit.genericParams.overrideElementsCount = 0;\r\n\r\n AManager.AjaxWithLoading('AppServices.asmx', 'GetModuleMetaEdit', { ids: ids }, (result: { ModuleIds: string[], Entries: IClientGenericParamsEntry[], MetaType: string }) => {\r\n if (result && result.Entries && result.Entries.length) {\r\n metaEdit.genericParams.setEntries(result.Entries);\r\n metaEdit.moduleIds.splice.apply(metaEdit.moduleIds, ([0, 0] as any[]).concat(result.ModuleIds));\r\n metaEdit.metaType = result.MetaType;\r\n metaEdit.genericParams.overrideElementsCount = result.ModuleIds.length;\r\n\r\n var params = metaEdit.params = {};\r\n result.Entries.forEach(e => {\r\n if (e.name)\r\n params[e.name] = e.value === undefined ? null : e.value;\r\n });\r\n metaEdit.genericParams.bindObject(params);\r\n } else {\r\n DManager.hide('ModuleMetaEditDia');\r\n }\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n });\r\n }\r\n\r\n SaveModuleMetaDialog() {\r\n if (LoaderManager.isLoading() || !$('#ModuleMetaEditDia').length)\r\n return;\r\n\r\n var metaEdit = Controller.Current.viewModel.moduleMetaEdit;\r\n\r\n DManager.hide('ModuleMetaEditDia');\r\n\r\n if (!metaEdit || !metaEdit.moduleIds.length)\r\n return;\r\n\r\n AManager.AjaxWithLoading('AppServices.asmx', 'SaveModuleMetas', { moduleIds: metaEdit.moduleIds, jsonData: JSON.stringify(metaEdit.params), metaType: metaEdit.metaType }, (result: string) => {\r\n Controller.Current.reloadModulePlan();\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n });\r\n }\r\n\r\n createTransformControls() {\r\n var tc = new THREE.TransformControls(this.camera, this.renderer.domElement);\r\n\r\n tc.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n //var target = new THREE.Object3D();\r\n\r\n //tc.attach(target);\r\n\r\n if (THREE.TransformControls.prototype.dispose) {\r\n tc.dispose = function () {\r\n THREE.TransformControls.prototype.dispose.apply(tc, arguments);\r\n var idx = Controller.Current.transformControlers.indexOf(tc);\r\n if (idx !== -1)\r\n Controller.Current.transformControlers.splice(idx, 1);\r\n Controller.Current.scene.remove(tc);\r\n //Controller.Current.scene.remove(target);\r\n };\r\n }\r\n else if (tc.dispose) {\r\n var tcDispose = tc.dispose;\r\n tc.dispose = function () {\r\n tcDispose.apply(tc, arguments);\r\n var idx = Controller.Current.transformControlers.indexOf(tc);\r\n if (idx !== -1)\r\n Controller.Current.transformControlers.splice(idx, 1);\r\n Controller.Current.scene.remove(tc);\r\n //Controller.Current.scene.remove(target);\r\n };\r\n }\r\n else {\r\n tc.dispose = () => {\r\n var idx = Controller.Current.transformControlers.indexOf(tc);\r\n if (idx !== -1)\r\n Controller.Current.transformControlers.splice(idx, 1);\r\n Controller.Current.scene.remove(tc);\r\n //Controller.Current.scene.remove(target);\r\n };\r\n }\r\n\r\n //tc.addEventListener('mouseDown', (event) => {\r\n // if (tc.enabled)\r\n // tc.ctrlDown = this.viewModel.ctrlDown;\r\n //});\r\n\r\n tc.addEventListener('dragging-changed', (event) => {\r\n\r\n var en = !event.value && this.viewModel.tool == null;\r\n\r\n tc.ctrlDown = event.value && this.viewModel.ctrlDown;\r\n\r\n this.transformControlers.forEach(t => {\r\n if (t !== tc)\r\n t.enabled = en;\r\n });\r\n\r\n var viewModel = this.viewModel;\r\n\r\n viewModel.canSelect = false;\r\n viewModel.canDrag = false;\r\n viewModel.isSelecting = false;\r\n viewModel.isDragging = false;\r\n\r\n setTimeout(() => {\r\n viewModel.canSelect = false;\r\n viewModel.canDrag = false;\r\n viewModel.isSelecting = false;\r\n viewModel.isDragging = false;\r\n this.notifyRefreshView();\r\n }, 0);\r\n });\r\n\r\n //tc.addEventListener('objectChange', function(event) {\r\n // console.log('objectChange' + (tt++));\r\n //});\r\n\r\n if (this.camera === this.perspectiveCamera) {\r\n tc.setSize(0.5);\r\n } else {\r\n tc.setSize(0.1);\r\n }\r\n\r\n this.transformControlers.push(tc);\r\n this.scene.add(tc);\r\n //this.scene.add(target);\r\n return tc;\r\n }\r\n\r\n setTransformControlsEnabled(b: boolean) {\r\n var enabled = !!b;\r\n this.transformControlers.forEach(tc => {\r\n tc.enabled = enabled;\r\n });\r\n }\r\n\r\n private _box1 = new THREE.Box3();\r\n private _box2 = new THREE.Box3();\r\n private _v1 = new THREE.Vector3();\r\n private _v2 = new THREE.Vector3();\r\n private _v3 = new THREE.Vector3();\r\n private _edgeDir = new THREE.Vector3();\r\n private _closestStart = new THREE.Vector3();\r\n private _closestEnd = new THREE.Vector3();\r\n\r\n searchEdge(position?: THREE.Vector3, edgePadding = 0) {\r\n var viewModel = this.viewModel,\r\n instanceContext = viewModel.currentInstance,\r\n rp = position || viewModel.roofPosition,\r\n camera = this.orthoCamera,\r\n tolerance = this.ClickTolerance / camera.zoom,\r\n toleranceSq = tolerance * tolerance,\r\n box1 = this._box1,\r\n box2 = this._box2,\r\n v1 = this._v1,\r\n v2 = this._v2,\r\n v3 = this._v3,\r\n edgeDir = this._edgeDir,\r\n closestStart = this._closestStart,\r\n closestEnd = this._closestEnd;\r\n\r\n box1.min.set(rp.x - tolerance, rp.y - tolerance, -camera.far);\r\n box1.max.set(rp.x + tolerance, rp.y + tolerance, camera.far);\r\n\r\n var distance = Number.MAX_VALUE;\r\n var segmentFound = false;\r\n var radius = box1.getSize(v2).setZ(0).length() * 0.5;\r\n var octreeObjects = instanceContext.searchOctree(rp, radius, false);\r\n\r\n for (var i = octreeObjects.length; i--;) {\r\n var object = octreeObjects[i] as ClientObjectInstance;\r\n\r\n box2.copy(object.geometry.boundingBox).translate(object.position);\r\n if (object.parent)\r\n box2.applyMatrix4(object.parent.matrixWorld);\r\n\r\n if (edgePadding)\r\n box2.expandByScalar(edgePadding);\r\n\r\n if (box1.intersectsBox(box2)) {\r\n\r\n v1.copy(rp).clamp(box2.min, box2.max).setZ(0); // vertical pos\r\n v2.copy(v1); // horizontal pos\r\n\r\n v1.x += (Math.abs(box2.min.x - v1.x) < Math.abs(box2.max.x - v1.x)) ? box2.min.x - v1.x : box2.max.x - v1.x;\r\n v2.y += (Math.abs(box2.min.y - v2.y) < Math.abs(box2.max.y - v2.y)) ? box2.min.y - v2.y : box2.max.y - v2.y;\r\n\r\n //if (spacingMode === this.spacingModeVertical)\r\n // v1.x += (Math.abs(box2.min.x - v1.x) < Math.abs(box2.max.x - v1.x)) ? box2.min.x - v1.x : box2.max.x - v1.x;\r\n //if (spacingMode === this.spacingModeHorizontal)\r\n // v1.y += (Math.abs(box2.min.y - v1.y) < Math.abs(box2.max.y - v1.y)) ? box2.min.y - v1.y : box2.max.y - v1.y;\r\n\r\n var distV = v3.copy(v1).sub(rp).lengthSq();\r\n var distH = v3.copy(v2).sub(rp).lengthSq();\r\n\r\n var dist: number,\r\n isVertical = true;\r\n\r\n if (distV < distH) {\r\n dist = distV;\r\n } else {\r\n isVertical = false;\r\n dist = distH;\r\n v1.copy(v2);\r\n }\r\n\r\n if (dist < distance && dist <= toleranceSq) {\r\n distance = dist;\r\n //clientObjectId = object.instanceData.Id;\r\n\r\n var bz = (box2.min.z + box2.max.z) * 0.5;\r\n\r\n if (isVertical) {\r\n closestStart.copy(box2.min).setX(v1.x).setZ(bz);\r\n closestEnd.copy(box2.max).setX(v1.x).setZ(bz);\r\n\r\n if (Math.abs(v1.x - box2.min.x) < Math.abs(v1.x - box2.max.x)) {\r\n // left edge\r\n edgeDir.set(-1, 0, 0);\r\n } else {\r\n // right edge\r\n edgeDir.set(1, 0, 0);\r\n }\r\n }\r\n else {\r\n closestStart.copy(box2.min).setY(v1.y).setZ(box2.min.z).setZ(bz);\r\n closestEnd.copy(box2.max).setY(v1.y).setZ(bz);\r\n\r\n if (Math.abs(v1.y - box2.min.y) < Math.abs(v1.y - box2.max.y)) {\r\n // lower edge\r\n edgeDir.set(0, -1, 0);\r\n } else {\r\n // upper edge\r\n edgeDir.set(0, 1, 0);\r\n }\r\n }\r\n\r\n segmentFound = true;\r\n }\r\n }\r\n }\r\n\r\n if (!segmentFound)\r\n return null;\r\n\r\n return {\r\n edgeDir: edgeDir,\r\n closestStart: closestStart,\r\n closestEnd: closestEnd\r\n };\r\n }\r\n\r\n testScene(scene: THREE.Scene) {\r\n\r\n function createGeometry(sizing) {\r\n\r\n var geometry = new THREE.CylinderBufferGeometry(\r\n sizing.height / 32 * 5, // radiusTop\r\n sizing.height / 32 * 5, // radiusBottom\r\n sizing.height, // height\r\n 8, // radialSegments\r\n sizing.segmentCount * 3, // heightSegments\r\n true // openEnded\r\n );\r\n\r\n var position = geometry.attributes.position as THREE.BufferAttribute;\r\n\r\n var vertex = new THREE.Vector3();\r\n\r\n var skinIndices = [];\r\n var skinWeights = [];\r\n\r\n for (var i = 0; i < position.count; i++) {\r\n\r\n vertex.fromBufferAttribute(position, i);\r\n\r\n var y = (vertex.y + sizing.halfHeight);\r\n\r\n var skinIndex = Math.floor(y / sizing.segmentHeight);\r\n var skinWeight = (y % sizing.segmentHeight) / sizing.segmentHeight;\r\n\r\n skinIndices.push(skinIndex, skinIndex + 1, 0, 0);\r\n skinWeights.push(1 - skinWeight, skinWeight, 0, 0);\r\n\r\n }\r\n\r\n geometry.setAttribute('skinIndex', new THREE.Uint16BufferAttribute(skinIndices, 4));\r\n geometry.setAttribute('skinWeight', new THREE.Float32BufferAttribute(skinWeights, 4));\r\n\r\n return geometry;\r\n\r\n }\r\n\r\n var bones: THREE.Bone[];\r\n\r\n function createBones(sizing) {\r\n\r\n bones = [];\r\n\r\n var prevBone = new THREE.Bone();\r\n bones.push(prevBone);\r\n prevBone.position.y = - sizing.halfHeight;\r\n\r\n for (var i = 0; i < sizing.segmentCount; i++) {\r\n\r\n var bone = new THREE.Bone();\r\n bone.position.y = sizing.segmentHeight;\r\n bones.push(bone);\r\n prevBone.add(bone);\r\n prevBone = bone;\r\n\r\n }\r\n\r\n return bones;\r\n\r\n }\r\n\r\n var skeletonHelper: THREE.SkeletonHelper;\r\n var skeleton: THREE.Skeleton;\r\n\r\n function createMesh(geometry, bones: THREE.Bone[]) {\r\n\r\n var material = new THREE.MeshPhongMaterial({\r\n skinning: true,\r\n color: 0x156289,\r\n emissive: 0x072534,\r\n side: THREE.DoubleSide,\r\n flatShading: true\r\n });\r\n\r\n var mesh = new THREE.SkinnedMesh(geometry, material);\r\n skeleton = new THREE.Skeleton(bones);\r\n\r\n mesh.add(bones[0]);\r\n\r\n mesh.bind(skeleton);\r\n\r\n skeletonHelper = new THREE.SkeletonHelper(mesh);\r\n (skeletonHelper.material).linewidth = 2;\r\n scene.add(skeletonHelper);\r\n\r\n return mesh;\r\n\r\n }\r\n\r\n var mesh: THREE.SkinnedMesh;\r\n\r\n var segmentHeight = 800;\r\n var segmentCount = 4;\r\n var height = segmentHeight * segmentCount;\r\n var halfHeight = height * 0.5;\r\n\r\n var sizing = {\r\n segmentHeight: segmentHeight,\r\n segmentCount: segmentCount,\r\n height: height,\r\n halfHeight: halfHeight\r\n };\r\n\r\n var geometry = createGeometry(sizing);\r\n var bones = createBones(sizing);\r\n mesh = createMesh(geometry, bones);\r\n //mesh.bindMode = \"detached\";\r\n mesh.position.x += 1000;\r\n scene.add(mesh);\r\n\r\n skeleton.bones[0].rotation.x = -0.1;\r\n skeleton.bones[1].rotation.x = 0.2;\r\n\r\n }\r\n }\r\n\r\n EventManager.apply(Controller.prototype);\r\n}\r\n\r\ninterface Window {\r\n Controller: typeof LS.Client3DEditor.Controller;\r\n}\r\n\r\nwindow.Controller = LS.Client3DEditor.Controller;","module LS.Client3DEditor {\r\n export interface IEditableObject extends THREE.Object3D {\r\n _isDisposed: boolean;\r\n editable: boolean;\r\n visible: boolean;\r\n draggable: boolean;\r\n hoveredPoint: number;\r\n hovered: boolean;\r\n update();\r\n clickable: boolean;\r\n intersecsRaycaster(worldRayCaster: THREE.Raycaster): IEditableSelection;\r\n getLocalPosition(worldRayCaster: THREE.Raycaster): THREE.Vector3;\r\n userEdited: boolean;\r\n userCallBack?: () => void;\r\n userMoved?: () => void;\r\n dispose();\r\n getPoint(i: number): ObservableVector3;\r\n setPoint(i: number, x: number, y: number, z?: number);\r\n setPosition(v: THREE.Vector3);\r\n applyMatrix4(m: THREE.Matrix4): void;\r\n }\r\n\r\n export interface IEditableSelection {\r\n pt: number;\r\n Edge: [number, number];\r\n surface: boolean;\r\n distSq: number;\r\n source: IEditableObject;\r\n }\r\n\r\n export class EditableHandle extends THREE.Object3D implements IEditableObject {\r\n //static HandleTypePoint = 0;\r\n\r\n editable = false;\r\n hovered = false;\r\n clickable = true;\r\n draggable = true;\r\n //handleType = 0;\r\n\r\n get hoveredPoint() {\r\n return this.hovered ? 0 : -1;\r\n }\r\n\r\n set hoveredPoint(v: number) {\r\n this.hovered = (v !== -1);\r\n }\r\n\r\n private _point: ObservableVector3 = null;\r\n //private _direction: ObservableVector3 = null;\r\n private _subscriptions: KnockoutSubscription[] = [];\r\n //private _dirSubscriptions: KnockoutSubscription[] = [];\r\n private _geometryNeedsUpdate = true;\r\n private _materialNeedsUpdate = true;\r\n private _bd = new THREE.Box3();\r\n private _v1 = new THREE.Vector3();\r\n private _v2 = new THREE.Vector3();\r\n private _mat = new THREE.Matrix4();\r\n private _ray = new THREE.Ray();\r\n private _plane = new THREE.Plane(new THREE.Vector3(0, 0, 1), 0);\r\n _isDisposed: boolean;\r\n\r\n private _pointMesh: THREE.Points;\r\n //private _edge: THREE.Line2;\r\n //private _pointer: THREE.Mesh;\r\n\r\n get point() {\r\n return this._point;\r\n }\r\n\r\n set point(p: ObservableVector3) {\r\n if (this._point !== p) {\r\n var pointChanged = this.onGeometryChanged.bind(this),\r\n subs = this._subscriptions;\r\n if (subs.length) {\r\n subs.forEach(sub => sub.dispose());\r\n subs = this._subscriptions = [];\r\n }\r\n this._point = p || null;\r\n if (p) {\r\n subs.push(ko.getObservable(p, 'x').subscribe(pointChanged));\r\n subs.push(ko.getObservable(p, 'y').subscribe(pointChanged));\r\n subs.push(ko.getObservable(p, 'z').subscribe(pointChanged));\r\n }\r\n\r\n this.onGeometryChanged();\r\n }\r\n }\r\n\r\n constructor(p?: ObservableVector3, userCallBack?: () => void, userMoved?: () => void) {\r\n super();\r\n\r\n var updateGeometry = this.onGeometryChanged.bind(this);\r\n var updateMaterial = this.onMaterialChanged.bind(this);\r\n\r\n ko.track(this, [\"clickable\", \"draggable\", \"editable\", \"visible\", \"hovered\"]);\r\n\r\n //ko.getObservable(this, \"handleType\").subscribe(updateGeometry);\r\n ko.getObservable(this, \"editable\").subscribe(updateGeometry);\r\n ko.getObservable(this, \"hovered\").subscribe(updateMaterial);\r\n\r\n if (p)\r\n this.point = p;\r\n if (userCallBack)\r\n this.userCallBack = userCallBack;\r\n if (userMoved)\r\n this.userMoved = userMoved;\r\n\r\n Controller.Current.viewModel.editableObjectsManager.editableObjects.push(this);\r\n }\r\n\r\n onGeometryChanged() {\r\n this._geometryNeedsUpdate = true;\r\n this._materialNeedsUpdate = true;\r\n }\r\n\r\n onMaterialChanged() {\r\n this._materialNeedsUpdate = true;\r\n }\r\n\r\n update() {\r\n if (this._geometryNeedsUpdate) {\r\n this._geometryNeedsUpdate = false;\r\n this.updateGeometry();\r\n }\r\n if (this._materialNeedsUpdate) {\r\n this._materialNeedsUpdate = false;\r\n this.updateMaterial();\r\n }\r\n }\r\n\r\n intersecsRaycaster(worldRayCaster: THREE.Raycaster) {\r\n var controller = Controller.Current,\r\n point = this.point,\r\n clickTolerance = EditablePolygon2D.ClickTolerance / controller.orthoCamera.zoom,\r\n clickToleranceSq = clickTolerance * clickTolerance,\r\n inverseMatrix = this._mat.getInverse(this.matrixWorld),\r\n localRay = this._ray.copy(worldRayCaster.ray).applyMatrix4(inverseMatrix),\r\n v1 = this._v1;\r\n\r\n var bounds = this._bd.set(point, point).expandByScalar(clickTolerance);\r\n\r\n if (localRay.intersectBox(bounds, v1)) {\r\n var dist = Number.MAX_VALUE,\r\n res: IEditableSelection = { pt: -1, Edge: null, surface: false, distSq: 0, source: this },\r\n d: number = localRay.distanceSqToPoint(v1.copy(point).setZ(0));\r\n\r\n if (d < clickToleranceSq && d < dist) {\r\n dist = d;\r\n res.surface = true;\r\n res.distSq = dist;\r\n }\r\n\r\n if (res.surface)\r\n return res;\r\n\r\n }\r\n\r\n return null;\r\n }\r\n\r\n getLocalPosition(worldRayCaster: THREE.Raycaster) {\r\n var inverseMatrix = this._mat.getInverse(this.parent ? this.parent.matrixWorld : this.matrixWorld),\r\n localRay = this._ray.copy(worldRayCaster.ray).applyMatrix4(inverseMatrix),\r\n plane = this._plane;\r\n\r\n return localRay.intersectPlane(plane, this._v2);\r\n }\r\n\r\n userEdited = false;\r\n userCallBack?: () => void;\r\n userMoved?: () => void;\r\n\r\n updateGeometry() {\r\n var point = this._point;\r\n\r\n if (!this.editable) {\r\n this.visible = false;\r\n return;\r\n }\r\n\r\n this.visible = true;\r\n\r\n if (!this._pointMesh)\r\n this.recreate();\r\n\r\n var pointMesh = this._pointMesh,\r\n cornerGeo = (pointMesh && pointMesh.geometry) as THREE.BufferGeometry;\r\n\r\n if (cornerGeo) {\r\n var positions = cornerGeo.getAttribute('position') as THREE.BufferAttribute,\r\n colors = cornerGeo.getAttribute('color') as THREE.BufferAttribute,\r\n arr = positions.array as Float32Array,\r\n colArr = colors.array as Float32Array;\r\n\r\n var idx = 0;\r\n\r\n arr[idx] = point.x;\r\n arr[idx + 1] = point.y;\r\n //arr[idx + 2] = p.z;\r\n\r\n colArr[idx] = 0.75;\r\n colArr[idx + 1] = 0.75;\r\n colArr[idx + 2] = 0.75;\r\n\r\n positions.needsUpdate = true;\r\n colors.needsUpdate = true;\r\n\r\n cornerGeo.computeBoundingSphere();\r\n }\r\n }\r\n\r\n private recreate() {\r\n this.children.slice().forEach(ch => {\r\n this.remove(ch);\r\n spt.ThreeJs.utils.disposeObject3D(ch, true, true, false);\r\n });\r\n\r\n var cornergeo = new THREE.BufferGeometry();\r\n if (!cornergeo.boundingSphere)\r\n cornergeo.boundingSphere = new THREE.Sphere();\r\n\r\n var positionAttribute = new THREE.BufferAttribute(new Float32Array(3), 3).setUsage(THREE.DynamicDrawUsage);\r\n var colorAttribute = new THREE.BufferAttribute(new Float32Array(3), 3).setUsage(THREE.DynamicDrawUsage);\r\n\r\n cornergeo.setAttribute('position', positionAttribute);\r\n cornergeo.setAttribute('color', colorAttribute);\r\n\r\n var point = this._pointMesh = new THREE.Points(cornergeo, EditablePolygon2D.getCircleMaterial());\r\n\r\n point.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n\r\n this.add(point);\r\n\r\n //if (this.handleType === EditableHandle.HandleTypeAxis) {\r\n // //edges\r\n // var array = new Float32Array(2 * 3);\r\n // var edgeGeo = new THREE.LineGeometry();\r\n // if (!edgeGeo.boundingSphere)\r\n // edgeGeo.boundingSphere = new THREE.Sphere();\r\n // edgeGeo.setPositions(array);\r\n\r\n // var startPositions = edgeGeo.getAttribute('instanceStart') as THREE.InterleavedBufferAttribute;\r\n // //var endPositions = edgeGeo.getAttribute('instanceEnd') as THREE.InterleavedBufferAttribute;\r\n\r\n // var instanceBuffer = startPositions.data as THREE.InstancedInterleavedBuffer;\r\n // instanceBuffer.setUsage(THREE.DynamicDrawUsage);\r\n\r\n // var line = this._edge = new THREE.Line2(edgeGeo, EditablePolygon2D.lineMaterial);\r\n // line.computeLineDistances();\r\n\r\n // line.renderOrder = LS.Client3DEditor.UIRenderOrder - 1;\r\n\r\n // this.add(line);\r\n //}\r\n\r\n }\r\n\r\n updateMaterial() {\r\n if (!this.editable)\r\n return;\r\n\r\n var pointMesh = this._pointMesh,\r\n hovered = this.hovered,\r\n clickable = this.clickable,\r\n cornerGeo = (pointMesh && pointMesh.geometry) as THREE.BufferGeometry;\r\n\r\n if (cornerGeo) {\r\n var colors = cornerGeo.getAttribute('color') as THREE.BufferAttribute;\r\n\r\n if (hovered)\r\n colors.setXYZ(0, 1, 1, 1);\r\n else\r\n colors.setXYZ(0, 0.75, 0.75, 0.75);\r\n\r\n colors.needsUpdate = true;\r\n }\r\n\r\n }\r\n\r\n getPoint(i: number): ObservableVector3 {\r\n return this.point;\r\n }\r\n\r\n setPoint(i: number, x: number, y: number, z?: number) {\r\n var p = this.point;\r\n p.x = x;\r\n p.y = y;\r\n if (z !== undefined)\r\n p.z = z;\r\n }\r\n\r\n setPosition(v: THREE.Vector3) {\r\n this.position.copy(v);\r\n }\r\n\r\n applyMatrix4(m: THREE.Matrix4) {\r\n this.point.applyMatrix4(m);\r\n }\r\n\r\n dispose() {\r\n if (this._isDisposed)\r\n return;\r\n\r\n this._isDisposed = true;\r\n\r\n if (this._subscriptions.length) {\r\n this._subscriptions.forEach(sub => sub.dispose());\r\n this._subscriptions = null;\r\n }\r\n\r\n Controller.Current.viewModel.editableObjectsManager.editableObjects.remove(this);\r\n\r\n this.children.slice().forEach(ch => {\r\n spt.ThreeJs.utils.disposeObject3D(ch, true, true, false);\r\n });\r\n }\r\n }\r\n\r\n export interface ILineStepping {\r\n readonly lineLength: number;\r\n }\r\n\r\n export interface ICurveStepping {\r\n readonly curveDegree: number; //]-180 ... +180]\r\n readonly curvePaddingStart: number;\r\n readonly curvePaddingEnd: number;\r\n }\r\n\r\n export class LineSteppingCalculator {\r\n private _lineSteppings: ILineStepping[] = [];\r\n private _curveSteppings: ICurveStepping[] = [];\r\n\r\n private combinations: number[][];\r\n private combinationMax: number = 0;\r\n private _v1 = new THREE.Vector3();\r\n private _v2 = new THREE.Vector3();\r\n private _v3 = new THREE.Vector3();\r\n private _v4 = new THREE.Vector3();\r\n private _v5 = new THREE.Vector3();\r\n private _r1 = new THREE.Ray();\r\n private _p1 = new THREE.Plane();\r\n\r\n maxNumber: number;\r\n maxCombinations: number;\r\n\r\n constructor(maxNumber?: number, maxCombinations?: number) {\r\n this.maxNumber = maxNumber || 10;\r\n this.maxCombinations = maxCombinations || 1024;\r\n }\r\n\r\n get lineSteppings() {\r\n return this._lineSteppings;\r\n }\r\n\r\n set lineSteppings(val: ILineStepping[]) {\r\n\r\n if (val && val.length) {\r\n //distinct\r\n var v = val.filter((ls, idx) => val.findIndex(ls2 => ls.lineLength === ls2.lineLength) === idx);\r\n //sort\r\n v.sort((a, b) => a.lineLength - b.lineLength);\r\n this._lineSteppings = v;\r\n }\r\n\r\n this.updateLineSteppings();\r\n }\r\n\r\n updateLineSteppings() {\r\n var lineSteppings = this.lineSteppings;\r\n if (!lineSteppings || !lineSteppings.length) {\r\n this.combinations = [];\r\n this.combinationMax = 0;\r\n return;\r\n }\r\n\r\n if (lineSteppings.length === 1)\r\n this.combinations = [[1, lineSteppings[0].lineLength]];\r\n else\r\n this.combinations = ArrayHelper.calculateCombinations(lineSteppings.map(ls => ls.lineLength), this.maxNumber, this.maxCombinations);\r\n\r\n this.combinationMax = this.combinations[this.combinations.length - 1][lineSteppings.length];\r\n }\r\n\r\n get curveSteppings() {\r\n return this._curveSteppings;\r\n }\r\n\r\n set curveSteppings(val: ICurveStepping[]) {\r\n if (val && val.length) {\r\n //clamp degree\r\n //val.forEach(cs => {\r\n // cs.degree = Math.min(180, Math.max(0.001, Math.abs(cs.degree)));\r\n // cs.padding = Math.max(0, cs.padding);\r\n //});\r\n //distinct\r\n var v = val.filter((cs, idx) => val.findIndex(cs2 => cs.curveDegree === cs2.curveDegree) === idx);\r\n //sort\r\n v.sort((a, b) => a.curveDegree - b.curveDegree);\r\n this._curveSteppings = v;\r\n }\r\n\r\n //this.updateCurveSteppings();\r\n }\r\n\r\n //updateCurveSteppings() {\r\n // var curveSteppings = this._curveSteppings;\r\n // if (curveSteppings.every(cs => cs.curveDegree !== 180))\r\n // curveSteppings.push({ curveDegree: 180, curvePaddingStart: 0, curvePaddingEnd: 0 });\r\n //}\r\n\r\n calculateLength(length: number, lineSteppings?: ILineStepping[]): number[] {\r\n if (!lineSteppings)\r\n lineSteppings = this.lineSteppings;\r\n\r\n if (!lineSteppings || !lineSteppings.length)\r\n return null;\r\n\r\n var result = lineSteppings.map(() => 0 as number),\r\n steppingMaxLength = this.combinationMax,\r\n smallestLength = lineSteppings[0].lineLength;\r\n\r\n if (length <= smallestLength) {\r\n result[0] = 1;\r\n return result;\r\n }\r\n\r\n var biggestLength = lineSteppings[lineSteppings.length - 1].lineLength;\r\n\r\n while (length > steppingMaxLength && length > biggestLength) {\r\n length -= biggestLength;\r\n result[result.length - 1]++;\r\n }\r\n\r\n var steppingMap = this.combinations;\r\n\r\n if (!steppingMap || !steppingMap.length)\r\n return result;\r\n\r\n var lIdx = lineSteppings.length;\r\n var idx = ArrayHelper.binarySearchClosestIndex(steppingMap, length, (s => s[lIdx]));\r\n return steppingMap[idx].slice(0, lIdx).map((num, i) => num + result[i]);\r\n }\r\n\r\n getLength(combination: number[], lineSteppings?: ILineStepping[]) {\r\n if (!combination)\r\n return 0;\r\n\r\n if (!lineSteppings)\r\n lineSteppings = this.lineSteppings;\r\n\r\n var result = 0;\r\n\r\n for (var i = 0, l = combination.length; i < l; i++) {\r\n result += combination[i] * lineSteppings[i].lineLength;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n getSteppings(combination: number[], lineSteppings?: ILineStepping[]) {\r\n\r\n var result: { count: number, lineStepping: ILineStepping }[] = [];\r\n\r\n if (!combination)\r\n return result;\r\n\r\n if (!lineSteppings)\r\n lineSteppings = this.lineSteppings;\r\n\r\n for (var i = 0, l = combination.length; i < l; i++) {\r\n result.push({\r\n count: combination[i],\r\n lineStepping: lineSteppings[i]\r\n });\r\n }\r\n\r\n return result;\r\n }\r\n\r\n getCurveStepping(pFrom: THREE.Vector3, pTo: THREE.Vector3, dirFrom: THREE.Vector3) {\r\n var curveSteppings = this.curveSteppings;\r\n if (!curveSteppings.length)\r\n return null;\r\n\r\n var ray = this._r1,//.set(pFrom, dirFrom),\r\n closest = this._v1.subVectors( pTo, pFrom ), //ray.closestPointToPoint(pTo, this._v1);\r\n dirDist = closest.dot( dirFrom );\r\n\r\n if (dirDist < 1) {\r\n var dr = this._v2.set(dirFrom.y, -dirFrom.x, 0).normalize();\r\n \r\n var rDist = dr.dot(closest);\r\n if (Math.abs(rDist) > 1) {\r\n dirDist = 1;\r\n pTo = pFrom.clone().add(dr.multiplyScalar(rDist).add(dirFrom/*.multiplyScalar(dirDist)*/));\r\n }\r\n }\r\n\r\n closest.copy( dirFrom ).multiplyScalar( Math.max(1, dirDist) ).add( pFrom );\r\n\r\n if (closest.distanceToSquared(pFrom) < 1 || closest.distanceToSquared(pTo) < 1)\r\n return null;\r\n\r\n var plane = this._p1.setFromNormalAndCoplanarPoint(this._v2.subVectors(pTo, closest).normalize(), closest),\r\n degToRad = THREE.MathUtils.DEG2RAD,\r\n dirTo = this._v3,\r\n cPos = this._v4,\r\n len = Number.MAX_VALUE,\r\n lenTo = 0,\r\n lenFrom = 0,\r\n curve: ICurveStepping = null;\r\n\r\n curveSteppings.forEach(curveStepping => {\r\n ray.set(pTo, spt.ThreeJs.utils.RotateCC(dirTo.copy(dirFrom).negate(), curveStepping.curveDegree * degToRad).negate());\r\n if (ray.intersectPlane(plane, cPos) && dirFrom.dot(dirTo.subVectors(cPos, pFrom)) > 0) {\r\n var l1 = cPos.distanceTo(pTo);\r\n if (l1 >= curveStepping.curvePaddingEnd) {\r\n var l2 = cPos.distanceTo(pFrom),\r\n l = l1 + l2;\r\n if (l2 >= 0 && l < len) {\r\n curve = curveStepping;\r\n len = l;\r\n lenTo = l1;\r\n lenFrom = l2;\r\n }\r\n }\r\n }\r\n });\r\n\r\n return curve ? {\r\n curveStepping: curve,\r\n lenTo: Math.max(0, lenTo - curve.curvePaddingEnd),\r\n lenFrom: Math.max(0, lenFrom - curve.curvePaddingStart)\r\n } : null;\r\n\r\n }\r\n\r\n getCurveTo(pFrom: THREE.Vector3, pTo: THREE.Vector3, dirFrom: THREE.Vector3) {\r\n var curveSteppings = this.curveSteppings;\r\n if (!curveSteppings.length)\r\n return null;\r\n \r\n if (curveSteppings && curveSteppings.length > 1) {\r\n var deg = spt.ThreeJs.utils.GetCCAngleRad(this._v1.copy(dirFrom).negate(), this._v2.subVectors(pTo, pFrom).normalize()) * 180 / Math.PI,\r\n absDeg = Math.abs(deg);\r\n if (absDeg > 0 && absDeg < 180) {\r\n deg = (deg + 360) % 360; //spt.ThreeJs.utils.DegreeToPositive(deg);\r\n var res = ArrayHelper.byMin(curveSteppings, cs => Math.abs(cs.curveDegree - deg));\r\n if (res.curveDegree !== 180 && Math.abs(res.curveDegree - deg) < Math.abs(180 - deg))\r\n return res;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n getPosition(target: THREE.Vector3, prev1: THREE.Vector3, prev2?: THREE.Vector3) {\r\n var curveSteppings = this.curveSteppings,\r\n lineSteppings = this.lineSteppings,\r\n dir1 = this._v1.subVectors(target, prev1),\r\n dLen = dir1.length(),\r\n pad = 0;\r\n dir1.multiplyScalar(1 / dLen);\r\n\r\n if (prev2 && curveSteppings && curveSteppings.length > 1) {\r\n var dir2 = this._v2.subVectors(prev2, prev1).normalize(),\r\n deg = spt.ThreeJs.utils.GetCCAngleRad(dir2, dir1) * 180 / Math.PI,\r\n absDeg = Math.abs(deg);\r\n if (absDeg > 0 && absDeg < 180) {\r\n\r\n var curveStepping = ArrayHelper.byMin(curveSteppings, cs => Math.abs(cs.curveDegree - deg));\r\n\r\n deg = curveStepping.curveDegree;\r\n\r\n var axis = this._v3.crossVectors(dir1, dir2);\r\n var d1 = this._v4.copy(dir2).applyAxisAngle(axis, deg * Math.PI / 180);\r\n var d2 = this._v5.copy(dir2).applyAxisAngle(axis.negate(), deg * Math.PI / 180);\r\n\r\n if (d1.dot(dir1) > d2.dot(dir1))\r\n dir1.copy(d1);\r\n else\r\n dir1.copy(d2);\r\n\r\n //if (curveStepping.curvePaddingStart > 0) {\r\n // prev1 = this._v3.copy(prev1).add(dir2.negate().multiplyScalar(curveStepping.curvePaddingStart));\r\n // dLen = this._v4.subVectors(target, prev1).length();\r\n //}\r\n pad = curveStepping.curvePaddingEnd;\r\n dLen = Math.max(0, dLen - pad);\r\n }\r\n }\r\n\r\n if (lineSteppings && lineSteppings.length) {\r\n\r\n if (dLen < lineSteppings[0].lineLength * 0.5)\r\n dLen = pad > 0 ? 0 : lineSteppings[0].lineLength;\r\n else\r\n dLen = this.getLength(this.calculateLength(dLen));\r\n }\r\n\r\n return target.copy(prev1).add(dir1.multiplyScalar(dLen + pad));\r\n }\r\n }\r\n\r\n export interface IPolygonMaterialOpts {\r\n surfaceColor: number;\r\n surfaceOpacity: number;\r\n lineColor: number;\r\n linewidth: number;\r\n }\r\n\r\n export class EditablePolygon2D extends THREE.Object3D implements IEditableObject {\r\n clickable = true;\r\n draggable = true;\r\n editable = false;\r\n hovered = false;\r\n closed = true;\r\n hoveredPoint: number = -1;\r\n editOptions: number;\r\n lineStepping: LineSteppingCalculator = null;\r\n\r\n static ShowCorners = 1;\r\n static ShowEdges = 1 << 1;\r\n static ShowSurface = 1 << 2;\r\n\r\n private _poly: ObservablePolygon = null;\r\n private _polySubscription: KnockoutSubscription = null;\r\n _isDisposed = false;\r\n private _pointCount = 0;\r\n private _geometryNeedsUpdate = true;\r\n private _materialNeedsUpdate = true;\r\n private _bd = new THREE.Box3();\r\n private _v1 = new THREE.Vector3();\r\n private _v2 = new THREE.Vector3();\r\n private _mat = new THREE.Matrix4();\r\n private _ray = new THREE.Ray();\r\n private _plane = new THREE.Plane(new THREE.Vector3(0, 0, 1), 0);\r\n\r\n private _corners: THREE.Points;\r\n private _edges: THREE.Line2;\r\n private _suface: THREE.Mesh;\r\n\r\n private _surfaceColor: number = 0x07AC00;\r\n private _surfaceOpacity: number = 0.5;\r\n private _lineColor: number = 0x0B3818;\r\n private _linewidth: number = 2.5;\r\n\r\n static ClickTolerance = 6;\r\n\r\n private static circleMaterial: THREE.Material;\r\n private surfaceMaterial: THREE.Material;\r\n static linesMaterial: { [k: string]: THREE.LineMaterial } = {};\r\n\r\n static getCircleMaterial() {\r\n if (!EditablePolygon2D.circleMaterial) {\r\n var loader = new THREE.TextureLoader();\r\n var tex = loader.load(UI3DImages.InterCircle, () => {\r\n LoaderManager.notifyResourceLoaded();\r\n });\r\n tex.anisotropy = Detector.webglParameters.maxAnisotropy || 1;\r\n tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping;\r\n\r\n EditablePolygon2D.circleMaterial = new THREE.PointsMaterial({\r\n size: 16,\r\n sizeAttenuation: false,\r\n map: tex,\r\n alphaTest: 0.5,\r\n transparent: true,\r\n depthTest: false,\r\n depthWrite: false,\r\n vertexColors: true //THREE.VertexColors\r\n });\r\n }\r\n return EditablePolygon2D.circleMaterial;\r\n }\r\n\r\n userEdited = false;\r\n userCallBack: () => void;\r\n userMoved: () => void;\r\n\r\n get poly() {\r\n return this._poly;\r\n }\r\n\r\n set poly(poly: ObservablePolygon) {\r\n\r\n if (this._poly != poly) {\r\n if (this._polySubscription) {\r\n this._polySubscription.dispose();\r\n this._polySubscription = null;\r\n }\r\n this._poly = poly || null;\r\n if (poly)\r\n this._polySubscription = poly.subscribe(this.onGeometryChanged.bind(this));\r\n\r\n this.onGeometryChanged();\r\n }\r\n }\r\n\r\n constructor(poly?: ObservablePolygon, userCallBack?: () => void, userMoved?: () => void, materialOpts?: IPolygonMaterialOpts) {\r\n super();\r\n\r\n this.editOptions = EditablePolygon2D.ShowCorners | EditablePolygon2D.ShowEdges | EditablePolygon2D.ShowSurface;\r\n\r\n if (materialOpts) {\r\n this._surfaceColor = materialOpts.surfaceColor;\r\n this._surfaceOpacity = materialOpts.surfaceOpacity;\r\n this._lineColor = materialOpts.lineColor;\r\n this._linewidth = materialOpts.linewidth;\r\n }\r\n\r\n var updateGeometry = this.onGeometryChanged.bind(this);\r\n var updateMaterial = this.onMaterialChanged.bind(this);\r\n\r\n ko.track(this, [\"clickable\", \"draggable\", \"editable\", \"hoveredPoint\", \"visible\", \"hovered\", \"editOptions\", \"closed\"]);\r\n\r\n //ko.getObservable(this, \"clickable\").subscribe(updateGeometry);\r\n //ko.getObservable(this, \"draggable\").subscribe(updateGeometry);\r\n ko.getObservable(this, \"editOptions\").subscribe(updateGeometry);\r\n ko.getObservable(this, \"editable\").subscribe(updateGeometry);\r\n ko.getObservable(this, \"hoveredPoint\").subscribe(updateMaterial);\r\n ko.getObservable(this, \"hovered\").subscribe(updateMaterial);\r\n ko.getObservable(this, \"closed\").subscribe(updateGeometry);\r\n\r\n this.surfaceMaterial = new THREE.MeshBasicMaterial({\r\n color: this._surfaceColor,\r\n transparent: true,\r\n opacity: this._surfaceOpacity,\r\n depthTest: false,\r\n depthWrite: false,\r\n side: THREE.DoubleSide\r\n });\r\n\r\n Controller.Current.viewModel.editableObjectsManager.editableObjects.push(this);\r\n\r\n if (poly)\r\n this.poly = poly;\r\n if (userCallBack)\r\n this.userCallBack = userCallBack;\r\n if (userMoved)\r\n this.userMoved = userMoved;\r\n }\r\n\r\n onGeometryChanged() {\r\n this._geometryNeedsUpdate = true;\r\n this._materialNeedsUpdate = true;\r\n }\r\n\r\n onMaterialChanged() {\r\n this._materialNeedsUpdate = true;\r\n }\r\n\r\n update() {\r\n if (this._geometryNeedsUpdate) {\r\n this._geometryNeedsUpdate = false;\r\n this.updateGeometry();\r\n }\r\n if (this._materialNeedsUpdate) {\r\n this._materialNeedsUpdate = false;\r\n this.updateMaterial();\r\n }\r\n }\r\n\r\n translatePoly(t: { x: number, y: number }) {\r\n var v = this._v1.set(t.x, t.y, 0);\r\n this.poly.array.forEach(p => { p.add(v); });\r\n }\r\n\r\n private updateMaterial() {\r\n var poly = this._poly,\r\n polyCount = poly ? poly.array.length : 0;\r\n\r\n if (polyCount <= 0 || !this.editable)\r\n return;\r\n\r\n var cornerGeo = (this._corners && this._corners.geometry) as THREE.BufferGeometry,\r\n hoveredPoint = this.hoveredPoint,\r\n surfaceMaterial = this.surfaceMaterial;\r\n\r\n if (cornerGeo) {\r\n var colors = cornerGeo.getAttribute('color') as THREE.BufferAttribute;\r\n\r\n for (var j = 0; j < polyCount; j++) {\r\n colors.setXYZ(j, 0.75, 0.75, 0.75);\r\n }\r\n\r\n if (hoveredPoint >= 0 && hoveredPoint < polyCount) {\r\n colors.setXYZ(hoveredPoint, 1, 1, 1);\r\n }\r\n\r\n colors.needsUpdate = true;\r\n }\r\n\r\n var op = this.hovered ? 0.6 : 0.4;\r\n\r\n if (surfaceMaterial.opacity !== op) {\r\n surfaceMaterial.opacity = op;\r\n surfaceMaterial.needsUpdate = true;\r\n }\r\n\r\n }\r\n\r\n private updateGeometry() {\r\n var poly = this._poly,\r\n polyCount = poly ? poly.array.length : 0;\r\n\r\n if (polyCount <= 0 || !this.editable) {\r\n this.visible = false;\r\n return;\r\n }\r\n\r\n this.visible = true;\r\n\r\n if (!this._corners || this._pointCount !== polyCount)\r\n this.recreate(polyCount);\r\n\r\n var points = poly.array,\r\n corners = this._corners,\r\n edges = this._edges,\r\n cornerGeo = (corners && corners.geometry) as THREE.BufferGeometry,\r\n edgeGeo = (edges && this._edges.geometry) as THREE.LineGeometry,\r\n surfaceMesh = this._suface,\r\n showCorners = !!(this.editOptions & EditablePolygon2D.ShowCorners),\r\n showEdges = !!(this.editOptions & EditablePolygon2D.ShowEdges),\r\n showSurface = !!(this.editOptions & EditablePolygon2D.ShowSurface);\r\n\r\n if (corners && corners.visible !== showCorners)\r\n corners.visible = showCorners;\r\n\r\n if (edges && edges.visible !== showEdges)\r\n edges.visible = showEdges;\r\n\r\n if (surfaceMesh && surfaceMesh.visible !== showSurface)\r\n surfaceMesh.visible = showSurface;\r\n\r\n var boundingSphere: THREE.Sphere;\r\n\r\n if (cornerGeo) {\r\n var positions = cornerGeo.getAttribute('position') as THREE.BufferAttribute,\r\n colors = cornerGeo.getAttribute('color') as THREE.BufferAttribute,\r\n arr = positions.array as Float32Array,\r\n colArr = colors.array as Float32Array;\r\n\r\n var idx = 0;\r\n\r\n for (var j = 0; j < polyCount; j++ , idx += 3) {\r\n var p = points[j];\r\n\r\n arr[idx] = p.x;\r\n arr[idx + 1] = p.y;\r\n //arr[idx + 2] = p.z;\r\n\r\n colArr[idx] = 0.75;\r\n colArr[idx + 1] = 0.75;\r\n colArr[idx + 2] = 0.75;\r\n }\r\n\r\n positions.needsUpdate = true;\r\n colors.needsUpdate = true;\r\n\r\n cornerGeo.computeBoundingSphere();\r\n boundingSphere = cornerGeo.boundingSphere;\r\n } else {\r\n boundingSphere = poly.getBoundingSphere();\r\n }\r\n\r\n if (edgeGeo && edges.visible) {\r\n\r\n var instanceBuffer = (edgeGeo.getAttribute('instanceStart') as THREE.InterleavedBufferAttribute).data as THREE.InstancedInterleavedBuffer,\r\n arr = instanceBuffer.array as Float32Array;\r\n\r\n var idx = 0,\r\n p1: THREE.Vector3,\r\n p2: THREE.Vector3,\r\n pc = polyCount - 1;\r\n\r\n for (var j = 0; j < pc; j++ , idx += 6) {\r\n p1 = points[j];\r\n p2 = points[j + 1];\r\n\r\n arr[idx] = p1.x;\r\n arr[idx + 1] = p1.y;\r\n //arr[idx + 2] = p1.z;\r\n\r\n arr[idx + 3] = p2.x;\r\n arr[idx + 4] = p2.y;\r\n //arr[idx + 5] = p2.z;\r\n }\r\n\r\n p1 = points[pc];\r\n p2 = points[0];\r\n\r\n arr[idx] = p1.x;\r\n arr[idx + 1] = p1.y;\r\n //arr[idx + 2] = p1.z;\r\n\r\n arr[idx + 3] = p2.x;\r\n arr[idx + 4] = p2.y;\r\n //arr[idx + 5] = p2.z;\r\n\r\n edgeGeo.maxInstancedCount = this.closed ? polyCount : polyCount - 1;\r\n\r\n instanceBuffer.needsUpdate = true;\r\n\r\n edgeGeo.boundingSphere.copy(boundingSphere);\r\n }\r\n\r\n //surface\r\n if (polyCount >= 3 && surfaceMesh && surfaceMesh.visible) {\r\n var surfaceGeo = surfaceMesh.geometry as THREE.BufferGeometry,\r\n indexAttribute = surfaceGeo.getIndex(),\r\n indices = indexAttribute.array as Uint16Array,\r\n vIndizes = THREE.ShapeUtils.triangulateShape(poly.array.slice(), []),\r\n indicesCount = vIndizes.length * 3;\r\n\r\n for (var i = 0, idx = 0, l = vIndizes.length; i < l; i++ , idx += 3) {\r\n var ind = vIndizes[i];\r\n\r\n indices[idx] = ind[0];\r\n indices[idx + 1] = ind[1];\r\n indices[idx + 2] = ind[2];\r\n }\r\n\r\n surfaceGeo.setDrawRange(0, indicesCount);\r\n indexAttribute.needsUpdate = true;\r\n\r\n surfaceGeo.boundingSphere.copy(boundingSphere);\r\n\r\n //if (!this.wireframe) {\r\n // var bd = new THREE.Box3().copy(poly.bounds);\r\n // bd.min.setZ(0);\r\n\r\n // //var m = new THREE.Matrix4().makeTranslation((bd.min.x + bd.max.x) * 0.5, (bd.min.y + bd.max.y) * 0.5, (bd.min.z + bd.max.z) * 0.5);\r\n\r\n // this.updateMatrixWorld(false);\r\n\r\n // //this.updateWorldMatrix(true, false);\r\n\r\n // bd.applyMatrix4(this.matrixWorld);\r\n\r\n // //m.premultiply(this.matrixWorld);\r\n\r\n // //wireframe.applyMatrix4(m.premultiply(this.matrixWorld));\r\n // //wireframe.applyMatrix4(m);\r\n\r\n // var size = bd.getSize(new THREE.Vector3());\r\n\r\n // var geo = new THREE.BoxBufferGeometry(size.x, size.y, size.z);\r\n // var geometry = new THREE.WireframeGeometry2( geo );\r\n\r\n // var wireframe = this.wireframe = new THREE.Wireframe(geometry, EditablePolygon2D.LineMaterial);\r\n // wireframe.computeLineDistances();\r\n // bd.getCenter(wireframe.position);\r\n // wireframe.updateMatrix();\r\n\r\n // Controller.Current.scene.add(wireframe);\r\n //}\r\n }\r\n }\r\n\r\n private recreate(pointCount) {\r\n this.children.slice().forEach(ch => {\r\n this.remove(ch);\r\n spt.ThreeJs.utils.disposeObject3D(ch, true, true, false);\r\n });\r\n\r\n this._pointCount = pointCount;\r\n\r\n this._corners = null;\r\n this._edges = null;\r\n this._suface = null;\r\n\r\n var maxNumberTriangles = Math.max(0, 2 * pointCount - 5);\r\n\r\n var positionAttribute = new THREE.BufferAttribute(new Float32Array(pointCount * 3), 3).setUsage(THREE.DynamicDrawUsage);\r\n var colorAttribute = new THREE.BufferAttribute(new Float32Array(pointCount * 3), 3).setUsage(THREE.DynamicDrawUsage);\r\n\r\n //corners\r\n var cornergeo = new THREE.BufferGeometry();\r\n if (!cornergeo.boundingSphere)\r\n cornergeo.boundingSphere = new THREE.Sphere();\r\n\r\n cornergeo.setAttribute('position', positionAttribute);\r\n cornergeo.setAttribute('color', colorAttribute);\r\n\r\n var corners = this._corners = new THREE.Points(cornergeo, EditablePolygon2D.getCircleMaterial());\r\n\r\n corners.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n\r\n this.add(corners);\r\n\r\n if (pointCount > 1) {\r\n //edges\r\n var array = new Float32Array((pointCount + 1) * 3);\r\n var edgeGeo = new THREE.LineGeometry();\r\n if (!edgeGeo.boundingSphere)\r\n edgeGeo.boundingSphere = new THREE.Sphere();\r\n edgeGeo.setPositions(array);\r\n\r\n var startPositions = edgeGeo.getAttribute('instanceStart') as THREE.InterleavedBufferAttribute;\r\n //var endPositions = edgeGeo.getAttribute('instanceEnd') as THREE.InterleavedBufferAttribute;\r\n\r\n var instanceBuffer = startPositions.data as THREE.InstancedInterleavedBuffer;\r\n instanceBuffer.setUsage(THREE.DynamicDrawUsage);\r\n\r\n var linesKey = `w${this._linewidth}c${this._lineColor}`;\r\n\r\n if (!EditablePolygon2D.linesMaterial[linesKey]) {\r\n EditablePolygon2D.linesMaterial[linesKey] = spt.ThreeJs.utils.LineMaterialHelper.GetLineMaterial({\r\n color: this._lineColor,\r\n linewidth: this._linewidth, // in pixels\r\n vertexColors: false, //THREE.NoColors,\r\n transparent: true,\r\n //resolution: // to be set by renderer, eventually\r\n dashed: false,\r\n depthTest: false,\r\n depthWrite: false\r\n });\r\n }\r\n\r\n var line = this._edges = new THREE.Line2(edgeGeo, EditablePolygon2D.linesMaterial[linesKey]);\r\n line.computeLineDistances();\r\n\r\n line.renderOrder = LS.Client3DEditor.UIRenderOrder - 1;\r\n\r\n this.add(line);\r\n }\r\n\r\n //surface\r\n if (pointCount > 2 && maxNumberTriangles > 0) {\r\n\r\n var indexAttribute = new THREE.BufferAttribute(new Uint16Array(maxNumberTriangles * 3), 1).setUsage(THREE.DynamicDrawUsage);\r\n\r\n var geo = new THREE.BufferGeometry();\r\n if (!geo.boundingSphere)\r\n geo.boundingSphere = new THREE.Sphere();\r\n geo.setAttribute('position', positionAttribute);\r\n geo.setIndex(indexAttribute);\r\n\r\n var mesh = this._suface = new THREE.Mesh(geo, this.surfaceMaterial);\r\n\r\n mesh.renderOrder = LS.Client3DEditor.UIRenderOrder - 2;\r\n\r\n this.add(mesh);\r\n\r\n }\r\n }\r\n\r\n static setDashed(mat: THREE.LineMaterial, dashed: boolean) {\r\n mat.dashed = dashed;\r\n // dashed is implemented as a defines -- not as a uniform. this could be changed.\r\n // ... or LineDashedMaterial could be implemented as a separate material\r\n // temporary hack - renderer should do this eventually\r\n if (dashed) mat.defines.USE_DASH = \"\"; else delete mat.defines.USE_DASH;\r\n mat.needsUpdate = true;\r\n }\r\n\r\n intersecsRaycaster(worldRayCaster: THREE.Raycaster) {\r\n var controller = Controller.Current,\r\n poly = this.poly,\r\n points = poly.array,\r\n polyCount = points.length,\r\n clickTolerance = EditablePolygon2D.ClickTolerance / controller.orthoCamera.zoom,\r\n clickToleranceSq = clickTolerance * clickTolerance,\r\n v1 = this._v1,\r\n //v2 = this._v2,\r\n inverseMatrix = this._mat.getInverse(this.matrixWorld),\r\n localRay = this._ray.copy(worldRayCaster.ray).applyMatrix4(inverseMatrix);\r\n\r\n if (polyCount <= 0)\r\n return null;\r\n\r\n var bounds = this._bd.copy(poly.bounds);\r\n\r\n bounds.min.set(bounds.min.x - clickTolerance, bounds.min.y - clickTolerance, -clickTolerance);\r\n bounds.max.set(bounds.max.x + clickTolerance, bounds.max.y + clickTolerance, clickTolerance);\r\n\r\n if (localRay.intersectBox(bounds, v1)) {\r\n var dist = Number.MAX_VALUE,\r\n res: IEditableSelection = { pt: -1, Edge: null, surface: false, distSq: 0, source: this },\r\n d: number;\r\n\r\n for (var i = 0; i < polyCount; i++) {\r\n var p = points[i];\r\n d = localRay.distanceSqToPoint(v1.copy(p).setZ(0));\r\n if (d < clickToleranceSq && d < dist) {\r\n dist = d;\r\n res.pt = i;\r\n res.distSq = dist;\r\n }\r\n }\r\n\r\n if (res.pt >= 0)\r\n return res;\r\n\r\n //var p1: ObservableVector3,\r\n // p2: ObservableVector3,\r\n // pc = polyCount - 1;\r\n\r\n //for (var i = 0; i < pc; i++) {\r\n // p1 = points[i];\r\n // p2 = points[i + 1];\r\n // d = localRay.distanceSqToSegment(v1.copy(p1).setZ(0), v2.copy(p2).setZ(0));\r\n // if (d < clickToleranceSq && d < dist) {\r\n // dist = d;\r\n // res.Edge = [i, i +1];\r\n // res.distSq = dist;\r\n // }\r\n //}\r\n\r\n //if (pc > 1) {\r\n // p1 = points[pc];\r\n // p2 = points[0];\r\n // d = localRay.distanceSqToSegment(v1.copy(p1).setZ(0), v2.copy(p2).setZ(0));\r\n // if (d < clickToleranceSq && d < dist) {\r\n // dist = d;\r\n // res.Edge = [pc, 0];\r\n // }\r\n //}\r\n\r\n //if (res.Edge)\r\n // return res;\r\n\r\n var surfaceMesh = this._suface;\r\n\r\n if (surfaceMesh) {\r\n var intersects = worldRayCaster.intersectObject(surfaceMesh);\r\n if (intersects && intersects.length) {\r\n var intersect = intersects[0];\r\n res.surface = true;\r\n res.distSq = v1.copy(intersect.point).distanceToSquared(worldRayCaster.ray.origin);\r\n return res;\r\n }\r\n }\r\n\r\n }\r\n\r\n return null;\r\n }\r\n\r\n getLocalPosition(worldRayCaster: THREE.Raycaster) {\r\n var inverseMatrix = this._mat.getInverse(this.parent ? this.parent.matrixWorld : this.matrixWorld),\r\n localRay = this._ray.copy(worldRayCaster.ray).applyMatrix4(inverseMatrix),\r\n plane = this._plane;\r\n\r\n return localRay.intersectPlane(plane, this._v2);\r\n }\r\n\r\n getPoint(i: number): ObservableVector3 {\r\n return this.poly.array[i];\r\n }\r\n\r\n setPoint(i: number, x: number, y: number, z?: number) {\r\n //var lineSteppings = this.lineSteppings,\r\n // array = this.poly.array,\r\n // pointCount = array.length;\r\n //if (lineSteppings && pointCount > 1) {\r\n\r\n\r\n\r\n //} else {\r\n // var p = this.poly.array[i];\r\n // p.x = x;\r\n // p.y = y;\r\n // if (z !== undefined)\r\n // p.z = z;\r\n //}\r\n\r\n var array = this.poly.array,\r\n pointCount = array.length,\r\n lineStepping = this.lineStepping,\r\n p = array[i];\r\n\r\n p.x = x;\r\n p.y = y;\r\n if (z !== undefined)\r\n p.z = z;\r\n\r\n if (lineStepping && pointCount > 1) {\r\n if (i === 0) {\r\n lineStepping.getPosition(p, array[1], pointCount > 2 ? array[2] : null);\r\n } else {\r\n lineStepping.getPosition(p, array[i - 1], i > 1 ? array[i - 2] : null);\r\n }\r\n }\r\n }\r\n\r\n setPosition(v: THREE.Vector3) {\r\n this.position.copy(v);\r\n }\r\n\r\n applyMatrix4(m: THREE.Matrix4) {\r\n this.poly.applyMatrix4(m);\r\n }\r\n\r\n dispose() {\r\n if (this._isDisposed)\r\n return;\r\n\r\n this._isDisposed = true;\r\n\r\n if (this._polySubscription) {\r\n this._polySubscription.dispose();\r\n this._polySubscription = null;\r\n }\r\n\r\n Controller.Current.viewModel.editableObjectsManager.editableObjects.remove(this);\r\n\r\n this.children.slice().forEach(ch => {\r\n spt.ThreeJs.utils.disposeObject3D(ch, true, true, false);\r\n });\r\n\r\n this.surfaceMaterial.dispose();\r\n }\r\n }\r\n\r\n export class EditableObjectsManager {\r\n editableObjects: IEditableObject[] = [];\r\n active = true;\r\n hovered: IEditableSelection = null;\r\n startSelected: IEditableSelection = null;\r\n startPos = new THREE.Vector3();\r\n isDragging: boolean = false;\r\n private _v1 = new THREE.Vector3();\r\n\r\n readonly isEnabled: boolean;\r\n\r\n constructor(viewModel: ViewModel) {\r\n ko.track(this);\r\n\r\n ko.defineProperty(this, \"isEnabled\", () => this.active && this.editableObjects.some(e => e.editable || e.visible));\r\n\r\n ko.getObservable(this, \"hovered\").subscribe((oldVal) => {\r\n if (oldVal && oldVal.source && !oldVal.source._isDisposed) {\r\n //var controller = Controller.Current,\r\n // segmentHighlightHelper = controller.segmentHighlightHelper,\r\n var o = oldVal.source;\r\n o.hoveredPoint = -1;\r\n o.hovered = false;\r\n }\r\n }, null, \"beforeChange\");\r\n\r\n ko.getObservable(this, \"hovered\").subscribe((newVal) => {\r\n if (newVal && newVal.source && !newVal.source._isDisposed) {\r\n var n = newVal.source;\r\n if (newVal.pt >= 0)\r\n n.hoveredPoint = newVal.pt;\r\n else if (newVal.surface) {\r\n n.hovered = true;\r\n }\r\n }\r\n });\r\n }\r\n\r\n update(viewModel: ViewModel) {\r\n if (!this.isEnabled) {\r\n return;\r\n }\r\n\r\n this.editableObjects.forEach(p => { p.update(); });\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n if (!this.isEnabled) {\r\n if (this.hovered)\r\n this.hovered = null;\r\n return true;\r\n }\r\n\r\n var controller = Controller.Current,\r\n worldRaycaster = controller.worldRaycaster;\r\n\r\n if (!this.isDragging && this.startSelected && this.startSelected.source.editable && viewModel.mouseDown && viewModel.diffViewPosition.lengthSq() >= 100)\r\n this.isDragging = true;\r\n\r\n if (this.isDragging && this.startSelected) {\r\n var sel = this.startSelected,\r\n e = sel.source;\r\n\r\n var localPos = e.getLocalPosition(worldRaycaster);\r\n\r\n if (sel.pt >= 0) {\r\n if (viewModel.shiftDown) {\r\n var pt = this.startPos;\r\n localPos = spt.ThreeJs.utils.ProjectVectorToClosestAxis(this._v1.subVectors(localPos, pt)).add(pt);\r\n }\r\n\r\n e.setPoint(sel.pt, localPos.x, localPos.y);\r\n } else if (sel.surface && e.draggable) {\r\n var pos = this._v1.copy(localPos).sub(this.startPos).setZ(0);\r\n\r\n if (viewModel.shiftDown)\r\n spt.ThreeJs.utils.ProjectVectorToClosestAxis(pos);\r\n\r\n e.setPosition(pos);\r\n }\r\n\r\n if (e.userMoved)\r\n e.userMoved();\r\n\r\n e.userEdited = true;\r\n\r\n this.hovered = null;\r\n\r\n return false;\r\n }\r\n\r\n var intersection: IEditableSelection = null;\r\n\r\n this.editableObjects.forEach(e => {\r\n if (e.clickable) {\r\n var inter = e.intersecsRaycaster(worldRaycaster);\r\n if (inter && (!intersection || inter.distSq < intersection.distSq))\r\n intersection = inter;\r\n }\r\n });\r\n\r\n this.hovered = intersection;\r\n\r\n return true;\r\n }\r\n\r\n onMouseDown(viewModel: ViewModel) {\r\n if (!this.isEnabled || viewModel.shiftDown || viewModel.ctrlDown || viewModel.spaceDown)\r\n return true;\r\n\r\n this.applyUserEdited();\r\n\r\n this.isDragging = false;\r\n this.startSelected = this.hovered || null;\r\n\r\n if (this.startSelected) {\r\n var sel = this.startSelected,\r\n e = sel.source;\r\n if (sel.pt >= 0)\r\n this.startPos.copy(e.getPoint(sel.pt));\r\n else\r\n this.startPos.copy(e.getLocalPosition(Controller.Current.worldRaycaster));\r\n }\r\n\r\n return true;\r\n }\r\n\r\n onMouseUp(viewModel: ViewModel) {\r\n if (!this.isEnabled)\r\n return true;\r\n\r\n this.applyUserEdited();\r\n \r\n this.isDragging = false;\r\n this.startSelected = null;\r\n\r\n return true;\r\n }\r\n\r\n applyUserEdited() {\r\n this.editableObjects.forEach(e => {\r\n if (e.userEdited) {\r\n e.userEdited = false;\r\n\r\n if (e.position.lengthSq() > 0) {\r\n var m = new THREE.Matrix4().makeTranslation(e.position.x, e.position.y, 0);\r\n e.position.set(0, 0, 0);\r\n e.applyMatrix4(m);\r\n e.update();\r\n }\r\n if (e.userCallBack)\r\n e.userCallBack();\r\n }\r\n });\r\n }\r\n }\r\n}","module LS.Client3DEditor {\r\n //see Client3DObject_Generators.cs\r\n export var DefaultRenderOrder = 0;\r\n export var OverlayRenderOrder = 2;\r\n export var UIRenderOrder = 11;\r\n export var scrollbarWidth = 0;\r\n export var toolbarWidthRow = 0;\r\n\r\n export var globalParams = {\r\n ViewId: \"#aoes5-view\",\r\n ContainerId: \"#aoes5-view-container\",\r\n TBId: \"#aoes5-tb\",\r\n TBContainerId: \"#aoes5-tb-container\",\r\n ContentHeightClass: \".aoes5-content-height\",\r\n ContentId: \"#content\",\r\n WrapperId: \"#aoes5-wrapper\",\r\n StatusbarId: \"#ao-Statusbar\",\r\n CameraPadding: 10,\r\n ClickTolerance: 15, //pixel\r\n ContextMenu: \"#clientEditor-contextmenu\",\r\n DeferredRendering: true\r\n };\r\n\r\n export function setBoxhelper(object?: THREE.Object3D) {\r\n var controller = Controller.Current,\r\n boxHelper = controller.boxHelper,\r\n edgeHighlightHelper = controller.edgeHighlightHelper;\r\n\r\n if (object) {\r\n if (!boxHelper.visible)\r\n boxHelper.visible = true;\r\n\r\n boxHelper.setFromObject(object);\r\n\r\n if (object instanceof LS.Client3DEditor.ClientObjectInstance)\r\n boxHelper.userData.Id = object.instanceData.Id;\r\n else\r\n boxHelper.userData.Id = null;\r\n\r\n if (!controller.viewModel.tool)\r\n setScalehelper(object);\r\n } else {\r\n if (boxHelper.visible)\r\n boxHelper.visible = false;\r\n\r\n boxHelper.userData.Id = null;\r\n\r\n if (!controller.viewModel.tool && edgeHighlightHelper.visible)\r\n edgeHighlightHelper.visible = false;\r\n }\r\n }\r\n\r\n export function setScalehelper(object?: THREE.Object3D, localRaycaster?: THREE.Raycaster) {\r\n var controller = Controller.Current,\r\n edgeHighlightHelper = controller.edgeHighlightHelper,\r\n isVisible = false,\r\n edgeInter: spt.ThreeJs.utils.edgeIntersectResult = null;\r\n\r\n if (!localRaycaster)\r\n localRaycaster = controller.localRaycaster;\r\n\r\n edgeHighlightHelper.userData.Id = null;\r\n\r\n if (object && object instanceof LS.Client3DEditor.ClientObjectInstance && object.clientObject.canBeScaled && controller.viewModel.selected.some(sel => sel.instanceData.Id === object.instanceData.Id) && (edgeInter = spt.ThreeJs.utils.raycasterIntersectEdge(localRaycaster, object))) {\r\n\r\n var { bounds, direction, center } = edgeInter;\r\n edgeHighlightHelper.start.copy(center);\r\n edgeHighlightHelper.end.copy(center);\r\n\r\n if (Math.abs(direction.x) > Math.abs(direction.y)) {\r\n isVisible = object.clientObject.canBeScaledX;\r\n edgeHighlightHelper.start.setX(bounds.min.x);\r\n edgeHighlightHelper.end.setX(bounds.max.x);\r\n edgeHighlightHelper.thickness = bounds.max.y - bounds.min.y;\r\n } else {\r\n isVisible = object.clientObject.canBeScaledY;\r\n edgeHighlightHelper.start.setY(bounds.min.y);\r\n edgeHighlightHelper.end.setY(bounds.max.y);\r\n edgeHighlightHelper.thickness = bounds.max.x - bounds.min.x;\r\n }\r\n\r\n edgeHighlightHelper.zThickness = bounds.max.z - bounds.min.z;\r\n\r\n edgeHighlightHelper.userData.Id = object.instanceData.Id;\r\n\r\n }\r\n\r\n edgeHighlightHelper.visible = isVisible;\r\n if (isVisible)\r\n edgeHighlightHelper.onChanged();\r\n\r\n return isVisible ? edgeInter : null;\r\n }\r\n\r\n export function getScrollBarWidth() {\r\n var inner = document.createElement('p');\r\n inner.style.width = \"100%\";\r\n inner.style.height = \"200px\";\r\n\r\n var outer = document.createElement('div');\r\n outer.style.position = \"absolute\";\r\n outer.style.top = \"0px\";\r\n outer.style.left = \"0px\";\r\n outer.style.visibility = \"hidden\";\r\n outer.style.width = \"200px\";\r\n outer.style.height = \"150px\";\r\n outer.style.overflow = \"hidden\";\r\n outer.appendChild(inner);\r\n\r\n document.body.appendChild(outer);\r\n var w1 = inner.offsetWidth;\r\n outer.style.overflow = 'scroll';\r\n var w2 = inner.offsetWidth;\r\n\r\n if (w1 == w2) {\r\n w2 = outer.clientWidth;\r\n }\r\n\r\n document.body.removeChild(outer);\r\n\r\n return (w1 - w2);\r\n }\r\n\r\n export function updateToolboxDropdownMenuOrientation() {\r\n let $toolbox = $('#ao-Toolbox'),\r\n $aoMapDrawer = $('#root-aoMapDrawer');\r\n\r\n let direction = $aoMapDrawer.css('flex-direction');\r\n\r\n let dropdownMenus = $toolbox.find('.dropdown-toolbar-custom');\r\n dropdownMenus.removeClass('dropdown dropright');\r\n if (direction === 'row')\r\n dropdownMenus.addClass('dropright');\r\n else\r\n dropdownMenus.addClass('dropdown');\r\n }\r\n\r\n export function onWindowResize() {\r\n var controller = Controller.Current;\r\n if (!controller)\r\n return;\r\n\r\n var viewModel = controller.viewModel,\r\n $content = $(controller.ContentId),\r\n $aoes5View = controller.$aoes5View,\r\n height = $content.innerHeight(),\r\n $toolbox = $('#ao-Toolbox'),\r\n $aoMapDrawer = $('#root-aoMapDrawer');\r\n\r\n\r\n\r\n //var $curr = $aoes5View,\r\n // hSub = (parseInt($curr.css('padding-top')) || 0) + (parseInt($curr.css('padding-bottom')) || 0) + (parseInt($curr.css('margin-top')) || 0) + (parseInt($curr.css('margin-bottom')) || 0),\r\n // it = 0;\r\n //do {\r\n // $curr = $curr.parent();\r\n // if (it++ > 8 || $curr.is(document as any))\r\n // break;\r\n // hSub += (parseInt($curr.css('padding-top')) || 0) + (parseInt($curr.css('padding-bottom')) || 0) + (parseInt($curr.css('margin-top')) || 0) + (parseInt($curr.css('margin-bottom')) || 0);\r\n //} while (!$curr.is($content));\r\n\r\n //height -= hSub += $(controller.StatusbarId).outerHeight();\r\n //if (height < 20)\r\n // height = 20;\r\n ////height += LS.Client3DEditor.Controller.viewPaddingY;\r\n\r\n //$(controller.ContentHeightClass).height(height);\r\n\r\n //var $container = $(controller.ContainerId),\r\n // containerOffset = $container.offset(),\r\n // padding = parseInt($('#content_td').css('padding-right')) || 0,\r\n // w = $(window).width() - padding - containerOffset.left + LS.Client3DEditor.Controller.viewPaddingX,\r\n // h = $aoes5View.innerHeight() + LS.Client3DEditor.Controller.viewPaddingY;\r\n\r\n //w = $(window).width() - containerOffset.left - 2 - 14; // IMPORTANT!!! -2 because of toolbar border left and right; -14 because of scrollbar if height is too low\r\n //h = $aoes5View.innerHeight();\r\n\r\n updateToolboxDropdownMenuOrientation();\r\n\r\n let direction = $aoMapDrawer.css('flex-direction');\r\n //let w = viewModel.view.innerWidth();\r\n //let h = viewModel.view.innerHeight();\r\n let w = $aoMapDrawer.innerWidth();\r\n let h = $aoMapDrawer.innerHeight() - $(\"footer\").innerHeight(); //$(controller.ContainerId).innerHeight();\r\n console.log(h);\r\n\r\n // quick bugfix on SPT.Eco stepper back, prevent set wrong width or height\r\n if (w <= 0 || h <= 0)\r\n return;\r\n\r\n let toolbarHeight = 0;\r\n // calculate size of toolbar\r\n if ($toolbox.length !== 0 && toolbarWidthRow === 0) {\r\n let width = $toolbox.innerWidth();\r\n let height = $toolbox.innerHeight();\r\n toolbarWidthRow = width < height ? width : height;\r\n }\r\n if (direction !== 'row') {\r\n let border = 6;\r\n toolbarHeight = $toolbox.length === 0 ? 0 : $toolbox.innerHeight() + border;\r\n }\r\n\r\n if (scrollbarWidth === 0)\r\n scrollbarWidth = getScrollBarWidth();\r\n let toolboxMaxWidth = 0;\r\n\r\n // TODO bug $toolbox.get(0).scrollHeight => Cannot read property 'scrollHeight' of undefined\r\n let isScrollbarAvailable = $toolbox.length === 0 ?\r\n false :\r\n $toolbox.get(0).scrollHeight > Math.ceil($toolbox.height()); // ceil IMPORTANT!\r\n\r\n if (direction === 'row') {\r\n toolboxMaxWidth += toolbarWidthRow;\r\n if (isScrollbarAvailable)\r\n toolboxMaxWidth += scrollbarWidth;\r\n }\r\n else {\r\n h -= toolbarHeight;\r\n }\r\n w -= toolboxMaxWidth;\r\n\r\n //$aoes5View.width(w);\r\n //$container.width(w);\r\n\r\n viewModel.ContainerWidth = w;\r\n viewModel.ContainerHeight = h;\r\n viewModel.width = w;\r\n viewModel.height = h;\r\n\r\n //Shadow Legend Height\r\n //$('#aoShadowLegend').height(h);\r\n //Toolbox Height\r\n //$('#ao-Toolbox').height($container.outerHeight());\r\n\r\n var camera = controller.camera,\r\n uicamera = controller.uicamera,\r\n controls = controller.controls,\r\n controlHelper = controller.controlHelper,\r\n w2 = w / 2.0,\r\n h2 = h / 2.0;\r\n\r\n controls.reset(undefined, undefined, -w2, w2, h2, -h2);\r\n controls.handleResize();\r\n\r\n controller.renderer.setSize(w, h);\r\n controlHelper.UpdateOrientation();\r\n\r\n if (camera instanceof THREE.PerspectiveCamera) {\r\n camera.aspect = w / h;\r\n //camera.aspect = window.innerWidth / window.innterHeight;\r\n //camera.updateProjectionMatrix();\r\n //renderer.setSize(window.innerWidth, window.innterHeight);\r\n }\r\n\r\n camera.updateProjectionMatrix();\r\n\r\n uicamera.left = -w2;\r\n uicamera.right = w2;\r\n uicamera.top = h2;\r\n uicamera.bottom = -h2;\r\n uicamera.updateProjectionMatrix();\r\n\r\n spt.ThreeJs.utils.LineMaterialHelper.updateViewSize(viewModel.ContainerWidth, viewModel.ContainerHeight);\r\n }\r\n\r\n export function InitializeController() {\r\n LoaderManager.addLoadingJob();\r\n if (Controller.Current) {\r\n Controller.Current.Stop(() => {\r\n Controller.Current.updateManager.clearHistory();\r\n Controller.Current.clearClientObjects(true);\r\n Controller.Current.dispose();\r\n Controller.Current = null;\r\n InitializeController();\r\n LoaderManager.finishLoadingJob();\r\n });\r\n } else {\r\n var controller = Controller.init();\r\n switch (window.EditorViewMode) {\r\n case \"Anordnung\":\r\n controller.loadAnordnungObjects(controller.onObjectsInitialized.bind(controller));\r\n //ThemeManager.ResetTheme(\"Anordnung\");\r\n break;\r\n case \"AutoCAD\":\r\n controller.loadCADObjects(true, true, controller.onObjectsInitialized.bind(controller));\r\n //ThemeManager.ResetTheme(\"AutoCAD\");\r\n break;\r\n case \"Static\":\r\n controller.loadStaticObjects(true, true, controller.onObjectsInitialized.bind(controller));\r\n //ThemeManager.ResetTheme(\"Static\");\r\n break;\r\n case \"Electric\":\r\n controller.loadElectricObjects(true, controller.onObjectsInitialized.bind(controller));\r\n //ThemeManager.ResetTheme(\"Electric\");\r\n break;\r\n }\r\n onWindowResize();\r\n LoaderManager.finishLoadingJob();\r\n }\r\n }\r\n\r\n export var cleanUp = window.cleanUp = () => {\r\n var controller = Controller.Current;\r\n if (controller)\r\n controller.dispose();\r\n };\r\n\r\n window.ReloadPositions = () => {\r\n Controller.Current.reloadModulePlan(true);\r\n };\r\n\r\n window.ReCreateModuleField = () => {\r\n Controller.Current.regenerateModulePlan(false);\r\n };\r\n\r\n window.GetModulesOnError = () => { };\r\n\r\n window.NavigateToOldIndex = () => {\r\n\r\n var loadingIcon = document.getElementById('LoadingIcon');\r\n if (loadingIcon && loadingIcon.style)\r\n loadingIcon.style.display = 'none';\r\n\r\n var backToOldMessageContainer = document.getElementById('ao-BackToOldMessageContainer');\r\n if (backToOldMessageContainer && backToOldMessageContainer.style)\r\n backToOldMessageContainer.style.display = 'block';\r\n\r\n setTimeout(() => { window.location.href = \"index\"; }, 5000);\r\n WriteTraceSimple(\"Go Back to old 2D-Mode \", window.EditorViewMode || \"Anordnung\");\r\n };\r\n\r\n //Document load funtion\r\n //Setup Controller, ViewModel and UpdateManager\r\n $(() => {\r\n if (window.SkipAO3DSetup)\r\n return;\r\n\r\n var browserinfo = Detector.browserInfo;\r\n if (browserinfo && browserinfo.name)\r\n WriteTraceSimple(\"AO 2.0 loaded - Browser: \" + Detector.browserInfo.name + \" v \" + Detector.browserInfo.version + \", webglRenderer: \" + Detector.webglParameters.webglRenderer + \", Vendor: \" + Detector.webglParameters.webglVendor + \" - \" + Detector.webglParameters.webglVersion + \", maxTextureSize: \" + Detector.webglParameters.maxTextureSize + \", supportsInstancedArrays: \" + Detector.webglParameters.supportsInstancedArrays + \", GLSL: \" + Detector.webglParameters.shadingLanguageVersion, window.EditorViewMode || \"Anordnung\");\r\n if (sptBrowserCompatibilityCheck() || !Detector.webgl) {\r\n\r\n var aoErrorMessageContainer = document.getElementById('ao-ErrorMessageContainer');\r\n if (aoErrorMessageContainer && aoErrorMessageContainer.style)\r\n aoErrorMessageContainer.style.display = 'block';\r\n\r\n var loadingIcon = document.getElementById('LoadingIcon');\r\n if (loadingIcon && loadingIcon.style)\r\n loadingIcon.style.display = 'none';\r\n\r\n setTimeout(() => { window.location.href = \"index\"; }, 5000);\r\n return;\r\n }\r\n $(window).on(\"unload\", cleanUp);\r\n\r\n if ($('#versionLayoutPopUp').length)\r\n DManager.init('versionLayoutPopUp', 950, 'auto');\r\n if ($('#ao3dHelpDialog').length)\r\n DManager.init('ao3dHelpDialog', 600, 500);\r\n\r\n Controller.updateManagerInstance = new UpdateManager();\r\n\r\n var viewModel = Controller.viewModelInstance = new ViewModel();\r\n\r\n for (var name in viewModel.tools)\r\n viewModel.tools[name].init();\r\n\r\n window.addEventListener('resize', () => {\r\n onWindowResize();\r\n spt.Utils.DeferredCall(\"ControllerResetView\", Controller.Current.resetView.bind(Controller.Current), 100);\r\n }, false);\r\n\r\n viewModel.bindToView(globalParams.ViewId);\r\n mapInputsFromViewmodel(viewModel);\r\n\r\n InitializeController();\r\n\r\n var $tb = $(globalParams.TBId) as any;\r\n if ($tb.tabs)\r\n $tb.tabs();\r\n ($tb as JQuery).find('.ui-widget-header').removeClass('ui-widget-header');\r\n $('.sptAnordnung').addClass('sptAnordnung3d').removeClass('sptAnordnung');\r\n\r\n ko.applyBindings(viewModel, $(globalParams.WrapperId).get(0));\r\n\r\n if ($('#_itemAnordnung').length > 0 && $('#_itemAnordnung').attr(\"href\").indexOf(\"Anordnung/Edit\") !== -1)\r\n $('#_itemAnordnung').click(switchToAnordnung as any);\r\n\r\n if ($('#_itemAutoCAD').length > 0 && $('#_itemAutoCAD').attr(\"href\").indexOf(\"AutoCAD/Edit\") !== -1)\r\n $('#_itemAutoCAD').click(switchToAutoCad as any);\r\n\r\n if ($('#_itemStatic').length > 0 && $('#_itemStatic').attr(\"href\").indexOf(\"Static/Edit\") !== -1)\r\n $('#_itemStatic').click(switchToStatic as any);\r\n\r\n if ($('#_itemElectric').length > 0 && $('#_itemElectric').attr(\"href\").indexOf(\"Electric/Electric\") !== -1)\r\n $('#_itemElectric').click(switchToElectric as any);\r\n\r\n if ($('#ScaleContainer').length)\r\n DManager.init('ScaleContainer', 400, \"auto\", SetWidthDialogTitleBarWidth, SetPaddingBack);\r\n\r\n });\r\n}","module LS.Client3DEditor {\r\n\r\n export interface IObjectIntersection {\r\n o: T;\r\n p: THREE.Vector3;\r\n distSq: number;\r\n l?: number;\r\n idx?: number;\r\n }\r\n\r\n export interface IGenericObjectInstance extends THREE.Object3D, LS.Client3DEditor.ISelectableUi {\r\n IdString: string;\r\n update(): void;\r\n dispose(): void;\r\n\r\n intersecsBox(searchBox: THREE.Box3): boolean;\r\n\r\n getClosestPoint(p: THREE.Vector3, thresholdSq: number): IObjectIntersection;\r\n getClosestPointToRay(ray: THREE.Ray, threshold: number): IObjectIntersection;\r\n\r\n getPoints(): THREE.Vector3[];\r\n getLines(): THREE.Line3[];\r\n\r\n }\r\n\r\n export class GenericObjectInstance extends THREE.Object3D implements IGenericObjectInstance {\r\n private _isSelected: boolean = false;\r\n private _isHovered: boolean = false;\r\n private _isHidden: boolean = false;\r\n _isDisposed: boolean = false;\r\n _needsUpdate: boolean = true;\r\n IdString: string;\r\n\r\n constructor(id?: string) {\r\n super();\r\n this.IdString = id || spt.Utils.GenerateGuid();\r\n }\r\n\r\n get isSelected() {\r\n return this._isSelected;\r\n }\r\n\r\n set isSelected(v: boolean) {\r\n if (this._isSelected !== v) {\r\n this._isSelected = v;\r\n this._needsUpdate = true;\r\n }\r\n }\r\n\r\n get isHovered() {\r\n return this._isHovered;\r\n }\r\n\r\n set isHovered(v: boolean) {\r\n if (this._isHovered !== v) {\r\n this._isHovered = v;\r\n this._needsUpdate = true;\r\n }\r\n }\r\n\r\n get isHidden() {\r\n return this._isHidden;\r\n }\r\n\r\n set isHidden(v: boolean) {\r\n if (this._isHidden !== v) {\r\n this._isHidden = v;\r\n this._needsUpdate = true;\r\n }\r\n }\r\n\r\n getObjectHolder(): GenericObjectHolder {\r\n return null;\r\n }\r\n OnChanged(viewModel?: ViewModel): void {\r\n this.update();\r\n }\r\n clear(): void {\r\n if (this._isDisposed)\r\n return;\r\n\r\n spt.ThreeJs.utils.emptyObject3D(this, true, true, false);\r\n }\r\n update(): void {\r\n if (this._isDisposed || !this._needsUpdate)\r\n return;\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n build(): void {\r\n if (this._isDisposed)\r\n return;\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n dispose(): void {\r\n if (!this._isDisposed) {\r\n this.clear();\r\n this._isDisposed = true;\r\n }\r\n }\r\n getBounds(): THREE.Box3 {\r\n return new THREE.Box3();\r\n }\r\n getPointOffset(): THREE.Vector3 {\r\n return new THREE.Vector3();\r\n }\r\n getPoints(): THREE.Vector3[] {\r\n return [];\r\n }\r\n getLines(): THREE.Line3[] {\r\n return [];\r\n }\r\n\r\n intersecsBox(searchBox: THREE.Box3): boolean {\r\n if (this._isDisposed || !this.visible)\r\n return false;\r\n\r\n var bounds = this.getBounds();\r\n if (!this._isDisposed && this.visible && bounds && !bounds.isEmpty() && bounds.intersectsBox(searchBox)) {\r\n var lines = this.getLines();\r\n if (!lines.length)\r\n return true;\r\n return lines.some(seg => spt.ThreeJs.utils.LineIntersecsBox(seg.start, seg.end, searchBox));\r\n }\r\n return false;\r\n }\r\n\r\n protected _v1 = new THREE.Vector3();\r\n protected _v2 = new THREE.Vector3();\r\n\r\n getClosestPoint(p: THREE.Vector3, thresholdSq: number): IObjectIntersection {\r\n if (this._isDisposed || !this.visible)\r\n return null;\r\n\r\n var points = this.getPoints(),\r\n pointsCount = points.length,\r\n off = this.getPointOffset(),\r\n pos1 = this._v1,\r\n pos2 = this._v2,\r\n result = null as IObjectIntersection,\r\n closestDistance: number = Number.MAX_VALUE;\r\n\r\n if (pointsCount > 0) {\r\n\r\n for (var i = pointsCount; i--;) {\r\n var tp = pos1.copy(points[i]).add(off),\r\n lsq = tp.distanceToSquared(p);\r\n if (lsq <= thresholdSq && lsq < closestDistance) {\r\n closestDistance = lsq;\r\n result = {\r\n o: this,\r\n p: tp,\r\n distSq: lsq,\r\n idx: i\r\n };\r\n }\r\n }\r\n }\r\n\r\n if (result == null) {\r\n var lines = this.getLines(),\r\n linesCount = lines.length;\r\n\r\n if (linesCount > 0) {\r\n for (var i = linesCount; i--;) {\r\n var line = lines[i];\r\n\r\n pos1.copy(line.start).add(off);\r\n pos2.copy(line.end).add(off);\r\n\r\n var cp = spt.ThreeJs.utils.GetClosestPointToLine(pos1, pos2, p),\r\n dsq = cp.p.distanceToSquared(p);\r\n if (dsq <= thresholdSq && dsq < closestDistance) {\r\n closestDistance = dsq;\r\n result = {\r\n o: this,\r\n p: cp.p,\r\n distSq: dsq,\r\n idx: i,\r\n l: cp.l\r\n };\r\n }\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n getClosestPointToRay(ray: THREE.Ray, threshold: number): IObjectIntersection {\r\n if (this._isDisposed || !this.visible)\r\n return null;\r\n\r\n var points = this.getPoints(),\r\n p = points.length ? points[0].clone() : new THREE.Vector3(),\r\n off = this.getPointOffset(),\r\n inter = ray.intersectPlane(new THREE.Plane().setFromNormalAndCoplanarPoint(new THREE.Vector3(0, 0, 1), p.add(off)), new THREE.Vector3());\r\n\r\n if (inter)\r\n return this.getClosestPoint(inter, threshold * threshold);\r\n\r\n return null;\r\n }\r\n moveBy(v: THREE.Vector3): void {\r\n\r\n }\r\n removeInstance(): void {\r\n var objectHolder = this.getObjectHolder();\r\n if (objectHolder)\r\n objectHolder.removeObject(this);\r\n this.dispose();\r\n }\r\n GetPositionProperty(k: string): number {\r\n return this.position[k];\r\n }\r\n GetSizeProperty(k: string): number {\r\n return 0;\r\n }\r\n applyObjectPosition(): void {\r\n\r\n }\r\n duplicate(count?: number, distance?: number, direction?: THREE.Vector3): void {\r\n return;\r\n }\r\n rotateByPivot(pivot: THREE.Vector3, angleRad: number) {\r\n return;\r\n }\r\n getPivot(): THREE.Vector3 {\r\n return new THREE.Vector3();\r\n }\r\n\r\n }\r\n\r\n export class GenericObjectHolder extends THREE.Object3D {\r\n hoverObject: T;\r\n\r\n onObjectRemoved(so: T) { }\r\n onObjectAdded(so: T) { }\r\n\r\n setHoverObject(o: IObjectIntersection) {\r\n if (this.hoverObject) {\r\n this.hoverObject.isHovered = false;\r\n this.hoverObject.OnChanged();\r\n this.hoverObject = null;\r\n }\r\n if (o && o.o) {\r\n o.o.isHovered = true;\r\n o.o.OnChanged();\r\n this.hoverObject = o.o;\r\n }\r\n }\r\n\r\n removeObject(so: T) {\r\n this.remove(so);\r\n so.dispose();\r\n this.onObjectRemoved(so);\r\n }\r\n\r\n addObject(so: T) {\r\n this.add(so);\r\n this.onObjectAdded(so);\r\n }\r\n\r\n updateObjects() {\r\n if (!this.children.length)\r\n return;\r\n\r\n var mObjs = this.children;\r\n for (var i = mObjs.length; i--;) {\r\n var mObj = mObjs[i] as T;\r\n mObj.update();\r\n }\r\n }\r\n\r\n clear() {\r\n var mObjs = this.children;\r\n for (var i = mObjs.length; i--;) {\r\n var mObj = mObjs[i] as T;\r\n mObj.dispose();\r\n }\r\n spt.ThreeJs.utils.emptyObject3D(this, true, true);\r\n }\r\n\r\n getClosestByPosition(p: THREE.Vector3, tolerance: number): IObjectIntersection {\r\n var sos = this.getByBox(new THREE.Box3().expandByPoint(p).expandByScalar(tolerance)),\r\n minDist = Number.MAX_VALUE,\r\n thresholdSq = tolerance * tolerance,\r\n result = null as IObjectIntersection;\r\n\r\n sos.forEach(so => {\r\n var cp = so.getClosestPoint(p, thresholdSq);\r\n if (cp && cp.distSq < thresholdSq && cp.distSq < minDist) {\r\n minDist = cp.distSq;\r\n result = cp;\r\n }\r\n\r\n });\r\n\r\n return result;\r\n }\r\n\r\n getByBox(searchBox: THREE.Box3): T[] {\r\n if (this.children.length)\r\n return this.children.filter(mObj => (mObj as T).intersecsBox(searchBox)) as T[];\r\n return [];\r\n }\r\n\r\n getByRaycaster(raycaster: THREE.Raycaster, tolerance?: number): IObjectIntersection {\r\n var ray = raycaster.ray;\r\n\r\n var threshold = (tolerance || raycaster.params.Line.threshold),\r\n thresholdSq = threshold * threshold;\r\n\r\n var sos = this.children;\r\n\r\n var result = null as IObjectIntersection;\r\n var minDist = Number.MAX_VALUE;\r\n\r\n for (var i = sos.length; i--;) {\r\n var so = sos[i] as T;\r\n\r\n var cp = so.getClosestPointToRay(ray, threshold);\r\n if (cp && cp.distSq < thresholdSq && cp.distSq < minDist) {\r\n minDist = cp.distSq;\r\n result = cp;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n getByTestVolume(testVolume: spt.ThreeJs.utils.TestVolume): T[] {\r\n //if (this.children.length)\r\n // return this.children.filter(mObj => (mObj as T).intersecsTestVolume(testVolume)) as T[];\r\n return [];\r\n }\r\n\r\n }\r\n}","module LS.Client3DEditor {\r\n\r\n export class SelectionHelper extends THREE.Object3D {\r\n constructor() {\r\n super();\r\n this.visible = false;\r\n this.corner1 = new THREE.Vector3(-0.5, -0.5, 0);\r\n this.corner2 = new THREE.Vector3(0.5, 0.5, 0);\r\n\r\n var planeGeometry = new THREE.PlaneBufferGeometry(1, 1, 1, 1);\r\n var lineGeometry = new THREE.BufferGeometry();\r\n\r\n lineGeometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array([\r\n -0.5, -0.5, 0,\r\n 0.5, -0.5, 0,\r\n 0.5, 0.5, 0,\r\n -0.5, 0.5, 0,\r\n -0.5, -0.5, 0\r\n ]), 3));\r\n lineGeometry.boundingSphere = new THREE.Sphere(new THREE.Vector3(), 0.7071067811865476);\r\n\r\n var planeMesh = new THREE.Mesh(planeGeometry, new THREE.MeshBasicMaterial({\r\n transparent: true,\r\n opacity: 0.5,\r\n color: new THREE.Color(0x2194ce),\r\n fog: false,\r\n flatShading: true,\r\n depthTest: false,\r\n depthWrite: false\r\n }));\r\n planeMesh.renderOrder = LS.Client3DEditor.UIRenderOrder - 1;\r\n var lineMesh = new THREE.Line(lineGeometry, new THREE.LineBasicMaterial({\r\n transparent: true,\r\n opacity: 0.5,\r\n color: new THREE.Color(0x195799),\r\n fog: false,\r\n depthTest: false,\r\n depthWrite: false\r\n }));\r\n lineMesh.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n this.add(planeMesh);\r\n this.add(lineMesh);\r\n }\r\n\r\n setCorner1(v: THREE.Vector3) {\r\n this.corner1.copy(v);\r\n this.update();\r\n }\r\n\r\n setCorner2(v: THREE.Vector3) {\r\n this.corner2.copy(v);\r\n this.update();\r\n }\r\n\r\n setCorner1XY(x: number, y: number) {\r\n this.corner1.x = x;\r\n this.corner1.y = y;\r\n this.update();\r\n }\r\n\r\n setCorner2XY(x: number, y: number) {\r\n this.corner2.x = x;\r\n this.corner2.y = y;\r\n this.update();\r\n }\r\n\r\n update = (() => {\r\n var d = new THREE.Vector3();\r\n return function () {\r\n var c1 = this.corner1,\r\n c2 = this.corner2;\r\n this.position.copy(c1).add(c2).divideScalar(2);\r\n d.copy(c2).sub(c1);\r\n\r\n var lenx = Math.max(0.0001, Math.abs(d.x));\r\n var leny = Math.max(0.0001, Math.abs(d.y));\r\n\r\n var children = this.children;\r\n\r\n for (var i = children.length; i--;) {\r\n children[i].scale.set(lenx, leny, 1);\r\n }\r\n };\r\n })();\r\n\r\n corner1: THREE.Vector3;\r\n corner2: THREE.Vector3;\r\n }\r\n\r\n export class PointingHelper extends THREE.Mesh {\r\n constructor(plane?: THREE.Plane) {\r\n super(new THREE.SphereGeometry(1, 25, 15),\r\n new THREE.MeshBasicMaterial({\r\n transparent: true,\r\n opacity: 0.5,\r\n color: new THREE.Color(0x030b6f) as any,\r\n fog: false,\r\n flatShading: true,\r\n depthTest: false,\r\n depthWrite: false\r\n }));\r\n\r\n var lineGeometry = new THREE.BufferGeometry();\r\n\r\n var lineSize = 0.2;\r\n\r\n lineGeometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array([\r\n -lineSize, -lineSize, 0,\r\n lineSize, -lineSize, 0,\r\n lineSize, lineSize, 0,\r\n -lineSize, lineSize, 0,\r\n -lineSize, -lineSize, 0\r\n ]), 3));\r\n\r\n var lineSeg = new THREE.Line(lineGeometry, new THREE.LineBasicMaterial({\r\n transparent: false,\r\n opacity: 1,\r\n color: new THREE.Color(0x030b6f) as any,\r\n fog: false,\r\n depthTest: false,\r\n depthWrite: false\r\n }));\r\n\r\n lineSeg.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n\r\n this.add(lineSeg);\r\n\r\n this.visible = false;\r\n this.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n\r\n if (plane)\r\n spt.ThreeJs.utils.applyPlaneRotationToObject(plane, this);\r\n }\r\n }\r\n\r\n export class HelperLine extends THREE.Line implements LS.Client3DEditor.ISelectableUi {\r\n\r\n private static vlineGeometry: THREE.BufferGeometry = null;\r\n private static hlineGeometry: THREE.BufferGeometry = null;\r\n\r\n constructor(isVertical?: boolean, position?: THREE.Vector3, target?: THREE.Vector3) {\r\n super();\r\n this.isVertical = !!isVertical && !target;\r\n this.isFree = !!target;\r\n\r\n if (HelperLine.vlineGeometry === null) {\r\n HelperLine.vlineGeometry = new THREE.BufferGeometry();\r\n\r\n HelperLine.vlineGeometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array([\r\n 0, -0.5, 0,\r\n 0, 0.5, 0\r\n ]), 3));\r\n HelperLine.vlineGeometry.boundingSphere = new THREE.Sphere(new THREE.Vector3(), 0.5);\r\n }\r\n\r\n if (HelperLine.hlineGeometry === null) {\r\n HelperLine.hlineGeometry = new THREE.BufferGeometry();\r\n\r\n HelperLine.hlineGeometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array([\r\n -0.5, 0, 0,\r\n 0.5, 0, 0\r\n ]), 3));\r\n HelperLine.hlineGeometry.boundingSphere = new THREE.Sphere(new THREE.Vector3(), 0.5);\r\n }\r\n\r\n this.material = new THREE.LineBasicMaterial({\r\n color: 0x57EEFF,\r\n linewidth: 1,\r\n fog: false,\r\n transparent: true,\r\n opacity: 0.7,\r\n depthTest: false,\r\n depthWrite: false\r\n });\r\n\r\n this.geometry = isVertical ? HelperLine.vlineGeometry : HelperLine.hlineGeometry;\r\n\r\n this.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n this.frustumCulled = false;\r\n if (position)\r\n this.setPosition(position);\r\n\r\n this.target = target;\r\n\r\n this.isSelected = false;\r\n this.isHovered = false;\r\n this._isDisposed = false;\r\n Object.defineProperty(this, 'pos', { enumerable: true, configurable: true, get: () => { return this.isVertical ? this.position.x : this.position.y; } });\r\n\r\n this.rebuild();\r\n }\r\n\r\n GetPositionProperty(k: string) {\r\n if (this.isFree)\r\n return this.position[k];\r\n var isVertical = this.isVertical;\r\n if (isVertical && k === 'x')\r\n return this.position.x;\r\n if (!isVertical && k === 'y')\r\n return this.position.y;\r\n return null;\r\n }\r\n\r\n GetSizeProperty(k: string): number {\r\n return 0;\r\n }\r\n\r\n moveBy(v: THREE.Vector3) {\r\n var tp = new THREE.Vector3().copy(v).setZ(0);\r\n\r\n if (!this.isFree) {\r\n if (this.isVertical)\r\n tp.setY(0);\r\n else\r\n tp.setX(0);\r\n }\r\n\r\n this.position.add(tp);\r\n this._target.add(tp);\r\n\r\n this.rebuild();\r\n }\r\n\r\n distanceToPoint(p: THREE.Vector3 | THREE.Vector2) {\r\n return Math.abs(this.normal.dot(new THREE.Vector3().set(p.x, p.y, 0).sub(this.position)));\r\n }\r\n\r\n setPosition(position: THREE.Vector3, target?: THREE.Vector3) {\r\n if (target) {\r\n this.position.copy(position);\r\n this.target = target;\r\n this.rebuild();\r\n } else\r\n this.moveBy(new THREE.Vector3().copy(position).sub(this.position));\r\n }\r\n\r\n setTarget(t: THREE.Vector3) {\r\n this.target = t;\r\n this.rebuild();\r\n }\r\n\r\n rebuild() {\r\n if (!this.isFree)\r\n return;\r\n\r\n var n = this.normal;\r\n this.rotation.z = -Math.atan2(n.x, n.y);\r\n this.updateMatrix();\r\n }\r\n\r\n OnChanged(viewModel?: ViewModel) {\r\n var material = this.material as THREE.LineBasicMaterial;\r\n material.opacity = this.isSelected || this.isHovered ? 1 : 0.5;\r\n material.color.set(this.isSelected ? 0xD52CE8 : (this.isHovered ? 0xffff00 : 0x57EEFF));\r\n material.needsUpdate = true;\r\n }\r\n\r\n doDispose() {\r\n spt.ThreeJs.utils.disposeObject3D(this, false, false, true);\r\n this._isDisposed = true;\r\n }\r\n\r\n removeInstance() {\r\n if (this.parent && this.parent.parent instanceof LinesHelper) {\r\n var linesHelper = this.parent.parent as LinesHelper;\r\n if (linesHelper.hoverLine && linesHelper.hoverLine.id === this.id)\r\n linesHelper.setHoverLine(null);\r\n\r\n linesHelper.removeLine(this);\r\n }\r\n }\r\n\r\n normal = new THREE.Vector3(1, 0, 0);\r\n direction = new THREE.Vector3(0, 1, 0);\r\n private _target = new THREE.Vector3();\r\n isVertical: boolean;\r\n isFree: boolean;\r\n isSelected: boolean;\r\n isHovered: boolean;\r\n _isDisposed: boolean;\r\n pos: number;\r\n\r\n get target() {\r\n return this._target;\r\n }\r\n\r\n set target(value) {\r\n if (!this.isFree || !value) {\r\n if (this.isVertical)\r\n this._target.copy(this.position).add(new THREE.Vector3(0, 1, 0));\r\n else\r\n this._target.copy(this.position).add(new THREE.Vector3(1, 0, 0));\r\n }\r\n else\r\n this._target.copy(value);\r\n\r\n if (this._target.equals(this.position)) {\r\n this.normal.set(1, 0, 0);\r\n this.direction.set(0, 1, 0);\r\n this._target.copy(this.position).add(new THREE.Vector3(0, 1, 0));\r\n } else {\r\n this.direction.copy(this._target).sub(this.position).setZ(0).normalize();\r\n this.normal.set(this.direction.y, -this.direction.x, 0).normalize();\r\n //this.normal.copy(this._target).sub(this.position).cross(new THREE.Vector3(0, 0, 1)).normalize();\r\n }\r\n if (this.direction.y < 0)\r\n this.direction.negate();\r\n }\r\n\r\n applyObjectPosition() {\r\n\r\n }\r\n\r\n duplicate() {\r\n\r\n }\r\n\r\n rotateByPivot(pivot: THREE.Vector3, angleRad: number) { }\r\n\r\n getPivot(): THREE.Vector3 { return null; }\r\n }\r\n\r\n export class LinesHelper extends THREE.Object3D {\r\n\r\n static LinesHelperSnapping = (() => {\r\n var snapping = {\r\n NONE: 0,\r\n UP: 1,\r\n DOWN: 1 << 1,\r\n LEFT: 1 << 2,\r\n RIGHT: 1 << 3,\r\n CENTER: 1 << 4,\r\n ALL: -1,\r\n\r\n BORDER: 0,\r\n VERTICAL: 0,\r\n HORIZONTAL: 0\r\n };\r\n\r\n snapping.BORDER = snapping.UP | snapping.DOWN | snapping.LEFT | snapping.RIGHT;\r\n snapping.VERTICAL = snapping.CENTER | snapping.LEFT | snapping.RIGHT;\r\n snapping.HORIZONTAL = snapping.CENTER | snapping.UP | snapping.DOWN;\r\n\r\n return snapping;\r\n })();\r\n\r\n constructor() {\r\n super();\r\n\r\n var vLines = new THREE.Object3D(),\r\n hLines = new THREE.Object3D(),\r\n freeLines = new THREE.Object3D();\r\n this.vLines = vLines;\r\n this.hLines = hLines;\r\n this.freeLines = freeLines;\r\n\r\n //this.visible = false;\r\n this.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n this.frustumCulled = false;\r\n this.vLines.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n this.vLines.frustumCulled = false;\r\n this.hLines.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n this.hLines.frustumCulled = false;\r\n this.freeLines.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n this.freeLines.frustumCulled = false;\r\n this.position.set(0, 0, 50);\r\n this.add(vLines);\r\n this.add(hLines);\r\n this.add(freeLines);\r\n this.hoverLine = null;\r\n }\r\n\r\n setMinMax(minx: number, miny: number, maxx: number, maxy: number) {\r\n var w = maxx - minx,\r\n h = maxy - miny;\r\n this.w = w;\r\n this.h = h;\r\n this.hLines.scale.set(w, 1, 1);\r\n this.vLines.scale.set(1, h, 1);\r\n this.hLines.position.set(w * 0.5 + minx, 0, 0);\r\n this.vLines.position.set(0, h * 0.5 + miny, 0);\r\n var s = Math.max(w, h);\r\n this.freeLines.children.forEach(l => l.scale.set(s, 1, 1));\r\n }\r\n\r\n addLine(line: HelperLine) {\r\n if (line.isFree) {\r\n var s = Math.max(this.w, this.h);\r\n line.scale.set(s, 1, 1);\r\n this.freeLines.add(line);\r\n }\r\n else if (line.isVertical)\r\n this.vLines.add(line);\r\n else\r\n this.hLines.add(line);\r\n\r\n Controller.Current.viewModel.canSnap = true;\r\n }\r\n\r\n setHoverLine(hoverLine?: HelperLine) {\r\n if (this.hoverLine) {\r\n this.hoverLine.isHovered = false;\r\n this.hoverLine.OnChanged();\r\n this.hoverLine = null;\r\n }\r\n if (hoverLine) {\r\n hoverLine.isHovered = true;\r\n hoverLine.OnChanged();\r\n this.hoverLine = hoverLine;\r\n }\r\n }\r\n\r\n removeLine(line: HelperLine) {\r\n if (line.isFree)\r\n this.freeLines.remove(line);\r\n else if (line.isVertical)\r\n this.vLines.remove(line);\r\n else\r\n this.hLines.remove(line);\r\n\r\n line.doDispose();\r\n\r\n Controller.Current.viewModel.canSnap = this.hasLines();\r\n }\r\n\r\n hasLines() {\r\n return this.vLines.children.length > 0 || this.hLines.children.length > 0 || this.freeLines.children.length > 0;\r\n }\r\n\r\n getByClosestDirection(dir: THREE.Vector3) {\r\n var dist = 1,\r\n foundLine = null,\r\n vLines = this.vLines,\r\n hLines = this.hLines,\r\n freeLines = this.freeLines;\r\n\r\n for (let i = freeLines.children.length; i--;) {\r\n let line = (freeLines.children[i] as HelperLine);\r\n if (!line.visible)\r\n continue;\r\n let d = 1 - Math.abs(line.direction.dot(dir));\r\n if (d < dist) {\r\n dist = d;\r\n foundLine = line;\r\n }\r\n }\r\n\r\n for (let i = vLines.children.length; i--;) {\r\n let line = (vLines.children[i] as HelperLine);\r\n if (!line.visible)\r\n continue;\r\n let d = 1 - Math.abs(line.direction.dot(dir));\r\n if (d < dist) {\r\n dist = d;\r\n foundLine = line;\r\n }\r\n }\r\n\r\n for (let i = hLines.children.length; i--;) {\r\n let line = (hLines.children[i] as HelperLine);\r\n if (!line.visible)\r\n continue;\r\n let d = 1 - Math.abs(line.direction.dot(dir));\r\n if (d < dist) {\r\n dist = d;\r\n foundLine = line;\r\n }\r\n }\r\n\r\n return foundLine;\r\n }\r\n\r\n hasLine(line: HelperLine) {\r\n\r\n var lines = line.isFree ? this.freeLines : line.isVertical ? this.vLines : this.hLines;\r\n\r\n if (line.isFree) {\r\n for (let i = lines.children.length; i--;) {\r\n var ln = lines.children[i] as HelperLine;\r\n if (ln.pos !== null && ln.normal.equals(line.normal) && ln.position.clone().sub(line.position).dot(line.normal) === 0)\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n var pos = line.pos;\r\n\r\n for (let i = lines.children.length; i--;) {\r\n if ((lines.children[i] as HelperLine).pos === pos)\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n GetByPoint(point: THREE.Vector3 | THREE.Vector2, tolerance: number) {\r\n if (!this.visible || !this.hasLines())\r\n return null;\r\n\r\n var dist = Number.MAX_VALUE,\r\n foundLine = null,\r\n vLines = this.vLines,\r\n hLines = this.hLines,\r\n freeLines = this.freeLines;\r\n\r\n var line: HelperLine;\r\n\r\n for (let i = freeLines.children.length; i--;) {\r\n line = (freeLines.children[i] as HelperLine);\r\n if (!line.visible)\r\n continue;\r\n let d = line.distanceToPoint(point);\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n foundLine = line;\r\n }\r\n }\r\n\r\n for (let i = vLines.children.length; i--;) {\r\n line = (vLines.children[i] as HelperLine);\r\n if (!line.visible)\r\n continue;\r\n let d = Math.abs(line.pos - point.x);\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n foundLine = line;\r\n }\r\n }\r\n\r\n for (let i = hLines.children.length; i--;) {\r\n line = (hLines.children[i] as HelperLine);\r\n if (!line.visible)\r\n continue;\r\n let d = Math.abs(line.pos - point.y);\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n foundLine = line;\r\n }\r\n }\r\n\r\n return foundLine;\r\n }\r\n\r\n GetSnapWithBoxOffset = (() => {\r\n var box1;\r\n return function (box: THREE.Box3, offset: THREE.Vector3, tolerance: number) {\r\n if (!box1)\r\n box1 = new THREE.Box3();\r\n box1.copy(box).translate(offset);\r\n return this.GetSnapWithBox(box1, tolerance);\r\n };\r\n })();\r\n\r\n GetSnapWithBox = (() => {\r\n var s = new THREE.Vector3();\r\n var sHalf = new THREE.Vector3();\r\n var boxCenter = new THREE.Vector3();\r\n return function (box: THREE.Box3, tolerance: number, snappingType?: number) {\r\n if (!box || !this.visible || !this.hasLines())\r\n return null;\r\n\r\n var dist = Number.MAX_VALUE,\r\n x = box.min.x,\r\n y = box.min.y,\r\n vLines = this.vLines,\r\n hLines = this.hLines,\r\n freeLines = this.freeLines,\r\n snapType = typeof snappingType == \"number\" ? snappingType : LinesHelper.LinesHelperSnapping.BORDER,\r\n snapping = LinesHelper.LinesHelperSnapping;\r\n\r\n box.getSize(s);\r\n box.getCenter(boxCenter);\r\n sHalf.copy(s).multiplyScalar(0.5);\r\n\r\n var d: number, line: HelperLine, i: number;\r\n\r\n for (i = vLines.children.length; i--;) {\r\n line = vLines.children[i] as HelperLine;\r\n if (!line.visible)\r\n continue;\r\n\r\n if (snapType & snapping.RIGHT) {\r\n d = Math.abs(line.pos - box.max.x);\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n x = line.pos - s.x;\r\n }\r\n }\r\n\r\n if (snapType & snapping.CENTER) {\r\n d = Math.abs(line.pos - boxCenter.x);\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n x = line.pos - sHalf.x;\r\n }\r\n }\r\n\r\n if (snapType & snapping.LEFT) {\r\n d = Math.abs(line.pos - box.min.x);\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n x = line.pos;\r\n }\r\n }\r\n\r\n }\r\n\r\n dist = Number.MAX_VALUE;\r\n\r\n for (i = hLines.children.length; i--;) {\r\n line = hLines.children[i] as HelperLine;\r\n if (!line.visible)\r\n continue;\r\n\r\n if (snapType & snapping.UP) {\r\n d = Math.abs(line.pos - box.max.y);\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n y = line.pos - s.y;\r\n }\r\n }\r\n\r\n if (snapType & snapping.CENTER) {\r\n d = Math.abs(line.pos - boxCenter.y);\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n y = line.pos - sHalf.y;\r\n }\r\n }\r\n\r\n if (snapType & snapping.DOWN) {\r\n d = Math.abs(line.pos - box.min.y);\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n y = line.pos;\r\n }\r\n }\r\n }\r\n\r\n dist = Number.MAX_VALUE;\r\n\r\n for (i = freeLines.children.length; i--;) {\r\n line = freeLines.children[i] as HelperLine;\r\n if (!line.visible)\r\n continue;\r\n\r\n let bOff = spt.ThreeJs.utils.GetBoxOffsetByDirection(line.normal, sHalf.x, sHalf.y);\r\n var sps: THREE.Vector3[] = [];\r\n\r\n if (snapType & snapping.CENTER)\r\n sps.push(boxCenter);\r\n\r\n if (bOff.x != 0 || bOff.y != 0) {\r\n if ((bOff.y >= 0 || (snapType & snapping.DOWN)) &&\r\n (bOff.x <= 0 || (snapType & snapping.RIGHT)) &&\r\n (bOff.y <= 0 || (snapType & snapping.UP)) &&\r\n (bOff.x >= 0 || (snapType & snapping.LEFT)))\r\n sps.push(boxCenter.clone().add(bOff));\r\n\r\n bOff.negate();\r\n\r\n if ((bOff.y >= 0 || (snapType & snapping.DOWN)) &&\r\n (bOff.x <= 0 || (snapType & snapping.RIGHT)) &&\r\n (bOff.y <= 0 || (snapType & snapping.UP)) &&\r\n (bOff.x >= 0 || (snapType & snapping.LEFT)))\r\n sps.push(boxCenter.clone().add(bOff));\r\n }\r\n\r\n\r\n\r\n let dir = line.target.clone().sub(line.position);\r\n if (dir.lengthSq() <= 0)\r\n dir.set(1, 0, 0);\r\n else\r\n dir.normalize();\r\n\r\n sps.forEach(sp => {\r\n var tp = sp.clone().sub(line.position);\r\n var t = dir.dot(tp);\r\n tp.copy(dir).multiplyScalar(t).add(line.position).sub(sp);\r\n\r\n d = tp.length();\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n y = box.min.x + tp.x;\r\n x = box.min.y + tp.y;\r\n }\r\n });\r\n }\r\n\r\n return s.set(x - box.min.x, y - box.min.y, 0);\r\n };\r\n })();\r\n\r\n GetSnapWithPoint(point: THREE.Vector2 | THREE.Vector3, tolerance: number, snappingType?: number) {\r\n if (!point || !this.visible || !this.hasLines())\r\n return null;\r\n\r\n var dist = Number.MAX_VALUE,\r\n x = point.x,\r\n y = point.y,\r\n vLines = this.vLines,\r\n hLines = this.hLines,\r\n freeLines = this.freeLines,\r\n snapType = typeof snappingType == \"number\" ? snappingType : LinesHelper.LinesHelperSnapping.CENTER,\r\n snapping = LinesHelper.LinesHelperSnapping,\r\n snapped = false;\r\n\r\n var d, line, i;\r\n\r\n if (snapType & snapping.VERTICAL) {\r\n for (i = vLines.children.length; i--;) {\r\n line = vLines.children[i];\r\n if (!line.visible)\r\n continue;\r\n d = Math.abs(line.pos - point.x);\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n x = line.pos;\r\n snapped = true;\r\n }\r\n }\r\n\r\n dist = Number.MAX_VALUE;\r\n }\r\n\r\n if (snapType & snapping.HORIZONTAL) {\r\n for (i = hLines.children.length; i--;) {\r\n line = hLines.children[i];\r\n if (!line.visible)\r\n continue;\r\n d = Math.abs(line.pos - point.y);\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n y = line.pos;\r\n snapped = true;\r\n }\r\n }\r\n\r\n dist = Number.MAX_VALUE;\r\n }\r\n\r\n if (snapType & snapping.CENTER) {\r\n for (i = freeLines.children.length; i--;) {\r\n line = freeLines.children[i] as HelperLine;\r\n if (!line.visible)\r\n continue;\r\n\r\n let sp = new THREE.Vector3().set(point.x, point.y, 0);\r\n\r\n let n = line.target.clone().sub(line.position);\r\n if (n.lengthSq() <= 0)\r\n n.set(1, 0, 0);\r\n else\r\n n.normalize();\r\n\r\n var tp = sp.clone().sub(line.position);\r\n var t = n.dot(tp);\r\n tp.copy(n).multiplyScalar(t).add(line.position).sub(sp);\r\n\r\n d = tp.length();\r\n if (d < dist && d <= tolerance) {\r\n dist = d;\r\n x = point.x + tp.x;\r\n y = point.y + tp.y;\r\n snapped = true;\r\n }\r\n }\r\n }\r\n if (snapped)\r\n return new THREE.Vector3(x - point.x, y - point.y, 0);\r\n return null;\r\n }\r\n\r\n w: number = 10;\r\n h: number = 10;\r\n vLines: THREE.Object3D;\r\n hLines: THREE.Object3D;\r\n freeLines: THREE.Object3D;\r\n hoverLine: HelperLine;\r\n }\r\n\r\n export class SegmentsHelper extends THREE.Object3D {\r\n\r\n static linesMaterial: THREE.LineMaterial;\r\n private _lineGeo: THREE.LineGeometry;\r\n private _lineMesh: THREE.Line2;\r\n private _pointNumber = -1;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.visible = false;\r\n }\r\n\r\n setLinePoints(points?: THREE.Vector3[]) {\r\n\r\n if (!points || !points.length) {\r\n this.visible = false;\r\n return;\r\n }\r\n\r\n if (!SegmentsHelper.linesMaterial) {\r\n SegmentsHelper.linesMaterial = spt.ThreeJs.utils.LineMaterialHelper.GetLineMaterial({\r\n color: 0x00aacc,\r\n linewidth: 2.5, // in pixels\r\n vertexColors: false, //THREE.NoColors,\r\n transparent: true,\r\n //resolution: // to be set by renderer, eventually\r\n dashed: false,\r\n depthTest: false,\r\n depthWrite: false\r\n });\r\n }\r\n\r\n var len = points.length,\r\n pointNumber = this._pointNumber,\r\n edgeGeo = this._lineGeo;\r\n\r\n if (pointNumber < len) {\r\n pointNumber = this._pointNumber = len;\r\n\r\n this.reset();\r\n\r\n edgeGeo = this._lineGeo = new THREE.LineGeometry();\r\n\r\n if (!edgeGeo.boundingSphere)\r\n edgeGeo.boundingSphere = new THREE.Sphere();\r\n edgeGeo.setPositions(new Float32Array((pointNumber) * 3));\r\n\r\n var line = this._lineMesh = new THREE.Line2(edgeGeo, SegmentsHelper.linesMaterial);\r\n\r\n line.computeLineDistances();\r\n\r\n line.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n\r\n this.add(line);\r\n\r\n }\r\n\r\n var instanceBuffer = (edgeGeo.getAttribute('instanceStart') as THREE.InterleavedBufferAttribute).data as THREE.InstancedInterleavedBuffer,\r\n arr = instanceBuffer.array as Float32Array;\r\n\r\n var idx = 0,\r\n p1: THREE.Vector3,\r\n p2: THREE.Vector3;\r\n\r\n for (var i = 1; i < len; i++ , idx += 6) {\r\n p1 = points[i - 1];\r\n p2 = points[i];\r\n\r\n arr[idx] = p1.x;\r\n arr[idx + 1] = p1.y;\r\n arr[idx + 2] = p1.z;\r\n\r\n arr[idx + 3] = p2.x;\r\n arr[idx + 4] = p2.y;\r\n arr[idx + 5] = p2.z;\r\n }\r\n\r\n edgeGeo.maxInstancedCount = len - 1;\r\n\r\n instanceBuffer.needsUpdate = true;\r\n\r\n edgeGeo.boundingSphere.setFromPoints(points);\r\n\r\n }\r\n\r\n private reset() {\r\n spt.ThreeJs.utils.emptyObject3D(this, true, true);\r\n }\r\n }\r\n\r\n export class SegmentHighlightHelper extends THREE.Mesh {\r\n constructor() {\r\n super(new THREE.BoxBufferGeometry(1, 1, 1, 1, 1, 1),\r\n new THREE.MeshBasicMaterial({\r\n transparent: true,\r\n opacity: 0.5,\r\n color: new THREE.Color(0x030b6f) as any,\r\n fog: false,\r\n flatShading: true,\r\n depthTest: false,\r\n depthWrite: false\r\n }));\r\n\r\n this.visible = false;\r\n this.renderOrder = 11;\r\n }\r\n\r\n reset() {\r\n this.start.set(0, 0, 0);\r\n this.end.set(0, 0, 0);\r\n this.visible = false;\r\n this.onChanged();\r\n }\r\n\r\n setStartEnd(start: THREE.Vector3, end: THREE.Vector3, visible?: boolean, thickness?: number, zThickness?: number) {\r\n if (start)\r\n this.start.copy(start);\r\n if (end)\r\n this.end.copy(end);\r\n if (thickness && thickness > 0) {\r\n this.thickness = thickness;\r\n this.zThickness = thickness;\r\n }\r\n if (zThickness && zThickness > 0)\r\n this.zThickness = zThickness;\r\n if (visible !== undefined)\r\n this.visible = !!visible;\r\n this.onChanged();\r\n }\r\n\r\n setVisible(visible: boolean) {\r\n if (this.visible !== visible) {\r\n this.visible = visible;\r\n this.onChanged();\r\n }\r\n }\r\n\r\n onChanged() {\r\n if (!this.visible)\r\n return;\r\n\r\n var s = this.start;\r\n var e = this.end;\r\n var d = e.clone().sub(s);\r\n var lenSq = d.lengthSq();\r\n var th = this.thickness;\r\n var thz = this.zThickness;\r\n\r\n if (th <= 0 || thz <= 0 || lenSq <= 0) {\r\n this.visible = false;\r\n return;\r\n }\r\n\r\n var len = Math.sqrt(lenSq);\r\n\r\n var zAngle = Math.atan2(d.y, d.x);\r\n var yAngle = -Math.atan2(d.z, Math.sqrt(d.x * d.x + d.y * d.y));\r\n\r\n this.matrix.copy(new THREE.Matrix4().makeTranslation(s.x, s.y, s.z)\r\n .multiply(new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(0, yAngle, zAngle, \"ZYX\"))\r\n .multiply(new THREE.Matrix4().makeScale(len, th, thz)\r\n .multiply(new THREE.Matrix4().makeTranslation(0.5, 0, 0)))));\r\n\r\n this.matrix.decompose(this.position, this.quaternion, this.scale);\r\n\r\n this.matrixWorldNeedsUpdate = true;\r\n }\r\n\r\n start: THREE.Vector3 = new THREE.Vector3(0, 0, 0);\r\n end: THREE.Vector3 = new THREE.Vector3(1, 0, 0);\r\n thickness: number = 1000;\r\n zThickness: number = 1000;\r\n }\r\n\r\n export interface DirectedAreaVerticalLine {\r\n t: number;\r\n p1: THREE.Vector3;\r\n p2: THREE.Vector3;\r\n area: spt.ThreeJs.utils.DirectedAreaDefinition;\r\n }\r\n\r\n export class DirectedAreaHolder extends THREE.Object3D {\r\n constructor() {\r\n super();\r\n }\r\n\r\n hoverAreaObj: spt.ThreeJs.utils.DirectedAreaDefinition = null;\r\n hoverEdge: THREE.Vector3[] = null;\r\n hoverEdgeIdent: number = 0;\r\n deferredDuplicateAreas: spt.ThreeJs.utils.DirectedAreaDefinition[] = null;\r\n deferredRemoveAreas: spt.ThreeJs.utils.DirectedAreaDefinition[] = null;\r\n checkDuplicate: number;\r\n checkRemoved: number;\r\n _alpha: number = 1;\r\n\r\n clear() {\r\n this.hoverAreaObj = null;\r\n spt.ThreeJs.utils.emptyObject3D(this, true, true);\r\n }\r\n\r\n getById(id: string) {\r\n if (!id)\r\n return null;\r\n var mObjs = this.children;\r\n for (var i = mObjs.length; i--;) {\r\n var mObj = mObjs[i] as spt.ThreeJs.utils.DirectedAreaDefinition;\r\n if (mObj.IdString === id)\r\n return mObj;\r\n }\r\n return null;\r\n }\r\n\r\n changeAreaDirection(areas: spt.ThreeJs.utils.DirectedAreaDefinition[]) {\r\n if (!areas || !areas.length)\r\n return;\r\n\r\n areas.forEach(da => {\r\n da.flip = true;\r\n da.applyFlip();\r\n });\r\n\r\n this.saveDirectedAreaChanges(areas, false);\r\n }\r\n\r\n saveDirectedAreaChanges(areas: spt.ThreeJs.utils.DirectedAreaDefinition[], settingsChanged: boolean, callBack?: (results: SolarProTool.IDirectedAreaDefinition[]) => void) {\r\n if (!areas || !areas.length)\r\n return;\r\n\r\n var controller = Controller.Current,\r\n buildingParams: SolarProTool.BuildingParams[] = [];\r\n\r\n areas.forEach(da => {\r\n buildingParams.push({\r\n Id: da.IdString,\r\n GenericSettings: settingsChanged ? JSON.stringify(da.userData) : null,\r\n BuildingClassName: controller.BuildingClassName,\r\n BuildingSettingsClassName: da.userData['TypeName'],\r\n AreaDefinition: da.GetSimple()\r\n });\r\n });\r\n\r\n if (buildingParams.length) {\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DServiceBuildings.asmx\").Call('EditBuildings').Data({ buildingParams: buildingParams }).CallBack((results: SolarProTool.IDirectedAreaDefinition[]) => {\r\n if (results && results.length)\r\n controller.directedAreaHolder.addDirectedAreaDefinitions(results);\r\n if (callBack)\r\n callBack(results);\r\n });\r\n }\r\n }\r\n\r\n addDirectedAreaDefinitions(areaObjs: SolarProTool.IDirectedAreaDefinition[]) {\r\n for (var i = areaObjs.length; i--;) {\r\n this.addDirectedAreaDefinition(areaObjs[i]);\r\n }\r\n }\r\n\r\n addDirectedAreaDefinition(areaObj: SolarProTool.IDirectedAreaDefinition) {\r\n var ao = areaObj.IdString ? this.getById(areaObj.IdString) : null;\r\n if (ao != null) {\r\n ao.copyFrom(areaObj);\r\n } else {\r\n ao = new spt.ThreeJs.utils.DirectedAreaDefinition(areaObj);\r\n this.addArea(ao);\r\n }\r\n return ao;\r\n }\r\n\r\n removeById(id: string) {\r\n var ao = this.getById(id);\r\n if (ao)\r\n this.remove(ao);\r\n }\r\n\r\n onGenericParameterChanges(event: IEventManagerEvent) {\r\n if (event && event.data && event.data.length) {\r\n var directedAreas = (event.data as any[]).map(o => o._myDirectedArea as spt.ThreeJs.utils.DirectedAreaDefinition).filter(o => !!o && o instanceof spt.ThreeJs.utils.DirectedAreaDefinition);\r\n\r\n var entry = typeof event.source === \"string\" ? null : event.source as ClientGenericParamsEntry;\r\n\r\n if (entry) {\r\n directedAreas.forEach(da => {\r\n da.setParameter(entry.name, entry.oldValue, entry.unwrapValue());\r\n });\r\n }\r\n\r\n //GenericSettings has changed\r\n var buildingParams = directedAreas.map((da: spt.ThreeJs.utils.DirectedAreaDefinition) => {\r\n return {\r\n Id: da.IdString,\r\n GenericSettings: entry && entry.isOverload ? null : JSON.stringify(da.userData),\r\n BuildingClassName: Controller.Current.BuildingClassName,\r\n BuildingSettingsClassName: da.userData['TypeName'],\r\n AreaDefinition: da.GetSimple()\r\n } as SolarProTool.BuildingParams;\r\n });\r\n\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DServiceBuildings.asmx\").Call('EditBuildings').Data({ buildingParams: buildingParams }).CallBack((result) => {\r\n this.addDirectedAreaDefinitions(result);\r\n Controller.Current.viewModel.genericParameters.updateEntries();\r\n });\r\n }\r\n }\r\n\r\n setAlpha(alpha: number) {\r\n if (this._alpha != alpha) {\r\n\r\n var mObjs = this.children;\r\n for (var i = mObjs.length; i--;) {\r\n var mObj = mObjs[i] as spt.ThreeJs.utils.DirectedAreaDefinition;\r\n mObj.alpha = alpha;\r\n }\r\n\r\n this._alpha = alpha;\r\n }\r\n }\r\n\r\n onDirectedAreasChanged(objs: ISelectableUi[], settingChanged: boolean) {\r\n\r\n if (!objs || !objs.length)\r\n return;\r\n\r\n var directedAreas = objs.filter(o => o instanceof spt.ThreeJs.utils.DirectedAreaDefinition);\r\n\r\n if (!directedAreas.length)\r\n return;\r\n\r\n //GenericSettings has changed\r\n var buildingParams = directedAreas.map((da: spt.ThreeJs.utils.DirectedAreaDefinition) => {\r\n return {\r\n Id: da.IdString,\r\n GenericSettings: settingChanged ? JSON.stringify(da.userData) : null,\r\n BuildingClassName: Controller.Current.BuildingClassName,\r\n BuildingSettingsClassName: da.userData['TypeName'],\r\n AreaDefinition: da.GetSimple()\r\n } as SolarProTool.BuildingParams;\r\n });\r\n\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DServiceBuildings.asmx\").Call('EditBuildings').Data({ buildingParams: buildingParams }).CallBack((result) => {\r\n this.addDirectedAreaDefinitions(result);\r\n });\r\n }\r\n\r\n addArea(areaObj: spt.ThreeJs.utils.DirectedAreaDefinition) {\r\n areaObj.alpha = this._alpha;\r\n this.add(areaObj);\r\n Controller.Current.notifyRefreshView();\r\n }\r\n\r\n removeArea(area: spt.ThreeJs.utils.DirectedAreaDefinition) {\r\n if (!this.deferredRemoveAreas)\r\n this.deferredRemoveAreas = [];\r\n this.deferredRemoveAreas.push(area);\r\n if (!this.checkRemoved)\r\n this.checkRemoved = setTimeout(this.checkDeferredRemoved.bind(this), 0) as any;\r\n }\r\n\r\n checkDeferredRemoved() {\r\n if (!this.deferredRemoveAreas || !this.deferredRemoveAreas.length)\r\n return;\r\n\r\n var controller = Controller.Current,\r\n dareas = this.deferredRemoveAreas.slice(),\r\n ids = dareas.map(ra => ra.IdString).filter(id => !!id);\r\n\r\n if (ids.length) {\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DServiceBuildings.asmx\").Call('RemoveBuildings').Data({ ids: ids }).CallBack((results) => {\r\n if (!results)\r\n DManager.ShowSmallInfo(\"Error on deleting buildings!\");\r\n else {\r\n dareas.forEach(da => {\r\n this.remove(da);\r\n da.dispose();\r\n });\r\n results.forEach(result => {\r\n if (result)\r\n controller.directedAreaHolder.addDirectedAreaDefinition(result);\r\n });\r\n }\r\n });\r\n }\r\n\r\n this.deferredRemoveAreas = null;\r\n delete this.checkRemoved;\r\n\r\n Controller.Current.notifyRefreshView();\r\n }\r\n\r\n addDuplicate(area: spt.ThreeJs.utils.DirectedAreaDefinition, count?: number, distance?: number, direction?: THREE.Vector3) {\r\n if (!this.deferredDuplicateAreas)\r\n this.deferredDuplicateAreas = [];\r\n this.deferredDuplicateAreas.push(area);\r\n if (!this.checkDuplicate)\r\n this.checkDuplicate = setTimeout(this.checkDeferredDuplicates.bind(this, count, distance, direction), 0) as any;\r\n }\r\n\r\n checkDeferredDuplicates(count?: number, distance?: number, direction?: THREE.Vector3) {\r\n if (!this.deferredDuplicateAreas)\r\n return;\r\n\r\n var controller = Controller.Current,\r\n buildingParams: SolarProTool.BuildingParams[] = [],\r\n relativeOffset = true,\r\n offset = new THREE.Vector3();\r\n\r\n count = Math.max(count || 1, 1);\r\n\r\n if (typeof distance !== \"number\") {\r\n distance = 2000;\r\n relativeOffset = false;\r\n }\r\n\r\n distance = Math.max(distance || 0, 0);\r\n\r\n direction = direction || new THREE.Vector3(1, -1, 0);\r\n\r\n\r\n this.deferredDuplicateAreas.forEach(da => {\r\n\r\n if (da.length > 10 && da.height > 10) {\r\n\r\n var relativeLen = Math.sqrt(Math.pow(direction.x * da.length, 2) + Math.pow(direction.y * da.height, 2));\r\n\r\n for (var i = 1; i <= count; i++) {\r\n\r\n if (relativeOffset) {\r\n offset.copy(direction).applyEuler(da.rotation).multiplyScalar((distance + relativeLen) * i);\r\n } else\r\n offset.copy(direction).multiplyScalar(distance * i);\r\n\r\n var id = spt.Utils.GenerateGuid();\r\n buildingParams.push({\r\n Id: id,\r\n GenericSettings: JSON.stringify(da.userData),\r\n BuildingClassName: controller.BuildingClassName,\r\n BuildingSettingsClassName: da.userData['TypeName'],\r\n AreaDefinition: da.GetSimple(id, offset)\r\n });\r\n }\r\n\r\n }\r\n });\r\n\r\n if (buildingParams.length) {\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DServiceBuildings.asmx\").Call('EditBuildings').Data({ buildingParams: buildingParams }).CallBack((results) => {\r\n if (results && results.length) {\r\n var newAreas: SolarProTool.IDirectedAreaDefinition[] = [];\r\n results.forEach(result => {\r\n if (result)\r\n newAreas.push(controller.directedAreaHolder.addDirectedAreaDefinition(result));\r\n });\r\n //replace selection\r\n controller.viewModel.selectedUi.removeAll();\r\n controller.viewModel.selectedUi.splice.apply(controller.viewModel.selectedUi, ([0, 0] as any[]).concat(newAreas));\r\n }\r\n });\r\n }\r\n\r\n this.deferredDuplicateAreas = null;\r\n delete this.checkDuplicate;\r\n\r\n Controller.Current.notifyRefreshView();\r\n }\r\n\r\n getHorizontalLengthByPoint(p: THREE.Vector3, area: spt.ThreeJs.utils.DirectedAreaDefinition): DirectedAreaVerticalLine {\r\n var tp = p.clone().sub(area.position),\r\n axis = new THREE.Vector3(1, 0, 0).applyEuler(area.rotation),\r\n x = Math.max(0, Math.min(area.length, axis.dot(tp))),\r\n s = tp.copy(axis).multiplyScalar(x).add(area.position),\r\n e = area.start2.clone().sub(area.start).add(s);\r\n return { t: x, p1: s, p2: e, area: area };\r\n }\r\n\r\n getClosestByPosition(p: THREE.Vector3, tolerance: number) {\r\n var das = this.getByBox(new THREE.Box3().expandByPoint(p).expandByScalar(tolerance));\r\n var minDist = Number.MAX_VALUE;\r\n var e: THREE.Vector3[] = null;\r\n var pt = new THREE.Vector3();\r\n var eIdent = 0;\r\n var area: spt.ThreeJs.utils.DirectedAreaDefinition = null;\r\n for (var i = 0, j = das.length; i < j; i++) {\r\n var da = das[i];\r\n var edges = da.edges;\r\n for (var k = 0, l = edges.length; k < l; k++) {\r\n var edge = edges[k];\r\n var tp = spt.ThreeJs.utils.GetClosestPointToLine(edge[0], edge[1], p).p;\r\n var dist = tp.distanceTo(p);\r\n if (dist < minDist) {\r\n minDist = dist;\r\n e = edge;\r\n eIdent = k;\r\n area = da;\r\n pt.copy(tp);\r\n }\r\n }\r\n }\r\n\r\n return area != null ? { area: area, edge: e, edgeIdent: eIdent, distance: minDist, point: pt } : null;\r\n }\r\n\r\n getByBox(searchBox: THREE.Box3): spt.ThreeJs.utils.DirectedAreaDefinition[] {\r\n if (this.children.length)\r\n return this.children.filter(mObj => (mObj as spt.ThreeJs.utils.DirectedAreaDefinition).intersecsBox(searchBox)) as spt.ThreeJs.utils.DirectedAreaDefinition[];\r\n return [];\r\n }\r\n\r\n getByTestVolume(testVolume: spt.ThreeJs.utils.TestVolume): spt.ThreeJs.utils.DirectedAreaDefinition[] {\r\n if (this.children.length)\r\n return this.children.filter(mObj => (mObj as spt.ThreeJs.utils.DirectedAreaDefinition).intersecsTestVolume(testVolume)) as spt.ThreeJs.utils.DirectedAreaDefinition[];\r\n return [];\r\n }\r\n\r\n getByRaycaster(raycaster: THREE.Raycaster, tolerance?: number) {\r\n var ray = raycaster.ray,\r\n vt = new THREE.Vector3();\r\n\r\n var thresholdSq = Math.pow(tolerance || raycaster.params.Line.threshold, 2);\r\n\r\n var mObjs = this.children;\r\n\r\n var foundObj: spt.ThreeJs.utils.DirectedAreaDefinition = null;\r\n var minDist = Number.MAX_VALUE;\r\n\r\n for (var i = mObjs.length; i--;) {\r\n var mObj = mObjs[i] as spt.ThreeJs.utils.DirectedAreaDefinition;\r\n var dist: number;\r\n\r\n if (mObj.hasHeight) {\r\n if (ray.intersectsBox(mObj.BoundingBox) && (ray.intersectTriangle(mObj.start, mObj.end, mObj.end2, false, vt) || ray.intersectTriangle(mObj.start, mObj.end2, mObj.start2, false, vt)))\r\n return mObj;\r\n } else {\r\n dist = ray.distanceSqToSegment(mObj.start, mObj.end);\r\n if (dist < thresholdSq && dist < minDist) {\r\n minDist = dist;\r\n foundObj = mObj;\r\n }\r\n }\r\n }\r\n\r\n return foundObj;\r\n }\r\n\r\n deselectAll() {\r\n var mObjs = this.children;\r\n for (var i = mObjs.length; i--;) {\r\n var mObj = mObjs[i] as spt.ThreeJs.utils.DirectedAreaDefinition;\r\n if (mObj.isSelected) {\r\n mObj.isSelected = false;\r\n mObj.OnChanged();\r\n }\r\n }\r\n }\r\n\r\n setHoverAreaObj(areaObj?: spt.ThreeJs.utils.DirectedAreaDefinition, edge?: THREE.Vector3[], edgeIdent?: number) {\r\n var controller = Controller.Current,\r\n segmentHighlightHelper = controller.segmentHighlightHelper;\r\n\r\n if (this.hoverAreaObj && (!areaObj || areaObj.IdString !== this.hoverAreaObj.IdString)) {\r\n this.hoverAreaObj.isHovered = false;\r\n this.hoverAreaObj.OnChanged();\r\n this.hoverAreaObj = null;\r\n this.hoverEdge = null;\r\n segmentHighlightHelper.setVisible(false);\r\n }\r\n if (areaObj) {\r\n areaObj.isHovered = true;\r\n areaObj.OnChanged();\r\n this.hoverAreaObj = areaObj;\r\n this.hoverEdge = edge || null;\r\n this.hoverEdgeIdent = edgeIdent || 0;\r\n }\r\n }\r\n }\r\n\r\n export class MeasureObjectHolder extends THREE.Object3D {\r\n constructor() {\r\n super();\r\n }\r\n\r\n hoverDimObj: spt.ThreeJs.utils.DimensionAligned = null;\r\n\r\n clear() {\r\n this.hoverDimObj = null;\r\n spt.ThreeJs.utils.emptyObject3D(this, true, true);\r\n }\r\n\r\n addMeasureObjects(mObjs: SolarProTool.IMeasureObject[]) {\r\n for (var i = mObjs.length; i--;) {\r\n this.addMeasureObject(mObjs[i]);\r\n }\r\n }\r\n\r\n addMeasureObject(mObj: SolarProTool.IMeasureObject) {\r\n var dimObj = this.getById(mObj.IdString);\r\n var colHex = mObj.ColorHex,\r\n textSize = mObj.TextSize;\r\n if (window.EditorViewMode === \"Anordnung\" && colHex) {\r\n colHex = 0xdbe2fc;\r\n textSize = 150;\r\n } else {\r\n textSize = 100;\r\n }\r\n if (dimObj) {\r\n dimObj.setParameter(mObj.StartX, mObj.StartY, mObj.StartZ, mObj.EndX, mObj.EndY, mObj.EndZ, mObj.PositionX, mObj.PositionY, mObj.PositionZ, colHex, textSize, mObj.FontName);\r\n } else {\r\n dimObj = new spt.ThreeJs.utils.DimensionAligned(new THREE.Vector3(mObj.StartX, mObj.StartY, mObj.StartZ),\r\n new THREE.Vector3(mObj.EndX, mObj.EndY, mObj.EndZ),\r\n new THREE.Vector3(mObj.PositionX, mObj.PositionY, mObj.PositionZ),\r\n new THREE.Color(colHex), textSize, mObj.FontName);\r\n this.add(dimObj);\r\n }\r\n if (dimObj.userData.prevDimensionPosition)\r\n delete dimObj.userData.prevDimensionPosition;\r\n\r\n dimObj.userData.Id = mObj.IdString;\r\n }\r\n\r\n saveDimensionLine(dimObj: spt.ThreeJs.utils.DimensionAligned) {\r\n if (!dimObj)\r\n return;\r\n\r\n var diff = dimObj.end.clone().sub(dimObj.start);\r\n if (diff.lengthSq() <= 1)\r\n return;\r\n\r\n LoaderManager.addLoadingJob();\r\n AManager.Ajax('Anordnung3DService.asmx', 'SaveDimensionAligned', JSON.stringify({\r\n idString: dimObj.userData.Id || null,\r\n startx: dimObj.start.x, starty: dimObj.start.y, startz: dimObj.start.z,\r\n endx: dimObj.end.x, endy: dimObj.end.y, endz: dimObj.end.z,\r\n positionx: dimObj.dimensionPosition.x, positiony: dimObj.dimensionPosition.y, positionz: dimObj.dimensionPosition.z\r\n }), (mObj: SolarProTool.IMeasureObject) => {\r\n this.addMeasureObject(mObj);\r\n LoaderManager.finishLoadingJob();\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n LoaderManager.finishLoadingJob();\r\n });\r\n }\r\n\r\n removeDimensionLine(dimObj: spt.ThreeJs.utils.DimensionAligned) {\r\n var id = dimObj.userData.Id;\r\n this.remove(dimObj);\r\n if (id) {\r\n LoaderManager.addLoadingJob();\r\n AManager.Ajax('Anordnung3DService.asmx', 'DeleteDimensionAligned', JSON.stringify({ idString: id }), (result: boolean) => {\r\n LoaderManager.finishLoadingJob();\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n LoaderManager.finishLoadingJob();\r\n });\r\n }\r\n\r\n dimObj.dispose();\r\n }\r\n\r\n getById(id: string) {\r\n var mObjs = this.children;\r\n for (var i = mObjs.length; i--;) {\r\n var mObj = mObjs[i] as spt.ThreeJs.utils.DimensionAligned;\r\n if (mObj.userData.Id === id) {\r\n return mObj;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n getByRaycaster(raycaster: THREE.Raycaster, tolerance?: number) {\r\n var ray = raycaster.ray;\r\n\r\n var threshold = tolerance || raycaster.params.Line.threshold;\r\n var thresholdSq = threshold * threshold;\r\n\r\n var mObjs = this.children;\r\n\r\n var foundObj: spt.ThreeJs.utils.DimensionAligned = null;\r\n var minDist = Number.MAX_VALUE;\r\n\r\n for (var i = mObjs.length; i--;) {\r\n var mObj = mObjs[i] as spt.ThreeJs.utils.DimensionAligned;\r\n\r\n var dist = ray.distanceSqToSegment(mObj.mlineStart, mObj.mlineEnd);\r\n if (dist < thresholdSq && dist < minDist) {\r\n minDist = dist;\r\n foundObj = mObj;\r\n }\r\n }\r\n\r\n return foundObj;\r\n }\r\n\r\n setHoverDimObj(dimObj?: spt.ThreeJs.utils.DimensionAligned) {\r\n if (this.hoverDimObj) {\r\n this.hoverDimObj.isHovered = false;\r\n this.hoverDimObj.OnChanged();\r\n this.hoverDimObj = null;\r\n }\r\n if (dimObj) {\r\n dimObj.isHovered = true;\r\n dimObj.OnChanged();\r\n this.hoverDimObj = dimObj;\r\n }\r\n }\r\n\r\n }\r\n\r\n export class DashedLineMaterial extends THREE.RawShaderMaterial {\r\n\r\n get lineDirection() {\r\n return this.uniforms[\"lineDir\"].value as THREE.Vector3;\r\n }\r\n\r\n set lineDirection(value: THREE.Vector3) {\r\n this.uniforms[\"lineDir\"].value = value;\r\n }\r\n\r\n constructor(elements: number[], lineDirection: THREE.Vector3, color?: THREE.Color) {\r\n super();\r\n\r\n if (!elements || !elements.length)\r\n elements = [100, -100];\r\n\r\n var hasColor = !!color;\r\n\r\n var ev = new THREE.Vector4(0, 0, 0, 0);\r\n\r\n for (var i = 0, j = Math.min(elements.length, 4); i < j; i++) {\r\n ev.setComponent(i, elements[i]);\r\n }\r\n\r\n this.vertexColors = true; //THREE.VertexColors;\r\n\r\n var shaderPrecision = Detector.webglParameters.maxFloatPrecision;\r\n\r\n this.uniforms = {\r\n ev: { type: \"v4\", value: ev },\r\n lineDir: { type: \"v3\", value: lineDirection }\r\n };\r\n if (hasColor)\r\n this.uniforms.color = { type: \"c\", value: new THREE.Color(color) };\r\n\r\n this.vertexShader = [\r\n \"precision \" + shaderPrecision + \" float;\",\r\n\r\n \"uniform mat4 modelViewMatrix;\",\r\n \"uniform mat4 projectionMatrix;\",\r\n \"uniform vec3 lineDir;\",\r\n hasColor ? \"uniform vec3 color;\" : \"\",\r\n\r\n \"attribute vec3 position;\",\r\n hasColor ? \"\" : \"attribute vec3 color;\",\r\n\r\n \"varying float dt;\",\r\n \"varying vec3 vColor;\",\r\n\r\n \"void main() {\",\r\n \"dt = dot(position.xyz, lineDir);\",\r\n \"vColor = color;\",\r\n\r\n \"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\r\n \"}\"\r\n ].join(\"\\n\");\r\n\r\n //this.vertexShader = 'void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}';\r\n\r\n this.fragmentShader = [\r\n \"precision \" + shaderPrecision + \" float;\",\r\n\r\n \"uniform vec4 ev;\",\r\n\r\n \"varying float dt;\",\r\n \"varying vec3 vColor;\",\r\n\r\n //elements is the pattern with negatives equal holes. Eg [x: 100, y: -100, ...] returns 0 if v is in a hole else 1\r\n \"float checkPattern( in float v, in vec4 elements ) {\",\r\n\r\n \"vec4 aEv = vec4(abs(elements.x), abs(elements.y), abs(elements.z), abs(elements.w));\",\r\n\r\n \"float sum = dot(aEv, vec4(1.0,1.0,1.0,1.0));\",\r\n\r\n \"float d = mod(v, sum) * step(0.0, v) + (sum + mod(v, sum)) * (1.0 - step(0.0, v));\",\r\n\r\n \"vec4 pa = vec4(step(d, aEv.x),\",\r\n \"step(d - aEv.x, aEv.y),\",\r\n \"step(d - aEv.x - aEv.y, aEv.z),\",\r\n \"step(d - aEv.x - aEv.y - aEv.z, aEv.w));\",\r\n\r\n \"vec4 p = vec4((1.0 - step(aEv.x, sum - d - aEv.w - aEv.z - aEv.y)) * pa.x + (step(d, 0.0) * step(0.0, d)),\",\r\n \"(1.0 - step(aEv.y, sum - d - aEv.w - aEv.z)) * pa.y,\",\r\n \"(1.0 - step(aEv.z, sum - d - aEv.w)) * pa.z,\",\r\n \"(1.0 - step(aEv.w, sum - d)) * pa.w);\",\r\n\r\n \"return dot(p, vec4(step(0.0, elements.x), step(0.0, elements.y), step(0.0, elements.z), step(0.0, elements.w)));\",\r\n \"}\",\r\n\r\n \"void main() {\",\r\n \"if(checkPattern(dt, ev) <= 0.0) {\",\r\n \"discard;\",\r\n \"}\",\r\n \"gl_FragColor = vec4( vColor, 1.0 );\",\r\n \"}\"\r\n ].join(\"\\n\");\r\n\r\n this.flatShading = true;\r\n this.side = THREE.DoubleSide;\r\n this.transparent = false;\r\n }\r\n }\r\n\r\n export enum ModuleCellType {\r\n Monocrystalline = 0,\r\n Polycrystalline,\r\n Thinfilm,\r\n Flat,\r\n Custom\r\n }\r\n\r\n export class DefaultAppearanceShader extends THREE.RawShaderMaterial {\r\n\r\n get map() {\r\n return this.uniforms[\"map\"].value as THREE.Texture;\r\n }\r\n\r\n set map(value: THREE.Texture) {\r\n this.uniforms[\"map\"].value = value;\r\n }\r\n\r\n get color() {\r\n return this.uniforms[\"diffuse\"].value;\r\n }\r\n\r\n set color(value: THREE.Color) {\r\n this.uniforms[\"diffuse\"].value = value as THREE.Color;\r\n }\r\n\r\n constructor(map?: THREE.Texture, color?: THREE.Color, side?: THREE.Side, transparent?: boolean, notInstanced?: boolean, noDepth?: boolean, isDistanceMap?: boolean, alpha?: number, noInstanceColors?: boolean, hasScale?: boolean) {\r\n super();\r\n\r\n var a: number;\r\n\r\n if (alpha && alpha > 0) {\r\n a = Math.min(1, +alpha);\r\n if (a < 1)\r\n transparent = true;\r\n } else\r\n a = 1;\r\n\r\n var uniforms: { [uniform: string]: THREE.IUniform } = {\r\n diffuse: { value: new THREE.Color(color instanceof THREE.Color ? color : 0xFFFFFF) },\r\n map: { value: map instanceof THREE.Texture ? map : null },\r\n alpha: { value: a }\r\n };\r\n\r\n var useTexture = map !== null && map instanceof THREE.Texture;\r\n\r\n var floatPrecision = Detector.webglParameters.maxFloatPrecision;\r\n\r\n var lightDir = Controller.Current ? Controller.Current.mainLight.position.clone() : new THREE.Vector3(1.2, -1, 2).normalize();\r\n\r\n var light = `(clamp(dot(normal, vec3(${lightDir.x}, ${lightDir.y}, ${lightDir.z})), 0.0, 1.0) * 0.8 + 0.4)`;\r\n\r\n var vertexShader = [\r\n \"precision \" + floatPrecision + \" float;\",\r\n\r\n \"uniform mat4 modelViewMatrix;\",\r\n \"uniform mat4 projectionMatrix;\",\r\n \"uniform vec3 diffuse;\",\r\n \"uniform float alpha;\",\r\n\r\n notInstanced || noInstanceColors ? \"\" : \"attribute vec4 colori;\",\r\n notInstanced ? \"\" : \"attribute vec3 offseti;\",\r\n !notInstanced && hasScale ? \"attribute vec3 scalei;\" : \"\",\r\n \"attribute vec3 position;\",\r\n \"attribute vec3 normal;\",\r\n useTexture ? \"attribute vec2 uv;\" : \"\",\r\n\r\n useTexture ? \"varying vec2 vUv;\" : \"\",\r\n\r\n \"varying vec4 vColor;\",\r\n \"varying float vAlpha;\",\r\n\r\n \"void main() {\",\r\n\r\n \"vec3 vPosition = position;\",\r\n \"vAlpha = alpha;\",\r\n\r\n useTexture ? \"vUv = uv;\" : \"\",\r\n\r\n notInstanced || noInstanceColors ? \"vColor = vec4(\" + light + \" * diffuse, 1.0);\" : \"vColor = vec4(\" + light + \" * diffuse + colori.rgb, colori.a);\",\r\n\r\n \"gl_Position = projectionMatrix * modelViewMatrix * vec4( \" + (notInstanced ? \"\" : (hasScale ? \"offseti + scalei * \" : \"offseti + \")) + \"vPosition, 1.0 );\",\r\n\r\n \"}\"\r\n ].join(\"\\n\"),\r\n fragmentShader = [\r\n \"precision \" + floatPrecision + \" float;\",\r\n\r\n useTexture ? \"uniform sampler2D map;\" : \"\",\r\n \"uniform vec3 diffuse;\",\r\n useTexture ? \"varying vec2 vUv;\" : \"\",\r\n\r\n isDistanceMap ? \"const float smoothing = 1.0/64.0;\" : \"\",\r\n\r\n \"varying vec4 vColor;\",\r\n \"varying float vAlpha;\",\r\n\r\n \"void main() {\",\r\n\r\n useTexture ? \"vec4 tex = texture2D(map, vUv);\" : \"\",\r\n isDistanceMap ? \"vec4 col = vec4(vColor.rgb, smoothstep(0.5 - smoothing, 0.5 + smoothing, tex.r) * vColor.a * vAlpha);\" : (useTexture ? \"vec4 col = vec4((tex.rgb * vColor.rgb) / (tex.a * vColor.a * vAlpha), (tex.a * vColor.a * vAlpha));\" : \"vec4 col = vec4(vColor.rgb, vColor.a * vAlpha);\"),\r\n\r\n \"if(col.a <= 0.0) {\",\r\n \"discard;\",\r\n \"}\",\r\n\r\n \"gl_FragColor = col;\",\r\n\r\n \"}\"\r\n ].join(\"\\n\");\r\n\r\n this.uniforms = uniforms;\r\n this.vertexShader = vertexShader;\r\n this.fragmentShader = fragmentShader;\r\n this.side = side || THREE.FrontSide;\r\n this.transparent = !!transparent;\r\n if (noDepth) {\r\n this.depthTest = false;\r\n this.depthWrite = false;\r\n }\r\n }\r\n }\r\n\r\n export class BaseInstancedShader extends THREE.RawShaderMaterial {\r\n get color() {\r\n return this.uniforms[\"diffuse\"].value as THREE.Color;\r\n }\r\n\r\n set color(value: THREE.Color) {\r\n var curColor = this.uniforms[\"diffuse\"].value as THREE.Color;\r\n if (value && (!curColor.equals(value))) {\r\n curColor.copy(value);\r\n this.needsUpdate = true;\r\n }\r\n }\r\n\r\n get map() {\r\n return this.uniforms[\"map\"] && this.uniforms[\"map\"].value as THREE.Texture;\r\n }\r\n\r\n set map(value: THREE.Texture) {\r\n this.uniforms[\"map\"].value = value;\r\n this.needsUpdate = true;\r\n }\r\n\r\n get alpha(): number {\r\n return this.uniforms[\"alpha\"].value as number;\r\n }\r\n\r\n set alpha(value: number) {\r\n var curVal = this.uniforms[\"alpha\"].value as number;\r\n if (curVal != value) {\r\n this.uniforms[\"alpha\"].value = value || 0;\r\n this.needsUpdate = true;\r\n }\r\n }\r\n\r\n constructor(color?: THREE.Color, map?: THREE.Texture, alpha?: number, instanceColors?: boolean, instanceRotation?: boolean, instanceScale?: boolean, mapIsAdditive?: boolean) {\r\n super();\r\n\r\n var a: number;\r\n\r\n if (alpha && alpha > 0) {\r\n a = Math.min(1, +alpha);\r\n if (a < 1)\r\n this.transparent = true;\r\n } else\r\n a = 1;\r\n\r\n var uniforms: { [uniform: string]: THREE.IUniform } = {\r\n diffuse: { value: color instanceof THREE.Color ? color : new THREE.Color(0xFFFFFF) },\r\n alpha: { value: a }\r\n };\r\n\r\n var useTexture = map && map instanceof THREE.Texture;\r\n if (useTexture)\r\n uniforms.map = { value: map };\r\n\r\n var floatPrecision = Detector.webglParameters.maxFloatPrecision;\r\n\r\n var p = \"position\";\r\n if (instanceScale)\r\n p += \" * scalei\";\r\n if (instanceRotation)\r\n p = `applyQuaternion(${p}, roti)`;\r\n\r\n var vertexShader = [\r\n \"precision \" + floatPrecision + \" float;\",\r\n\r\n \"uniform mat4 modelViewMatrix;\",\r\n \"uniform mat4 projectionMatrix;\",\r\n \"uniform vec3 diffuse;\",\r\n \"uniform float alpha;\",\r\n\r\n instanceColors ? \"attribute vec4 colori;\" : \"\",\r\n instanceRotation ? \"attribute vec4 roti;\" : \"\",\r\n instanceScale ? \"attribute vec3 scalei;\" : \"\",\r\n \"attribute vec3 offseti;\",\r\n \"attribute vec3 position;\",\r\n useTexture ? \"attribute vec2 uv;\" : \"\",\r\n useTexture ? \"varying vec2 vUv;\" : \"\",\r\n\r\n \"varying vec4 vColor;\",\r\n \"varying float vAlpha;\",\r\n\r\n instanceRotation ? \"vec3 applyQuaternion(vec3 p, vec4 q) {\" : \"\",\r\n instanceRotation ? \"vec4 i = vec4(q.w * p.x + q.y * p.z - q.z * p.y,q.w * p.y + q.z * p.x - q.x * p.z,q.w * p.z + q.x * p.y - q.y * p.x,- q.x * p.x - q.y * p.y - q.z * p.z);\" : \"\",\r\n instanceRotation ? \"return vec3(i.x * q.w + i.w * - q.x + i.y * - q.z - i.z * - q.y, i.y * q.w + i.w * - q.y + i.z * - q.x - i.x * - q.z, i.z * q.w + i.w * - q.z + i.x * - q.y - i.y * - q.x);\" : \"\",\r\n instanceRotation ? \"}\" : \"\",\r\n\r\n \"void main() {\",\r\n\r\n \"vec3 vPosition = position;\",\r\n \"vAlpha = alpha;\",\r\n\r\n useTexture ? \"vUv = uv;\" : \"\",\r\n\r\n instanceColors ? \"vColor = vec4(diffuse + colori.rgb, colori.a);\" : \"vColor = vec4(diffuse, 1.0);\",\r\n\r\n \"gl_Position = projectionMatrix * modelViewMatrix * vec4(offseti + \" + p + \", 1.0 );\",\r\n\r\n \"}\"\r\n ].join(\"\\n\"),\r\n fragmentShader = [\r\n \"precision \" + floatPrecision + \" float;\",\r\n\r\n useTexture ? \"uniform sampler2D map;\" : \"\",\r\n useTexture ? \"varying vec2 vUv;\" : \"\",\r\n\r\n \"varying vec4 vColor;\",\r\n \"varying float vAlpha;\",\r\n\r\n \"void main() {\",\r\n\r\n useTexture ? \"vec4 tex = texture2D(map, vUv);\" : \"\",\r\n useTexture ? (mapIsAdditive ? \"vec4 col = vec4((tex.rgb * tex.a) + vColor.rgb, vColor.a * vAlpha);\" : \"vec4 col = vec4((tex.rgb * vColor.rgb) / (tex.a * vColor.a * vAlpha), (tex.a * vColor.a * vAlpha));\") : \"vec4 col = vec4(vColor.rgb, vColor.a * vAlpha);\",\r\n\r\n \"if(col.a <= 0.0) {\",\r\n \"discard;\",\r\n \"}\",\r\n\r\n \"gl_FragColor = col;\",\r\n\r\n \"}\"\r\n ].join(\"\\n\");\r\n\r\n this.uniforms = uniforms;\r\n this.vertexShader = vertexShader;\r\n this.fragmentShader = fragmentShader;\r\n\r\n }\r\n }\r\n\r\n export class ModuleAppearanceShader extends THREE.RawShaderMaterial {\r\n\r\n isModuleAppearanceShader = true;\r\n\r\n private GetCellTexture() {\r\n //\"../../handler/StaticImagesHandler.ashx?ID=ModuleCellShape&cellWidth=128&cellHeight=128&cellEdgeRound=16&cellEColumn=40&cellPadding=2\";\r\n var cellTypeName: string = ModuleCellType[this._cellType];\r\n var url = UI3DImages[\"ModuleCellShape_\" + cellTypeName];\r\n\r\n if (this._cellType === ModuleCellType.Custom) {\r\n url += `&cellWidth=${this.cellWidth}&cellHeight=${this.cellHeight}&cellEdgeRound=${this.cellEdgeRound}&cellEColumn=${this.cellEColumn}&cellPadding=${this.cellPadding}`;\r\n }\r\n\r\n var loader = new THREE.TextureLoader();\r\n var tex = loader.load(url, () => {\r\n LoaderManager.notifyResourceLoaded();\r\n });\r\n tex.anisotropy = Detector.webglParameters.maxAnisotropy || 1;\r\n tex.wrapS = tex.wrapT = THREE.RepeatWrapping;\r\n return tex;\r\n }\r\n\r\n get opacity(): number {\r\n if (this.uniforms && this.uniforms[\"opacity\"])\r\n return this.uniforms[\"opacity\"].value;\r\n return 1;\r\n }\r\n\r\n set opacity(v: number) {\r\n if (this.uniforms && this.uniforms[\"opacity\"])\r\n this.uniforms[\"opacity\"].value = v;\r\n }\r\n\r\n get moduleCellColor(): THREE.Color {\r\n return this.uniforms[\"diffuse\"].value;\r\n }\r\n\r\n set moduleCellColor(c: THREE.Color) {\r\n this.uniforms[\"diffuse\"].value.copy(c);\r\n }\r\n\r\n get moduleFrameColor(): THREE.Color {\r\n return this.uniforms[\"frame\"].value;\r\n }\r\n\r\n set moduleFrameColor(c: THREE.Color) {\r\n this.uniforms[\"frame\"].value.copy(c);\r\n }\r\n\r\n get moduleBacksheetColor(): THREE.Color {\r\n return this.uniforms[\"backsheet\"].value;\r\n }\r\n\r\n set moduleBacksheetColor(c: THREE.Color) {\r\n this.uniforms[\"backsheet\"].value.copy(c);\r\n }\r\n\r\n get cols(): number {\r\n return this.uniforms[\"uvScale\"].value.x;\r\n }\r\n\r\n set cols(v: number) {\r\n this.uniforms[\"uvScale\"].value.x = v;\r\n }\r\n\r\n get rows(): number {\r\n return this.uniforms[\"uvScale\"].value.y;\r\n }\r\n\r\n set rows(v: number) {\r\n this.uniforms[\"uvScale\"].value.y = v;\r\n }\r\n\r\n get frameWidth(): number {\r\n return this.uniforms[\"frameWidth\"].value;\r\n }\r\n\r\n set frameWidth(v: number) {\r\n this.uniforms[\"frameWidth\"].value = v;\r\n }\r\n\r\n private _cellType: ModuleCellType;\r\n private _cellWidth: number;\r\n private _cellHeight: number;\r\n private _cellEdgeRound: number;\r\n private _cellEColumn: number;\r\n private _cellPadding: number;\r\n\r\n get cellType(): ModuleCellType {\r\n return this._cellType;\r\n }\r\n\r\n set cellType(cellType: ModuleCellType) {\r\n this._cellType = cellType;\r\n\r\n this.uniforms[\"map\"].value = this.GetCellTexture();\r\n }\r\n\r\n get cellWidth() {\r\n return this._cellWidth;\r\n }\r\n\r\n set cellWidth(value: number) {\r\n this._cellWidth = value;\r\n\r\n this.uniforms[\"map\"].value = this.GetCellTexture();\r\n }\r\n\r\n get cellHeight() {\r\n return this._cellHeight;\r\n }\r\n\r\n set cellHeight(value: number) {\r\n this._cellHeight = value;\r\n\r\n this.uniforms[\"map\"].value = this.GetCellTexture();\r\n }\r\n\r\n get cellEdgeRound() {\r\n return this._cellEdgeRound;\r\n }\r\n\r\n set cellEdgeRound(value: number) {\r\n this._cellEdgeRound = value;\r\n\r\n this.uniforms[\"map\"].value = this.GetCellTexture();\r\n }\r\n\r\n get cellEColumn() {\r\n return this._cellEColumn;\r\n }\r\n\r\n set cellEColumn(value: number) {\r\n this._cellEColumn = value;\r\n\r\n this.uniforms[\"map\"].value = this.GetCellTexture();\r\n }\r\n\r\n get cellPadding() {\r\n return this._cellPadding;\r\n }\r\n\r\n set cellPadding(value: number) {\r\n this._cellPadding = value;\r\n\r\n this.uniforms[\"map\"].value = this.GetCellTexture();\r\n }\r\n\r\n constructor(cellType?: ModuleCellType, color?: number, cols?: number, rows?: number, dimensionX?: number, dimensionY?: number, framingWidth?: number, notInstanced?: boolean, blending?: THREE.Blending, opacity?: number, reflection?: THREE.CubeTexture, colorFrame?: number, colorBacksheet?: number, cellWidth?: number, cellHeight?: number, cellEdgeRound?: number, cellEColumn?: number, cellPadding?: number, reflect90Degree?: boolean) {\r\n super();\r\n\r\n if (!framingWidth) {\r\n framingWidth = 20;\r\n }\r\n\r\n var floatPrecision = Detector.webglParameters.maxFloatPrecision;\r\n //var maxAnisotropy = Detector.webglParameters.maxAnisotropy || 1;\r\n\r\n this._cellType = cellType || ModuleCellType.Monocrystalline;\r\n this._cellWidth = cellWidth || 128;\r\n this._cellHeight = cellHeight || 128;\r\n\r\n if (cellEdgeRound === undefined)\r\n cellEdgeRound = 16;\r\n\r\n if (cellEColumn === undefined)\r\n cellEColumn = 40;\r\n\r\n if (cellPadding === undefined)\r\n cellPadding = 2;\r\n\r\n this._cellEdgeRound = cellEdgeRound;\r\n this._cellEColumn = cellEColumn;\r\n this._cellPadding = cellPadding;\r\n\r\n var uniforms: any = {\r\n diffuse: { type: \"c\", value: new THREE.Color(color !== undefined ? color : 0x0b1b3c) },\r\n backsheet: { type: \"c\", value: new THREE.Color(colorBacksheet !== undefined ? colorBacksheet : 0xe5e5e5) },\r\n frame: { type: \"c\", value: new THREE.Color(colorFrame !== undefined ? colorFrame : 0xb5b5b5) },\r\n frameWidth: { type: \"1f\", value: framingWidth },\r\n opacity: { type: \"1f\", value: opacity !== undefined ? opacity : 1 },\r\n uvScale: { type: \"v2\", value: new THREE.Vector2(cols || 6, rows || 10) },\r\n dim: { type: \"v2\", value: new THREE.Vector2((dimensionX || 900), (dimensionY || 1900)) },\r\n map: { type: \"t\", value: this.GetCellTexture() }\r\n };\r\n\r\n var useEnvMap = !!reflection && reflection instanceof THREE.CubeTexture;\r\n\r\n if (useEnvMap) {\r\n uniforms.envMap = { type: \"t\", value: reflection }\r\n }\r\n\r\n var vertexShader = [\r\n \"precision \" + floatPrecision + \" float;\",\r\n\r\n useEnvMap ? '#define USE_ENVMAP' : '',\r\n\r\n useEnvMap ? \"uniform mat4 modelMatrix;\" : \"\",\r\n useEnvMap ? \"uniform mat4 viewMatrix;\" : \"\",\r\n useEnvMap ? \"\" : \"uniform mat4 modelViewMatrix;\",\r\n \"uniform mat4 projectionMatrix;\",\r\n \"uniform vec3 diffuse;\",\r\n \"uniform float frameWidth;\",\r\n \"uniform float opacity;\",\r\n \"uniform vec2 dim;\",\r\n \"uniform vec2 uvScale;\",\r\n\r\n notInstanced ? \"\" : \"attribute vec4 colori;\",\r\n notInstanced ? \"\" : \"attribute vec3 offseti;\",\r\n \"attribute vec3 position;\",\r\n \"attribute vec2 uv;\",\r\n\r\n \"#ifdef USE_ENVMAP\",\r\n \"attribute vec3 normal;\",\r\n \"uniform mat3 normalMatrix;\",\r\n \"uniform vec3 cameraPosition;\",\r\n \"varying vec3 vReflect;\",\r\n \"varying float fReflectVal;\",\r\n \"#endif\",\r\n\r\n \"varying vec2 vUv;\",\r\n\r\n \"varying float vOpacity;\",\r\n\r\n \"varying vec2 framing;\",\r\n\r\n \"varying vec3 cell;\",\r\n\r\n notInstanced ? \"\" : \"varying vec4 vColor;\",\r\n\r\n \"vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\",\r\n \"return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\",\r\n \"}\",\r\n\r\n \"void main() {\",\r\n\r\n \"#ifdef USE_ENVMAP\",\r\n \"vec3 transformedNormal = normalMatrix * normal;\",\r\n \"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\r\n \"vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\",\r\n \"vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\",\r\n \"vReflect = reflect( cameraToVertex, worldNormal );\",\r\n \"fReflectVal = (dot( cameraToVertex, vReflect ) + 1.4) * 0.5;\",\r\n \"#endif\",\r\n\r\n \"vec3 vPosition = position;\",\r\n\r\n \"vUv = uv;\",\r\n\r\n \"vOpacity = opacity;\",\r\n\r\n \"framing = vec2((frameWidth / dim.x) * uvScale.x, (frameWidth / dim.y) * uvScale.y );\",\r\n\r\n notInstanced ? \"\" : \"vColor = colori;\",\r\n\r\n \"cell = diffuse;\",\r\n\r\n \"gl_Position = projectionMatrix * \" + (useEnvMap ? \"viewMatrix * modelMatrix\" : \"modelViewMatrix\") + \" * vec4( \" + (notInstanced ? \"\" : \"offseti + \") + \"position, 1.0 );\",\r\n\r\n \"}\"\r\n ].join(\"\\n\"),\r\n fragmentShader = [\r\n \"precision \" + floatPrecision + \" float;\",\r\n\r\n useEnvMap ? '#define USE_ENVMAP' : '',\r\n\r\n \"uniform sampler2D map;\",\r\n\r\n \"uniform vec2 uvScale;\",\r\n\r\n \"#ifdef USE_ENVMAP\",\r\n \"uniform samplerCube envMap;\",\r\n \"varying vec3 vReflect;\",\r\n \"varying float fReflectVal;\",\r\n \"#endif\",\r\n\r\n \"varying vec2 vUv;\",\r\n\r\n \"varying float vOpacity;\",\r\n\r\n \"varying vec2 framing;\",\r\n\r\n notInstanced ? \"\" : \"varying vec4 vColor;\",\r\n\r\n \"varying vec3 cell;\",\r\n\r\n \"uniform vec3 backsheet;\",\r\n\r\n \"uniform vec3 frame;\",\r\n\r\n \"void main() {\",\r\n\r\n \"vec2 borderL = framing / uvScale;\",\r\n \"vec2 border = step(borderL, vUv) * step(vUv, vec2(1.0, 1.0) - borderL);\",\r\n \"vec2 borderH = framing / uvScale;\",\r\n \"vec2 border2 = step(borderH, vUv) * step(vUv, vec2(1.0, 1.0) - borderH);\",\r\n \"vec4 tex = texture2D(map, uvScale * ((vUv - borderL) / (vec2(1.0, 1.0) - (borderL * 2.0))));\",\r\n\r\n \"float framef = border2.x * border2.y;\",\r\n \"float backsheetf = tex.r * border.x * border.y;\",\r\n\r\n notInstanced ? \"vec3 outgoingLight = mix(frame, mix(backsheet, tex.rgb * cell, backsheetf), framef);\" : \"vec3 outgoingLight = mix(frame + vColor.rgb * 0.5, mix(backsheet + vColor.rgb * 0.5, tex.rgb * (cell + vColor.rgb), backsheetf), framef);\",\r\n\r\n \"#ifdef USE_ENVMAP\",\r\n \"vec3 reflectVec = vReflect;\",\r\n reflect90Degree ? \"vec4 envColor = textureCube( envMap, vec3(reflectVec.x, reflectVec.z, -reflectVec.y) );\" : \"vec4 envColor = textureCube( envMap, reflectVec.xyz );\",\r\n \"outgoingLight += mix(vec3(0.0), envColor.xyz * fReflectVal, framef);\",\r\n \"#endif\",\r\n\r\n notInstanced ? \"gl_FragColor = vec4(outgoingLight, vOpacity);\" : \"gl_FragColor = vec4(outgoingLight, vColor.a * vOpacity);\",\r\n\r\n \"}\"\r\n ].join(\"\\n\");\r\n\r\n this.uniforms = uniforms;\r\n this.vertexShader = vertexShader;\r\n this.fragmentShader = fragmentShader;\r\n this.side = THREE.FrontSide;\r\n this.transparent = true;\r\n if (blending !== undefined)\r\n this.blending = blending;\r\n if (opacity !== undefined)\r\n this.opacity = opacity;\r\n }\r\n }\r\n\r\n export class HeatmapHelper extends THREE.Object3D {\r\n\r\n private map: THREE.CanvasTexture;\r\n private heatCanvas: HeatMap.HeatCanvas;\r\n private mesh: THREE.Mesh;\r\n private bounds: THREE.Box2;\r\n private textureSize: number;\r\n\r\n constructor() {\r\n super();\r\n }\r\n\r\n public init(poly: THREE.Vector2[], textureSize: number = 512) {\r\n this.textureSize = textureSize;\r\n var heatCanvas = this.heatCanvas,\r\n map = this.map,\r\n mesh = this.mesh;\r\n\r\n if (heatCanvas) {\r\n if (heatCanvas.width !== textureSize || heatCanvas.height !== textureSize)\r\n heatCanvas.resize(textureSize, textureSize);\r\n } else {\r\n heatCanvas = this.heatCanvas = new HeatMap.HeatCanvas(textureSize, textureSize);\r\n }\r\n\r\n if (!map)\r\n map = this.map = new THREE.CanvasTexture(heatCanvas.canvas);\r\n\r\n if (mesh) {\r\n this.remove(mesh);\r\n spt.ThreeJs.utils.disposeObject3D(mesh, false, true, false);\r\n mesh = this.mesh = null;\r\n }\r\n\r\n var material = new THREE.MeshBasicMaterial({\r\n map: map\r\n });\r\n\r\n mesh = this.mesh = new THREE.Mesh(spt.ThreeJs.utils.triangulateToGeometry(poly), material);\r\n\r\n this.add(mesh);\r\n\r\n\r\n this.bounds = new THREE.Box2().setFromPoints(poly);\r\n\r\n }\r\n\r\n public setData(dataPoints: { x: number, y: number, z: number }[], minVal: number, maxVal: number, radius?: number, degree?: HeatMap.DegreeEnum) {\r\n var heatCanvas = this.heatCanvas,\r\n bounds = this.bounds,\r\n min = bounds.min,\r\n size = bounds.getSize(new THREE.Vector2()),\r\n textureSize = this.textureSize,\r\n s = Math.max(size.x, size.y);\r\n\r\n if (!heatCanvas.needsRender)\r\n heatCanvas.clear();\r\n\r\n if (dataPoints)\r\n dataPoints.forEach(p => {\r\n heatCanvas.push((p.x - min.x) / s * textureSize, (1 - (p.y - min.y) / s) * textureSize, p.z);\r\n });\r\n\r\n heatCanvas.setMinMax(minVal, maxVal);\r\n\r\n if (radius)\r\n heatCanvas.setRadiusDegree(radius / s * textureSize, degree);\r\n }\r\n\r\n public draw(): void {\r\n this.heatCanvas.render();\r\n this.map.needsUpdate = true;\r\n }\r\n\r\n }\r\n\r\n export class MeasureVisualizer extends THREE.Object3D {\r\n\r\n minX = new THREE.Vector3();\r\n minY = new THREE.Vector3();\r\n maxX = new THREE.Vector3();\r\n maxY = new THREE.Vector3();\r\n\r\n padding = 1000;\r\n textSize = 200;\r\n\r\n steps: THREE.Vector3[] = [];\r\n private _needUpdate = true;\r\n\r\n private _measureObjectsX: spt.ThreeJs.utils.DimensionAligned[] = [];\r\n private _measureObjectsY: spt.ThreeJs.utils.DimensionAligned[] = [];\r\n\r\n stepsX: THREE.Vector3[];\r\n stepsY: THREE.Vector3[];\r\n\r\n _stepsXCount: number = 0;\r\n _stepsYCount: number = 0;\r\n\r\n constructor() {\r\n super();\r\n ko.track(this, [\"steps\", \"minX\", \"minY\", \"maxX\", \"maxY\"]);\r\n\r\n ko.defineProperty(this, \"stepsX\", () => {\r\n return ArrayHelper.distinct(this.steps.concat([this.minX, this.maxX]), (a, b) => a.x - b.x);\r\n //return ArrayHelper.distinct(this.steps.concat([new THREE.Vector3(this.minX, this.minY), new THREE.Vector3(this.maxX, this.minY)]), (a, b) => a.x - b.x);\r\n });\r\n\r\n ko.defineProperty(this, \"stepsY\", () => {\r\n return ArrayHelper.distinct(this.steps.concat([this.minY, this.maxY]), (a, b) => a.y - b.y);\r\n //return ArrayHelper.distinct(this.steps.concat([new THREE.Vector3(this.minX, this.minY), new THREE.Vector3(this.minX, this.maxY)]), (a, b) => a.y - b.y);\r\n });\r\n }\r\n\r\n setOuter(poly: THREE.Vector3[]) {\r\n var minX = this.minX.set(Number.MAX_VALUE, 0, 0),\r\n minY = this.minY.set(0, Number.MAX_VALUE, 0),\r\n maxX = this.maxX.set(0, 0, 0),\r\n maxY = this.maxY.set(0, 0, 0);\r\n\r\n if (poly && poly.length) {\r\n poly.forEach(p => {\r\n if (p.x < minX.x || (p.x === minX.x && p.y < minX.y))\r\n minX.copy(p);\r\n if (p.y < minY.y || (p.y === minY.y && p.x < minY.x))\r\n minY.copy(p);\r\n if (p.x > maxX.x || (p.x === maxX.x && p.y < maxX.y))\r\n maxX.copy(p);\r\n if (p.y > maxY.y || (p.y === maxY.y && p.x < maxY.x))\r\n maxY.copy(p);\r\n });\r\n }\r\n }\r\n\r\n setBounds(c1: THREE.Vector3, c2: THREE.Vector3) {\r\n var bd = new THREE.Box3().expandByPoint(c1).expandByPoint(c2);\r\n\r\n this.minX.copy(bd.min);\r\n this.minY.copy(bd.min);\r\n this.maxX.copy(bd.max);\r\n this.maxY.copy(bd.max);\r\n\r\n this.onChanged();\r\n }\r\n\r\n addStep(v: { x: number, y: number }) {\r\n this.steps.push(new THREE.Vector3(v.x || 0, v.y || 0, 0));\r\n\r\n this.onChanged();\r\n }\r\n\r\n clearSteps() {\r\n this.steps.removeAll();\r\n\r\n this.onChanged();\r\n }\r\n\r\n onChanged() {\r\n this._needUpdate = true;\r\n }\r\n\r\n clear() {\r\n this.children.slice().forEach((dim: spt.ThreeJs.utils.DimensionAligned) => {\r\n this.remove(dim);\r\n dim.dispose();\r\n });\r\n this._measureObjectsX = [];\r\n this._measureObjectsY = [];\r\n\r\n this.steps.removeAll();\r\n //spt.ThreeJs.utils.emptyObject3D(this, true, true);\r\n }\r\n\r\n update() {\r\n if (!this._needUpdate)\r\n return;\r\n\r\n this._needUpdate = false;\r\n\r\n if (!this.steps.length) {\r\n if (this.visible)\r\n this.visible = false;\r\n return;\r\n }\r\n\r\n if (!this.visible)\r\n this.visible = true;\r\n\r\n var stepsX = this.stepsX,\r\n stepsY = this.stepsY,\r\n measureObjectsXCount = stepsX.length - 1,\r\n measureObjectsYCount = stepsY.length - 1;\r\n\r\n if (this._measureObjectsX.length < measureObjectsXCount || this._measureObjectsY.length < measureObjectsYCount)\r\n this.build(measureObjectsXCount, measureObjectsYCount);\r\n\r\n var measureObjectsX = this._measureObjectsX,\r\n measureObjectsY = this._measureObjectsY;\r\n\r\n var pos = new THREE.Vector3(),\r\n padding = this.padding,\r\n minDist = 400,\r\n startX = this.minX.x - padding,\r\n startY = this.minY.y - padding;\r\n\r\n for (var i = 0, l = this._measureObjectsX.length; i < l; i++) {\r\n var mo = measureObjectsX[i];\r\n\r\n if (i >= measureObjectsXCount) {\r\n mo.visible = false;\r\n continue;\r\n }\r\n\r\n var p1 = stepsX[i],\r\n p2 = stepsX[i + 1],\r\n d = p2.x - p1.x;\r\n\r\n mo.setPositions(p1, p2, pos.set((p1.x + p2.x) * 0.5, d < minDist ? startY - minDist : startY, 0));\r\n mo.visible = true;\r\n }\r\n\r\n for (var i = 0, l = this._measureObjectsY.length; i < l; i++) {\r\n var mo = measureObjectsY[i];\r\n\r\n if (i >= measureObjectsYCount) {\r\n mo.visible = false;\r\n continue;\r\n }\r\n\r\n var p1 = stepsY[i],\r\n p2 = stepsY[i + 1],\r\n d = p2.y - p1.y;\r\n\r\n mo.setPositions(p1, p2, pos.set(d < minDist ? startX - minDist : startX, (p1.y + p2.y) * 0.5, 0));\r\n mo.visible = true;\r\n }\r\n }\r\n\r\n build(measureObjectsXCount: number, measureObjectsYCount: number) {\r\n var measureObjectsX = this._measureObjectsX,\r\n measureObjectsY = this._measureObjectsY;\r\n\r\n while (measureObjectsX.length < measureObjectsXCount) {\r\n var dim = new spt.ThreeJs.utils.DimensionAligned(new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3(), new THREE.Color(0, 0, 0), this.textSize, null, true, false, null, true, 0, 1);\r\n this.add(dim);\r\n measureObjectsX.push(dim);\r\n }\r\n\r\n while (measureObjectsY.length < measureObjectsYCount) {\r\n var dim = new spt.ThreeJs.utils.DimensionAligned(new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3(), new THREE.Color(0, 0, 0), this.textSize, null, true, false, null, true, Math.PI * 0.5, 0);\r\n this.add(dim);\r\n measureObjectsY.push(dim);\r\n }\r\n\r\n }\r\n }\r\n\r\n export class LineSegmentsHelper extends THREE.Object3D {\r\n\r\n lineSegments: { [k: number]: THREE.LineSegments2 } = {};\r\n\r\n private _updateQueue: { [k: number]: THREE.Vector3[] } = {};\r\n private _needsUpdate = false;\r\n\r\n hasSegments() {\r\n return this.children.length > 0;\r\n }\r\n\r\n clear() {\r\n spt.ThreeJs.utils.emptyObject3D(this);\r\n this.lineSegments = {};\r\n this._updateQueue = {};\r\n }\r\n\r\n update() {\r\n if (!this._needsUpdate)\r\n return;\r\n\r\n this._needsUpdate = false;\r\n var updateQueue = this._updateQueue,\r\n lineSegments = this.lineSegments;\r\n\r\n this._updateQueue = {};\r\n\r\n for (var k in updateQueue) {\r\n var color = new THREE.Color().setHex(+k),\r\n vertices: THREE.Vector3[] = updateQueue[k],\r\n lineSegment = lineSegments[k] as THREE.LineSegments2,\r\n posArr: Float32Array,\r\n idx = 0;\r\n\r\n if (lineSegment) {\r\n //var geo = lineSegment.geometry as THREE.BufferGeometry,\r\n // positionAttrib = geo.getAttribute(\"position\") as THREE.BufferAttribute,\r\n // arr = positionAttrib.array as Float32Array,\r\n // arrLen = arr.length;\r\n\r\n //posArr = new Float32Array(vertices.length * 3 + arrLen);\r\n //for (var i = 0, len = arr.length; i < len; i++) {\r\n // posArr[i] = arr[i];\r\n //}\r\n //idx = arrLen;\r\n\r\n this.remove(lineSegment);\r\n\r\n spt.ThreeJs.utils.disposeObject3D(lineSegment);\r\n\r\n posArr = new Float32Array(vertices.length * 3);\r\n } else {\r\n posArr = new Float32Array(vertices.length * 3);\r\n }\r\n\r\n for (var i = 0, len = vertices.length; i < len; i++) {\r\n var v = vertices[i];\r\n\r\n posArr[idx++] = v.x;\r\n posArr[idx++] = v.y;\r\n posArr[idx++] = v.z;\r\n }\r\n\r\n var geometry = new THREE.LineSegmentsGeometry();\r\n geometry.setPositions(posArr);\r\n //geometry.setAttribute('position', new THREE.Float32BufferAttribute(posArr, 3));\r\n //geometry.setAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) );\r\n //geometry.computeBoundingSphere();\r\n\r\n //var material = new THREE.LineBasicMaterial({ color: color });\r\n var material = this.getMaterial(color);\r\n\r\n lineSegment = new THREE.LineSegments2(geometry, material);\r\n\r\n this.add(lineSegment);\r\n\r\n lineSegments[k] = lineSegment;\r\n }\r\n\r\n //for (var i = conduitObjects.length; i--;)\r\n }\r\n\r\n private getMaterial(color: THREE.Color) {\r\n return spt.ThreeJs.utils.LineMaterialHelper.GetLineMaterial({\r\n color: color.getHex(),\r\n linewidth: 2, // in pixels\r\n vertexColors: false, //THREE.NoColors,\r\n transparent: true,\r\n //resolution: // to be set by renderer, eventually\r\n dashed: false,\r\n depthTest: false,\r\n depthWrite: false\r\n });\r\n }\r\n\r\n addPolyline(vertices: THREE.Vector3[], color: THREE.Color, drawAngled?: boolean) {\r\n if (!vertices || vertices.length < 2)\r\n return;\r\n var k = color.getHex();\r\n var a = this._updateQueue[k] || [];\r\n if (drawAngled) {\r\n var dir = spt.ThreeJs.utils.ToClosestAxis(new THREE.Vector3().subVectors(vertices[1], vertices[0])).setZ(0),\r\n p3 = new THREE.Vector3();\r\n\r\n //p2 -- p3 -- p1\r\n for (let i = 1, l = vertices.length - 1; i <= l; i++) {\r\n\r\n var i2 = i - 1,\r\n p1 = vertices[i],\r\n p2 = vertices[i2];\r\n\r\n p3.subVectors(p1, p2);\r\n\r\n if (Math.abs(p3.x) < 0.00001 || Math.abs(p3.y) < 0.00001) {\r\n a.push(p2);\r\n a.push(p1);\r\n\r\n spt.ThreeJs.utils.ToClosestAxis(dir.subVectors(p1, p2)).setZ(0);\r\n } else {\r\n var dt = dir.dot(p3);\r\n if (dt < 0) {\r\n dir.set(-dir.y, dir.x, dir.z);\r\n dt = dir.dot(p3);\r\n }\r\n var pt = p3.copy(dir).multiplyScalar(dt).add(p2).clone();\r\n\r\n a.push(p2);\r\n a.push(pt);\r\n a.push(pt);\r\n a.push(p1);\r\n\r\n spt.ThreeJs.utils.ToClosestAxis(dir.subVectors(p1, p3)).setZ(0);\r\n }\r\n }\r\n } else {\r\n for (var i = 1, l = vertices.length; i < l; i++) {\r\n a.push(vertices[i - 1]);\r\n a.push(vertices[i]);\r\n }\r\n }\r\n\r\n this._updateQueue[k] = a;\r\n this._needsUpdate = true;\r\n }\r\n }\r\n\r\n export function uncompressClientObectDataArrays(dataArray: SolarProTool.IClientObectDataArrays, compressedIdentifier = \"_Compressed\") {\r\n if (!dataArray || !compressedIdentifier)\r\n return;\r\n\r\n Object.keys(dataArray).forEach(key => {\r\n if (key !== compressedIdentifier && key.indexOf(compressedIdentifier) !== -1) {\r\n if (dataArray[key]) {\r\n var data = LZString.decompressFromEncodedURIComponent(dataArray[key]);\r\n dataArray[key.substr(0, key.length - compressedIdentifier.length)] = JSON.parse(data);\r\n }\r\n delete dataArray[key];\r\n }\r\n });\r\n }\r\n\r\n export function IterateClientObectDataArrays(dataArray: SolarProTool.IClientObectDataArrays, fn: (d: IInstanceData) => void, count?: number) {\r\n\r\n uncompressClientObectDataArrays(dataArray);\r\n\r\n if (!dataArray || !dataArray.Id || !dataArray.Id.length)\r\n return;\r\n\r\n if (!count)\r\n count = dataArray.Id.length;\r\n\r\n var datakeys = Object.keys(dataArray).filter((key) => dataArray[key] && (dataArray[key]).length === count),\r\n datakeysLength = datakeys.length;\r\n\r\n ArrayHelper.iterateTimes(count, (idx) => {\r\n var keys = datakeys, keysLength = datakeysLength, genericData = dataArray, data: IInstanceData = {} as any;\r\n for (var j = keysLength; j--;) {\r\n var key = keys[j];\r\n data[key] = genericData[key][idx];\r\n }\r\n fn(data);\r\n });\r\n }\r\n}\r\n\r\nTHREE.DashedLineMaterial = LS.Client3DEditor.DashedLineMaterial;\r\nTHREE.DefaultAppearanceShader = LS.Client3DEditor.DefaultAppearanceShader;\r\nTHREE.ModuleAppearanceShader = LS.Client3DEditor.ModuleAppearanceShader;\r\nTHREE.BaseInstancedShader = LS.Client3DEditor.BaseInstancedShader;\r\n\r\n//module THREE {\r\n// export var DashedLineMaterial: typeof LS.Client3DEditor.DashedLineMaterial = LS.Client3DEditor.DashedLineMaterial;\r\n// export var DefaultAppearanceShader: typeof LS.Client3DEditor.DefaultAppearanceShader = LS.Client3DEditor.DefaultAppearanceShader;\r\n// export var ModuleAppearanceShader: typeof LS.Client3DEditor.ModuleAppearanceShader = LS.Client3DEditor.ModuleAppearanceShader;\r\n// export var BaseInstancedShader: typeof LS.Client3DEditor.BaseInstancedShader = LS.Client3DEditor.BaseInstancedShader;\r\n//}","module LS.Client3DEditor {\r\n\r\n function onBeforeMouseDown() {\r\n var viewModel = this as ViewModel,\r\n controller = Controller.Current;\r\n if (!controller) return;\r\n var mouse = viewModel.mouse;\r\n if (controller.controlHelper.handleMouseDown(mouse, controller.controls, controller))\r\n viewModel.cancelMouseDown = true;\r\n }\r\n\r\n function onMouseDown() {\r\n var viewModel = this as ViewModel,\r\n controller = Controller.Current,\r\n instanceContext = viewModel.currentInstance;\r\n if (!controller) return;\r\n var raycaster = controller.worldRaycaster,\r\n objectHolders = controller.objectHolders;\r\n\r\n if (viewModel.canSelect) {\r\n var intersections = instanceContext.getInstanceIntersections(raycaster);\r\n if (intersections.length > 0 && (viewModel.EditorViewMode !== \"Electric\" || !objectHolders.some(o => !!o.hoverObject))) {\r\n var instance = intersections[0];\r\n var instanceInSelection = viewModel.selected.some((s) => { return instance.id === s.id; });\r\n if (viewModel.shiftDown) {\r\n if (!instanceInSelection && viewModel.selected.length === 1) {\r\n //select from last selected to current\r\n var lastSelected = viewModel.selected[0];\r\n var lastbb = lastSelected.geometry.boundingBox.clone().translate(lastSelected.position);\r\n var currbb = instance.geometry.boundingBox.clone().translate(instance.position);\r\n var searchbox = lastbb.union(currbb);\r\n var searchCenter = searchbox.getCenter(new THREE.Vector3());\r\n var searchDelta = searchbox.getSize(new THREE.Vector3()).multiplyScalar(0.5);\r\n searchDelta.setX(Math.max(1, Math.abs(searchDelta.x) - 10)).setY(Math.max(1, Math.abs(searchDelta.y) - 10));\r\n searchbox.set(searchCenter.clone().sub(searchDelta), searchCenter.clone().add(searchDelta));\r\n var selected = instanceContext.getBoxIntersections(searchbox) as ClientObjectInstance[];\r\n viewModel.selectedUi.removeAll();\r\n viewModel.addToSelection(selected);\r\n viewModel.canSelect = false;\r\n return;\r\n }\r\n if (viewModel.ctrlDown && instanceInSelection) {\r\n //special case\r\n viewModel.canSelect = false;\r\n return;\r\n }\r\n //select now (instead on onMouseUp)\r\n viewModel.selectedUi.removeAll();\r\n viewModel.addToSelection([instance]);\r\n viewModel.canSelect = false;\r\n return;\r\n } else if (!instanceInSelection) {\r\n //select now (instead on onMouseUp)\r\n viewModel.selectedUi.removeAll();\r\n viewModel.addToSelection([instance]);\r\n viewModel.canSelect = false;\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n\r\n function onMouseUp() {\r\n var viewModel = this as ViewModel,\r\n controller = Controller.Current,\r\n instanceContext = viewModel.currentInstance;\r\n if (!controller) return;\r\n\r\n var raycaster = controller.worldRaycaster;\r\n\r\n if (viewModel.isDragging) {\r\n viewModel.ApplyDiffSnapPosition();\r\n return;\r\n }\r\n\r\n if (viewModel.isScaling) {\r\n viewModel.ApplyDiffScalePosition();\r\n return;\r\n }\r\n\r\n if (viewModel.isSelecting) {\r\n var selectionHelper = controller.selectionHelper,\r\n uicamera = controller.uicamera;\r\n selectionHelper.visible = false;\r\n\r\n var x1 = selectionHelper.corner1.x / uicamera.right,\r\n y1 = selectionHelper.corner1.y / uicamera.top,\r\n x2 = selectionHelper.corner2.x / uicamera.right,\r\n y2 = selectionHelper.corner2.y / uicamera.top;\r\n\r\n var viewBox = new THREE.Box2(new THREE.Vector2(Math.min(x1, x2), Math.min(y1, y2)), new THREE.Vector2(Math.max(x1, x2), Math.max(y1, y2)));\r\n\r\n selectByBox(viewBox, raycaster);\r\n\r\n return;\r\n }\r\n\r\n if (viewModel.canSelect) {\r\n var intersections: LS.Client3DEditor.ClientObjectInstance[] = viewModel.EditorViewMode === \"Electric\" ? [] : instanceContext.getInstanceIntersections(controller.worldRaycaster);\r\n if (intersections.length > 0) {\r\n viewModel.selectedUi.removeAll();\r\n viewModel.addToSelection([intersections[0]]);\r\n } else {\r\n viewModel.addToSelection([]);\r\n\r\n var linesHelper = controller.linesHelper,\r\n measureObjectHolder = controller.measureObjectHolder,\r\n directedAreaHolder = controller.directedAreaHolder,\r\n interferenceHelper = controller.interferenceHelper,\r\n objectHolders = controller.objectHolders;\r\n\r\n if (viewModel.selected.length === 0) {\r\n if (linesHelper.hoverLine) {\r\n //helper lines\r\n viewModel.addToSelection([linesHelper.hoverLine], false, false, viewModel.selectedUi);\r\n } else if (directedAreaHolder.hoverAreaObj) {\r\n //directedArea\r\n viewModel.addToSelection([directedAreaHolder.hoverAreaObj], false, false, viewModel.selectedUi);\r\n } else if (measureObjectHolder.hoverDimObj) {\r\n //MeasureObject\r\n viewModel.addToSelection([measureObjectHolder.hoverDimObj], false, false, viewModel.selectedUi);\r\n } else if (viewModel.selectInterferencesEnabled && interferenceHelper.hoverObject) {\r\n //StringObjectInstance\r\n viewModel.addToSelection([interferenceHelper.hoverObject], false, false, viewModel.selectedUi);\r\n } else {\r\n var objHolder = objectHolders.find(o => !!o.hoverObject);\r\n\r\n if (objHolder) {\r\n //generic object holders\r\n viewModel.addToSelection([objHolder.hoverObject], false, false, viewModel.selectedUi);\r\n\r\n if (LS.Electric.InvertersModel && controller.stringObjectHolder === objHolder) {\r\n var mso = LS.Electric.InvertersModel.getModulesStringObject(objHolder.hoverObject.IdString);\r\n if (mso)\r\n LS.Electric.InvertersModel.doSelectString(mso.Id);\r\n }\r\n } else {\r\n if (intersections.length > 0) {\r\n viewModel.selectedUi.removeAll();\r\n viewModel.addToSelection([intersections[0]]);\r\n } else\r\n viewModel.addToSelection([], false, false, viewModel.selectedUi);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n function beforeMouseMove() {\r\n var viewModel = this as ViewModel,\r\n instanceContext = viewModel.currentInstance,\r\n raycaster = Controller.Current.worldRaycaster;\r\n\r\n if (viewModel.disableMouseMove) return;\r\n\r\n instanceContext.getLocalPosition(raycaster.ray, instanceContext.roofPosition);\r\n\r\n //var roofPos = instanceContext.getLocalPosition(raycaster.ray);\r\n //if (roofPos)\r\n // instanceContext.roofPosition.copy(roofPos);\r\n }\r\n\r\n function onMouseMove() {\r\n var viewModel = this as ViewModel,\r\n controller = Controller.Current,\r\n instanceContext = viewModel.currentInstance,\r\n mouse = viewModel.mouse;\r\n\r\n viewModel.highlightedInstance = null;\r\n\r\n controller.controlHelper.onMouseMove(mouse);\r\n\r\n if (viewModel.disableMouseMove) return;\r\n\r\n //var roofPos = instanceContext.getLocalPosition(raycaster.ray);\r\n //if (roofPos)\r\n // instanceContext.roofPosition.copy(roofPos);\r\n\r\n if (viewModel.isDragging || viewModel.isScaling) {\r\n //dragging or scaling\r\n viewModel.updateSelected();\r\n return;\r\n } else if (viewModel.isSelecting) {\r\n //RECT SELECTING\r\n //controller.selectionHelper.setCorner2(viewModel.roofPosition);\r\n controller.selectionHelper.setCorner2XY(viewModel.viewPosition.x + controller.uicamera.left, controller.uicamera.top - viewModel.viewPosition.y);\r\n return;\r\n }\r\n\r\n //MOUSE HOVER\r\n if (!viewModel.selectedTool && !viewModel.mouseDown) {\r\n\r\n var worldRaycaster = controller.worldRaycaster,\r\n localRaycaster = controller.localRaycaster,\r\n linesHelper = controller.linesHelper,\r\n measureObjectHolder = controller.measureObjectHolder,\r\n directedAreaHolder = controller.directedAreaHolder,\r\n interferenceHelper = controller.interferenceHelper,\r\n objectHolders = controller.objectHolders;\r\n\r\n linesHelper.setHoverLine(null);\r\n directedAreaHolder.setHoverAreaObj(null);\r\n measureObjectHolder.setHoverDimObj(null);\r\n interferenceHelper.setHoverObject(null);\r\n objectHolders.forEach(o => o.setHoverObject(null));\r\n\r\n var intersections: LS.Client3DEditor.ClientObjectInstance[] = viewModel.EditorViewMode === \"Electric\" ? [] : instanceContext.getInstanceIntersections(worldRaycaster);\r\n\r\n if (intersections.length > 0) {\r\n setBoxhelper(intersections[0]);\r\n } else {\r\n setBoxhelper(null);\r\n\r\n var precision = controller.linePrecision,\r\n found = false;\r\n\r\n //Helperlines\r\n var hl = linesHelper.GetByPoint(instanceContext.roofPosition, precision);\r\n if (hl) {\r\n linesHelper.setHoverLine(hl);\r\n found = true;\r\n }\r\n\r\n if (!found) {\r\n var da = directedAreaHolder.getByRaycaster(localRaycaster, precision);\r\n if (da) {\r\n //directed area\r\n directedAreaHolder.setHoverAreaObj(da);\r\n found = true;\r\n }\r\n }\r\n\r\n if (!found) {\r\n var mo = measureObjectHolder.getByRaycaster(localRaycaster, precision);\r\n if (mo) {\r\n //MeasureObject\r\n measureObjectHolder.setHoverDimObj(mo);\r\n found = true;\r\n }\r\n }\r\n\r\n if (!found) {\r\n //interferences\r\n var io = viewModel.selectInterferencesEnabled ? interferenceHelper.getByRaycaster(worldRaycaster) : null;\r\n if (io) {\r\n interferenceHelper.setHoverObject(io);\r\n found = true;\r\n }\r\n }\r\n\r\n if (!found) {\r\n //objectholders\r\n var obj: IObjectIntersection;\r\n var o = objectHolders.find(o => !!(obj = o.getByRaycaster(localRaycaster, precision)));\r\n if (obj) {\r\n o.setHoverObject(obj);\r\n found = true;\r\n }\r\n }\r\n\r\n if (!found && viewModel.EditorViewMode === \"Electric\") {\r\n intersections = instanceContext.getInstanceIntersections(worldRaycaster);\r\n\r\n if (intersections.length > 0) {\r\n setBoxhelper(intersections[0]);\r\n }\r\n }\r\n\r\n if (!found && viewModel.instances.length > 1 && viewModel.EditorViewMode === \"Anordnung\") {\r\n //highlight another roofarea\r\n var instanceContext = viewModel.findInstanceContext(worldRaycaster.ray, null, 5);\r\n if (instanceContext && instanceContext !== viewModel.currentInstance)\r\n viewModel.highlightedInstance = instanceContext;\r\n }\r\n }\r\n }\r\n }\r\n\r\n function onKeyDown() {\r\n var viewModel = this as ViewModel,\r\n controller = Controller.Current;\r\n if (viewModel.isSelecting || viewModel.isDragging)\r\n return;\r\n\r\n if (viewModel.ctrlDown) {\r\n if (viewModel.keyPressed(90)) //strg + z\r\n controller.doUndo();\r\n else if (viewModel.keyPressed(89)) //strg + y\r\n controller.doRedo();\r\n else if (viewModel.keyPressed(68)) //strg + d\r\n controller.doDuplicate();\r\n } else {\r\n if (viewModel.keyPressed([37, 38, 39, 40])) {//Left, Up, Right, Down\r\n var l = viewModel.keyPressed(37) ? -1 : 0;\r\n var u = viewModel.keyPressed(38) ? 1 : 0;\r\n var r = viewModel.keyPressed(39) ? 1 : 0;\r\n var d = viewModel.keyPressed(40) ? -1 : 0;\r\n var steps = viewModel.keyBoardSteps.internalValue;\r\n controller.moveSelectedStatic(steps * l + steps * r, steps * u + steps * d, 0);\r\n }\r\n //else if (viewModel.keyPressed(68)) //d\r\n // controller.switchActiveStates();\r\n else if (viewModel.keyPressed(46)) //del\r\n controller.deleteSelected();\r\n else if (viewModel.keyPressed(72) && viewModel.selectedToolUri !== \"dimensionLines\") //h\r\n controller.switchTransparenceAll();\r\n else if (viewModel.keyPressed(65)) //a\r\n controller.selectAll();\r\n else if (viewModel.keyPressed(67)) //c\r\n controller.switchCamera();\r\n else if (viewModel.keyPressed(82)) //r\r\n controller.startRotate();\r\n else if (viewModel.keyPressed(77)) //m\r\n viewModel.snappingDeactivatedClick();\r\n else if (viewModel.keyPressed(76) && window.EditorViewMode === \"Anordnung\") //l\r\n Controller.Current.reloadModulePlan(true, null, \"ShowAnlagen\");\r\n else if (viewModel.keyPressed(78)) //n\r\n controller.regenerateModulePlan(false);\r\n //else if (window.currLogin === \"janh\" && viewModel.keyPressed(74)) //j\r\n // viewModel.EnableMultiEdit = !viewModel.EnableMultiEdit;\r\n else if (viewModel.keyPressed(80)) //p\r\n controller.switchVisibleStates();\r\n }\r\n }\r\n\r\n function onKeyUp() {\r\n //var viewModel = this as ViewModel;\r\n }\r\n\r\n function onDblclick() {\r\n Controller.Current.onDblclick();\r\n }\r\n\r\n function onStartDrag() {\r\n var viewModel = this as ViewModel,\r\n controller = Controller.Current,\r\n instanceContext = viewModel.currentInstance;\r\n if (!controller) return;\r\n var boxHelper = controller.boxHelper;\r\n\r\n if (boxHelper.visible)\r\n setBoxhelper(null);\r\n\r\n if (viewModel.isSelecting || viewModel.isDragging || viewModel.isScaling) return;\r\n\r\n var worldRaycaster = controller.getWorldRaycaster(null, viewModel.startMouse);\r\n\r\n var intersections = instanceContext.getInstanceIntersections(worldRaycaster, Client3DObectOptions.CanSelectInstances | Client3DObectOptions.CanMoveInstances | Client3DObectOptions.CanBeScaledX | Client3DObectOptions.CanBeScaledY);\r\n if (intersections.length > 0 && !viewModel.shiftDown) {\r\n var edgeInter = setScalehelper(intersections[0], controller.getLocalRaycaster(worldRaycaster));\r\n if (edgeInter) {\r\n var isHorizontal = Math.abs(edgeInter.direction.x) > Math.abs(edgeInter.direction.y);\r\n viewModel.isScaling = true;\r\n viewModel.scaleHelperObject = edgeInter;\r\n viewModel.filterSelection(o => isHorizontal ? o.clientObject.canBeScaledX : o.clientObject.canBeScaledY);\r\n } else {\r\n viewModel.isDragging = true;\r\n viewModel.filterSelection(o => o.clientObject.canMoveInstances);\r\n }\r\n controller.edgeHighlightHelper.visible = false;\r\n } else {\r\n var directedAreaHolder = controller.directedAreaHolder;\r\n if (directedAreaHolder.hoverAreaObj && !viewModel.shiftDown) {\r\n if (!directedAreaHolder.hoverAreaObj.isSelected)\r\n viewModel.addToSelection([directedAreaHolder.hoverAreaObj], false, false, viewModel.selectedUi);\r\n viewModel.isDragging = true;\r\n } else {\r\n var interferenceHelper = controller.interferenceHelper;\r\n\r\n if (viewModel.selectInterferencesEnabled && interferenceHelper.hoverObject && interferenceHelper.hoverObject.isSelected && !viewModel.shiftDown) {\r\n if (!interferenceHelper.hoverObject.isSelected)\r\n viewModel.addToSelection([interferenceHelper.hoverObject], false, false, viewModel.selectedUi);\r\n viewModel.isDragging = true;\r\n } else {\r\n\r\n var objectHolder = !viewModel.shiftDown && controller.objectHolders.find(o => o.hoverObject && o.hoverObject.isSelected);\r\n if (objectHolder) {\r\n viewModel.isDragging = true;\r\n } else {\r\n var selectionHelper = controller.selectionHelper;\r\n //selectionHelper.setCorner1(viewModel.startRoofPosition);\r\n selectionHelper.setCorner1XY(viewModel.startViewPosition.x + controller.uicamera.left, controller.uicamera.top - viewModel.startViewPosition.y);\r\n selectionHelper.visible = true;\r\n viewModel.isSelecting = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n function selectByBox(viewBox: THREE.Box2, raycaster: THREE.Raycaster) {\r\n var controller = Controller.Current,\r\n viewModel = controller.viewModel,\r\n testVolume = controller.testVolume,\r\n instanceContext = viewModel.currentInstance;\r\n\r\n testVolume.calculate(raycaster, controller.camera, viewBox);\r\n\r\n var selected: ClientObjectInstance[];\r\n var selectedUi: ISelectableUi[] = [];\r\n\r\n if (viewModel.EditorViewMode === \"Electric\") {\r\n\r\n var objectHolders = controller.objectHolders,\r\n objHolder = objectHolders.find(o => {\r\n var selUi = o.getByTestVolume(testVolume);\r\n if (selUi && selUi.length) {\r\n selectedUi = selUi;\r\n return true;\r\n }\r\n return false;\r\n });\r\n\r\n viewModel.addToSelection(selectedUi, false, false, viewModel.selectedUi);\r\n\r\n if (!selectedUi || !selectedUi.length) {\r\n viewModel.selectedUi.removeAll();\r\n\r\n selected = orderObjectsForElectric((instanceContext.getIntersectionsByViewVolume(testVolume) as ClientObjectInstance[]).filter(ci => ci.clientObject.canSelectInstances));\r\n\r\n viewModel.addToSelection(selected);\r\n\r\n if (selected && selected.length)\r\n viewModel.selectedUi.removeAll();\r\n } else\r\n viewModel.selected.removeAll();\r\n\r\n return;\r\n }\r\n\r\n selected = (instanceContext.getIntersectionsByViewVolume(testVolume) as ClientObjectInstance[]).filter(ci => ci.clientObject.canSelectInstances);\r\n\r\n viewModel.addToSelection(selected);\r\n\r\n if (!selected || !selected.length) {\r\n\r\n if (controller.directedAreaHolder.children.length) {\r\n //viewModel.addToSelection(controller.directedAreaHolder.getByBox(box), false, false, viewModel.selectedUi);\r\n selectedUi = controller.directedAreaHolder.getByTestVolume(testVolume);\r\n viewModel.addToSelection(selectedUi, false, false, viewModel.selectedUi);\r\n }\r\n if (!selectedUi || !selectedUi.length) {\r\n var objectHolders = controller.objectHolders,\r\n objHolder = objectHolders.find(o => {\r\n var selUi = o.getByTestVolume(testVolume);\r\n if (selUi && selUi.length) {\r\n selectedUi = selUi;\r\n return true;\r\n }\r\n return false;\r\n });\r\n viewModel.addToSelection(selectedUi, false, false, viewModel.selectedUi);\r\n }\r\n if (viewModel.selectInterferencesEnabled && (!selectedUi || !selectedUi.length)) {\r\n viewModel.addToSelection(controller.interferenceHelper.getByTestVolume(testVolume), false, false, viewModel.selectedUi);\r\n }\r\n }\r\n else\r\n viewModel.selectedUi.removeAll();\r\n }\r\n\r\n function orderObjectsForElectric(selected: ClientObjectInstance[], orderHorizontal?: boolean) {\r\n if (selected && selected.length > 1) {\r\n var result: ClientObjectInstance[] = [],\r\n bucket: any = {},\r\n order = 1;\r\n\r\n if (orderHorizontal) {\r\n selected.forEach(o => {\r\n var y = Math.round(o.position.y);\r\n if (!bucket[y])\r\n bucket[y] = [o];\r\n else\r\n bucket[y].push(o);\r\n });\r\n\r\n Object.keys(bucket).forEach(k => {\r\n var l = bucket[k];\r\n if (l.length > 1)\r\n l.sort((a, b) => (a.position.x - b.position.x) * order);\r\n result.splice.apply(result, [result.length, 0].concat(l));\r\n order *= -1;\r\n });\r\n } else {\r\n selected.forEach(o => {\r\n var x = Math.round(o.position.x);\r\n if (!bucket[x])\r\n bucket[x] = [o];\r\n else\r\n bucket[x].push(o);\r\n });\r\n\r\n Object.keys(bucket).forEach(k => {\r\n var l = bucket[k];\r\n if (l.length > 1)\r\n l.sort((a, b) => (a.position.y - b.position.y) * order);\r\n result.splice.apply(result, [result.length, 0].concat(l));\r\n order *= -1;\r\n });\r\n }\r\n\r\n return result;\r\n }\r\n return selected;\r\n }\r\n\r\n export function mapInputsFromViewmodel(viewModel: LS.Client3DEditor.ViewModel) {\r\n viewModel.addListener('beforeMouseMove', beforeMouseMove);\r\n viewModel.addListener('mouseMove', onMouseMove);\r\n viewModel.addListener('mouseDown', onMouseDown);\r\n viewModel.addListener('beforeMouseDown', onBeforeMouseDown);\r\n viewModel.addListener('mouseUp', onMouseUp);\r\n viewModel.addListener('startDrag', onStartDrag);\r\n viewModel.addListener('keyDown', onKeyDown);\r\n viewModel.addListener('keyUp', onKeyUp);\r\n viewModel.addListener('dblclick', onDblclick);\r\n }\r\n}","module LS.Client3DEditor {\r\n import DegreeEnum = HeatMap.DegreeEnum;\r\n\r\n export class InstanceHolderConfiguration implements SolarProTool.IInstanceHolderConfiguration {\r\n PvModuleId: string = null;\r\n InstanceHolderType: string = null;\r\n MountingSystemType: string = null;\r\n MountingSystemId: string = null;\r\n IsElevation = false;\r\n IsEastWest = false;\r\n\r\n copy(config: SolarProTool.IInstanceHolderConfiguration): this {\r\n if (config) {\r\n this.PvModuleId = config.PvModuleId || null;\r\n this.InstanceHolderType = config.InstanceHolderType || null;\r\n this.MountingSystemType = config.MountingSystemType || null;\r\n this.MountingSystemId = config.MountingSystemId || null;\r\n this.IsElevation = !!config.IsElevation;\r\n this.IsEastWest = !!config.IsEastWest;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n equals(other: SolarProTool.IInstanceHolderConfiguration): boolean {\r\n if (!other)\r\n return false;\r\n\r\n return Object.keys(this).every(k => this[k] === other[k]);\r\n }\r\n }\r\n\r\n export class InstanceContext {\r\n public static idKey = \"InstanceId\";\r\n\r\n get Id(): string {\r\n return this.root.userData[InstanceContext.idKey];\r\n }\r\n\r\n set Id(v: string) {\r\n this.root.userData[InstanceContext.idKey] = v;\r\n }\r\n\r\n RoofAreaStartX = \"\";\r\n RoofAreaStartY = \"\";\r\n RoofAreaDistanceToRoofBorder = \"\";\r\n RoofOrientation = 180; //instanceHolder.Orientation - instanceHolder.LayoutOrientation\r\n IsElevation = true;\r\n ProcessStep = 0;\r\n\r\n //startRoofPosition --> roofPosition\r\n readonly diffRoofPosition: ReadonlyVector3Property;\r\n //diffRoofPosition after snapping\r\n readonly diffSnapPosition: THREE.Vector3;\r\n //current mouse position on roof\r\n readonly roofPosition = new ObservableVector3();\r\n\r\n readonly diffScale: THREE.Vector3;\r\n readonly diffScalePosition: THREE.Vector3;\r\n\r\n LayoutOrientationMoveToZero = new THREE.Vector3();\r\n\r\n getLayoutOrientationTransform(m?: THREE.Matrix4): THREE.Matrix4 {\r\n if (!m)\r\n m = new THREE.Matrix4();\r\n if (this.LayoutOrientation !== 0) {\r\n var translate = this.LayoutOrientationMoveToZero;\r\n //Transformation4D.RotateZ(-LayoutOrientationRad) * Transformation4D.Translation(-LayoutOrientationMoveToZero)\r\n return m.makeRotationZ(-this.LayoutOrientationRad).multiply(new THREE.Matrix4().makeTranslation(-translate.x, -translate.y, -translate.z));\r\n }\r\n return m.identity();\r\n }\r\n\r\n getLayoutOrientationReverseTransform(m?: THREE.Matrix4): THREE.Matrix4 {\r\n if (!m)\r\n m = new THREE.Matrix4();\r\n if (this.LayoutOrientation !== 0) {\r\n var translate = this.LayoutOrientationMoveToZero;\r\n //Transformation4D.Translation(LayoutOrientationMoveToZero) * Transformation4D.RotateZ(LayoutOrientationRad)\r\n return m.makeTranslation(translate.x, translate.y, translate.z).multiply(new THREE.Matrix4().makeRotationZ(this.LayoutOrientationRad));\r\n }\r\n\r\n return m.identity();\r\n }\r\n\r\n readonly insertableClientObjects: ClientObject[] = [];\r\n readonly scaleInsertableClientObjects: ClientObject[] = [];\r\n selectedInsertable: ClientObject = null;\r\n ModuleNominalPower = 0;\r\n currentRoofLayers: string[] = [];\r\n\r\n ModuleCellColor = '0b1b3c';\r\n ModuleFrameColor = 'b5b5b5';\r\n ModuleBacksheetColor = 'e5e5e5';\r\n ModuleCellType: ModuleCellType = ModuleCellType.Monocrystalline;\r\n ModuleCellcols = 6;\r\n ModuleCellrows = 10;\r\n ModuleFrameWidth = 20;\r\n\r\n instancePolygons: THREE.Vector3[][] = [[]]; //RoofPolygons\r\n instanceAreaPolygons: THREE.Vector3[][] = [[]]; //RoofPolygons\r\n HasShadows = false;\r\n GlobalOrientationRadian = 0;\r\n Orientation = 180; //instanceHolder.Orientation\r\n LayoutOrientation = 0;\r\n Angle = 0; //RoofAngle\r\n Bounds = new THREE.Box3();\r\n Width = 0;\r\n Height = 0;\r\n GroundZ = 0;\r\n LatLngPolygon: MapDrawing.LatLng[] = [];\r\n WorldOrigin: MapDrawing.LatLng;\r\n RoofBackgroundType = 0;\r\n HasMapsBackground = false;\r\n InstanceHolderConfiguration = new InstanceHolderConfiguration();\r\n FixationType: string = null;\r\n ElevationType: string = null;\r\n heatmap: HeatmapHelper = null;\r\n isActive = true;\r\n boxHelper: THREE.BoxHelper;\r\n selectionHelper: SelectionHelper;\r\n\r\n get LayoutOrientationRad(): number {\r\n return this.LayoutOrientation / 180 * Math.PI;\r\n }\r\n\r\n set LayoutOrientationRad(v: number) {\r\n this.LayoutOrientation = v / Math.PI * 180;\r\n }\r\n\r\n get AngleRad(): number {\r\n return this.Angle / 180 * Math.PI;\r\n }\r\n\r\n set AngleRad(v: number) {\r\n this.Angle = v / Math.PI * 180;\r\n }\r\n\r\n get AngleQuat(): THREE.Quaternion {\r\n return new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0).applyMatrix4(new THREE.Matrix4().makeRotationZ(-this.LayoutOrientationRad)), this.AngleRad);\r\n }\r\n\r\n root: THREE.Object3D = new THREE.Object3D();\r\n surfacePolygons: { plane: THREE.Vector4, polygons: ClipperLib.Paths }[] = [];\r\n instanceObject: THREE.Object3D = null;\r\n instanceMaterials: { material: {color: THREE.Color, needsUpdate: boolean}, defaultColor: THREE.Color }[] = [];\r\n instanceContainer: THREE.Object3D;\r\n readonly worldToLocalTransform: THREE.Matrix4;\r\n readonly localToWorldTransform: THREE.Matrix4;\r\n private readonly octree: spt.ThreeJs.utils.Octree;\r\n private readonly ray: THREE.Ray;\r\n readonly plane: THREE.Plane;\r\n readonly worldPlane: THREE.Plane;\r\n private readonly testVolume: spt.ThreeJs.utils.TestVolume;\r\n readonly segmentHighlightHelper: SegmentHighlightHelper;\r\n readonly edgeHighlightHelper: SegmentHighlightHelper;\r\n readonly segmentsHelper: SegmentsHelper;\r\n readonly linesHelper: LinesHelper;\r\n readonly measureObjectHolder: MeasureObjectHolder;\r\n readonly directedAreaHolder: DirectedAreaHolder;\r\n readonly stringObjectHolder: StringObjectHolder;\r\n readonly conduitObjectHolder: ConduitObjectHolder;\r\n readonly objectHolders: GenericObjectHolder[] = [];\r\n readonly pointingHelper: PointingHelper;\r\n readonly measureVisualizer: MeasureVisualizer;\r\n readonly lineSegmentsHelper: LineSegmentsHelper;\r\n private _highlighted: boolean = false;\r\n highlighted: boolean;\r\n readonly isCurrentActive: boolean;\r\n\r\n constructor(id: string, controller?: Controller) {\r\n\r\n this.Id = id;\r\n\r\n ko.track(this);\r\n\r\n if (!controller)\r\n controller = Controller.Current;\r\n\r\n var viewModel = controller ? controller.viewModel : null;\r\n\r\n ([\"ModuleCellColor\", \"ModuleFrameColor\", \"ModuleBacksheetColor\", \"ModuleCellType\", \"ModuleCellcols\", \"ModuleCellrows\", \"ModuleFrameWidth\"] as (keyof InstanceContext)[]).forEach(k => {\r\n ko.getObservable(this, k).subscribe(() => {\r\n this.updateModuleAppearance();\r\n });\r\n });\r\n\r\n ko.defineProperty(this, 'isCurrentActive', () => {\r\n return viewModel && viewModel.currentInstance === this;\r\n });\r\n\r\n ko.defineProperty(this, 'highlighted',\r\n {\r\n get: () => {\r\n return this._highlighted || (viewModel && viewModel.currentInstance === this);\r\n },\r\n set: (v) => {\r\n this._highlighted = v;\r\n }\r\n });\r\n\r\n ko.getObservable(this, \"highlighted\").subscribe(this.onHighlightingChanged.bind(this));\r\n \r\n this.ray = new THREE.Ray();\r\n this.plane = new THREE.Plane().setComponents(0, 0, 1, 0);\r\n this.worldPlane = new THREE.Plane().setComponents(0, 0, 1, 0);\r\n this.testVolume = new spt.ThreeJs.utils.TestVolume();\r\n\r\n var instanceContainer = this.instanceContainer = new THREE.Object3D(),\r\n objectHolders = this.objectHolders;\r\n\r\n //OCTREE\r\n var octree = this.octree = new spt.ThreeJs.utils.Octree({\r\n //scene: instanceContainer,\r\n undeferred: false,\r\n depthMax: Infinity,\r\n objectsThreshold: 8,\r\n overlapPct: 0.15\r\n });\r\n octree._needsRebuild = false;\r\n\r\n this.worldToLocalTransform = new THREE.Matrix4();\r\n this.localToWorldTransform = new THREE.Matrix4();\r\n\r\n this.root.add(instanceContainer);\r\n\r\n //Boxhelper\r\n var boxHelper = this.boxHelper = new THREE.BoxHelper();\r\n if((boxHelper.geometry as any).setUsage)\r\n (boxHelper.geometry as any).setUsage(THREE.DynamicDrawUsage);\r\n boxHelper.visible = false;\r\n instanceContainer.add(boxHelper);\r\n\r\n //selection helper\r\n instanceContainer.add(this.selectionHelper = new SelectionHelper());\r\n\r\n //pointing helper\r\n instanceContainer.add(this.pointingHelper = new PointingHelper());\r\n\r\n //segment highlight helper\r\n instanceContainer.add(this.segmentHighlightHelper = new SegmentHighlightHelper());\r\n\r\n //edge highlight helper\r\n instanceContainer.add(this.edgeHighlightHelper = new SegmentHighlightHelper());\r\n\r\n //segment helper\r\n var segmentsHelper = this.segmentsHelper = new SegmentsHelper();\r\n instanceContainer.add(segmentsHelper);\r\n\r\n //lines helper\r\n var linesHelper = this.linesHelper = new LinesHelper();\r\n instanceContainer.add(linesHelper);\r\n\r\n //measure objects\r\n instanceContainer.add(this.measureObjectHolder = new MeasureObjectHolder());\r\n\r\n //string objects\r\n var stringObjectHolder = this.stringObjectHolder = new StringObjectHolder();\r\n instanceContainer.add(stringObjectHolder);\r\n objectHolders.push(stringObjectHolder);\r\n\r\n //conduit objects\r\n var conduitObjectHolder = this.conduitObjectHolder = new ConduitObjectHolder();\r\n instanceContainer.add(conduitObjectHolder);\r\n objectHolders.push(conduitObjectHolder);\r\n\r\n //directed Areas\r\n var directedAreaHolder = this.directedAreaHolder = new DirectedAreaHolder();\r\n instanceContainer.add(directedAreaHolder);\r\n\r\n //Measure Visualizer\r\n var measureVisualizer = this.measureVisualizer = new MeasureVisualizer();\r\n measureVisualizer.position.z = 10;\r\n instanceContainer.add(measureVisualizer);\r\n\r\n //LineSegments Helper\r\n instanceContainer.add(this.lineSegmentsHelper = new LineSegmentsHelper());\r\n\r\n if (viewModel) {\r\n\r\n ko.getObservable(viewModel, \"currentInstance\").subscribe(this.onHighlightingChanged.bind(this));\r\n\r\n viewModel.genericParameters.addListener('applyEntry', directedAreaHolder.onGenericParameterChanges.bind(directedAreaHolder));\r\n\r\n viewModel.addListener('SnapPoint', (e: ISnapEvent) => {\r\n if (!e.snap) {\r\n var ct = Controller.Current;\r\n e.snap = linesHelper.GetSnapWithPoint(e.source as THREE.Vector3, ct.linePrecision);\r\n }\r\n });\r\n\r\n viewModel.addListener('SnapBox', (e: ISnapEvent) => {\r\n if (!e.snap) {\r\n var ct = Controller.Current;\r\n e.snap = linesHelper.GetSnapWithBox(e.source as THREE.Box3, ct.linePrecision);\r\n }\r\n });\r\n\r\n this.diffRoofPosition = new ReadonlyVector3Property((k) => {\r\n return this.roofPosition[k] - viewModel.startRoofPosition[k];\r\n });\r\n\r\n let _dbox1 = new THREE.Box3(),\r\n _dv1 = new THREE.Vector3();\r\n\r\n Object.defineProperty(this, 'diffSnapPosition', {\r\n enumerable: true, configurable: false, get: () => {\r\n _dv1.copy(this.diffRoofPosition);\r\n if (viewModel.enableSnapping && viewModel.canSnap) {\r\n var startRoofPosition = viewModel.startRoofPosition,\r\n selBounds = viewModel.selectedBounds;\r\n\r\n _dbox1.min.set(selBounds.x + _dv1.x, selBounds.y + _dv1.y, startRoofPosition.z + _dv1.z);\r\n _dbox1.max.set(_dbox1.min.x + selBounds.w, _dbox1.min.y + selBounds.h, _dbox1.min.z + selBounds.d);\r\n _dv1.add(viewModel.GetSnap(_dbox1));\r\n }\r\n return _dv1;\r\n }\r\n });\r\n\r\n let _ds = new THREE.Vector3(),\r\n _dsp = new THREE.Vector3();\r\n\r\n Object.defineProperty(this, 'diffScale', {\r\n enumerable: true, configurable: false, get: () => {\r\n var scaleHelper = viewModel.scaleHelperObject,\r\n diff = viewModel.diffSnapPosition,\r\n dir = scaleHelper.direction,\r\n w = scaleHelper.size.x,\r\n h = scaleHelper.size.y,\r\n dx = diff.x * dir.x,\r\n dy = diff.y * dir.y,\r\n nw = Math.min(1000000, Math.max(10, w + dx)),\r\n nh = Math.min(1000000, Math.max(10, h + dy));\r\n\r\n return _ds.set(nw / w, nh / h, 1);\r\n }\r\n });\r\n \r\n Object.defineProperty(this, 'diffScalePosition', {\r\n enumerable: true, configurable: false, get: () => {\r\n var scaleHelper = viewModel.scaleHelperObject,\r\n dir = scaleHelper.direction,\r\n w = scaleHelper.size.x,\r\n h = scaleHelper.size.y,\r\n sc = this.diffScale,\r\n tx = dir.x * w * (sc.x * 0.5 - 0.5),\r\n ty = dir.y * h * (sc.y * 0.5 - 0.5);\r\n\r\n return _dsp.set(tx, ty, 0);\r\n }\r\n });\r\n\r\n }\r\n\r\n }\r\n\r\n generateWorldTransform(origin: MapDrawing.LatLng, orientationRad: number, groundZ: number, layoutOrientationRad: number, layoutOrientationMoveToZero: THREE.Vector3, targetMatrix?: THREE.Matrix4) {\r\n var myGroundZ = this.GroundZ;\r\n var currentOrigin = this.WorldOrigin;\r\n var myLayoutOrientationMoveToZero = this.LayoutOrientationMoveToZero;\r\n var myLayoutOrientationRad = this.LayoutOrientationRad;\r\n var currentOrientationRad = this.GlobalOrientationRadian + myLayoutOrientationRad;\r\n var targetOrientationRad = orientationRad + layoutOrientationRad;\r\n \r\n if (!targetMatrix)\r\n targetMatrix = new THREE.Matrix4();\r\n\r\n var move0 = layoutOrientationMoveToZero.clone().negate().applyMatrix4(targetMatrix.makeRotationZ(-layoutOrientationRad));\r\n var myMove0 = myLayoutOrientationMoveToZero.clone().applyMatrix4(targetMatrix.makeRotationZ(-myLayoutOrientationRad));\r\n\r\n var worldOffset = origin.DirectionTo(currentOrigin).mul(1000);\r\n\r\n var offset = new THREE.Vector3(worldOffset.x, worldOffset.y, 0).applyMatrix4(targetMatrix.makeRotationZ(-targetOrientationRad)).sub(move0).setZ(groundZ - myGroundZ);\r\n \r\n return targetMatrix.multiplyMatrices(new THREE.Matrix4().makeTranslation(offset.x, offset.y, offset.z), targetMatrix.multiplyMatrices(new THREE.Matrix4().makeRotationZ(currentOrientationRad - targetOrientationRad), targetMatrix.makeTranslation(myMove0.x, myMove0.y, myMove0.z)));\r\n\r\n }\r\n\r\n setByEditorViewObject(data: SolarProTool.IEditorViewObject, origin: MapDrawing.LatLng, orientationRad: number, groundz: number, layoutOrientationRad: number, layoutOrientationMoveToZero: THREE.Vector3, controller?: Controller): this {\r\n\r\n var dataRoofObject = data.RoofObject,\r\n linesHelper = this.linesHelper,\r\n heatmap = this.heatmap;\r\n\r\n this.Id = data.InstanceHolderId;\r\n this.RoofAreaStartX = ((data.RoofAreaStartX ? spt.Utils.ApplyNumberconstraints(convertLengthUnit(spt.Utils.ConvertStringToValue(data.RoofAreaStartX), { from: \"mm\", to: UseImperialSystem ? \"in\" : \"mm\" }), { precision: 2 }) : \"\")) as any;\r\n this.RoofAreaStartY = ((data.RoofAreaStartY ? spt.Utils.ApplyNumberconstraints(convertLengthUnit(spt.Utils.ConvertStringToValue(data.RoofAreaStartY), { from: \"mm\", to: UseImperialSystem ? \"in\" : \"mm\" }), { precision: 2 }) : \"\")) as any;\r\n this.RoofAreaDistanceToRoofBorder = ((data.RoofAreaDistanceToRoofBorder ? spt.Utils.ApplyNumberconstraints(convertLengthUnit(spt.Utils.ConvertStringToValue(data.RoofAreaDistanceToRoofBorder), { from: \"mm\", to: UseImperialSystem ? \"in\" : \"mm\" }), { precision: 2 }) : \"\")) as any;\r\n this.RoofOrientation = data.RoofOrientation || 0;\r\n this.IsElevation = !!data.IsElevation;\r\n this.ModuleNominalPower = data.ModuleNominalPower || 0;\r\n\r\n this.HasShadows = !!data.HasShadows;\r\n this.GlobalOrientationRadian = data.GlobalOrientationRadian || 0;\r\n this.GroundZ = data.GroundZ || 0;\r\n this.WorldOrigin = new MapDrawing.LatLng(data.WorldOrigin.Latitude, data.WorldOrigin.Longitude);\r\n this.Orientation = data.Orientation || 0;\r\n this.Angle = data.RoofAngle || 0;\r\n this.LayoutOrientationMoveToZero.copy(data.LayoutOrientationMoveToZero as any);\r\n this.LayoutOrientation = data.LayoutOrientation || 0;\r\n this.Bounds.set(new THREE.Vector3(data.BoundsX || 0, data.BoundsY || 0, data.BoundsZ || 0), new THREE.Vector3((data.BoundsX || 0) + (data.BoundsWidth || 0), (data.BoundsY || 0) + (data.BoundsHeight || 0), (data.BoundsZ || 0) + (data.BoundsDepth || 0)));\r\n var w = this.Width = data.RoofWidth || 0;\r\n var h = this.Height = data.RoofHeight || 0;\r\n this.LatLngPolygon = data.LatLngPolygon ? data.LatLngPolygon.map(ll => new MapDrawing.LatLng().Copy(ll)) : [];\r\n this.RoofBackgroundType = data.RoofBackgroundType || 0;\r\n this.HasMapsBackground = !!data.HasMapsBackground;\r\n this.InstanceHolderConfiguration.copy(data.InstanceHolderConfiguration);\r\n this.FixationType = data.FixationType;\r\n this.ElevationType = data.ElevationType;\r\n this.ProcessStep = data.ProcessStep || 0;\r\n this.measureVisualizer.setBounds(this.Bounds.min, this.Bounds.max);\r\n \r\n if (data.RoofPolygons) {\r\n var roofPolys: THREE.Vector3[][] = this.instancePolygons = [];\r\n data.RoofPolygons.forEach(rp => {\r\n if (rp && rp.length) {\r\n if (isNaN(rp[0] as any)) {\r\n roofPolys.push(rp.map(p => new THREE.Vector3(p.x, p.y, p.z)));\r\n } else {\r\n var poly: THREE.Vector3[] = [];\r\n for (var i = 0, l = rp.length - 1; i < l; i += 2) {\r\n var x = (rp[i]) as number,\r\n y = (rp[i + 1]) as number;\r\n poly.push(new THREE.Vector3(x, y, 0));\r\n }\r\n roofPolys.push(poly);\r\n }\r\n }\r\n });\r\n if (roofPolys.length && roofPolys[0].length)\r\n this.measureVisualizer.setOuter(roofPolys[0]);\r\n }\r\n\r\n if (data.RoofAreaPolygons) {\r\n var roofAreaPolys: THREE.Vector3[][] = this.instanceAreaPolygons = [];\r\n data.RoofAreaPolygons.forEach(rp => {\r\n if (rp && rp.length) {\r\n if (isNaN(rp[0] as any)) {\r\n roofAreaPolys.push(rp.map(p => new THREE.Vector3(p.x, p.y, p.z)));\r\n } else {\r\n var poly: THREE.Vector3[] = [];\r\n for (var i = 0, l = rp.length - 1; i < l; i += 2) {\r\n var x = (rp[i]) as number,\r\n y = (rp[i + 1]) as number;\r\n poly.push(new THREE.Vector3(x, y, 0));\r\n }\r\n roofAreaPolys.push(poly);\r\n }\r\n }\r\n });\r\n }\r\n\r\n if (data.HeatmapDataPoints && data.HeatmapDataPoints.length && this.instancePolygons && this.instancePolygons.length) {\r\n\r\n var poly = this.instancePolygons[0].map(p => new THREE.Vector2(p.x, p.y));\r\n\r\n if (!heatmap)\r\n heatmap = this.heatmap = new HeatmapHelper();\r\n\r\n heatmap.init(poly);\r\n\r\n heatmap.setData(data.HeatmapDataPoints, data.HeatMapMinValue, data.HeatMapMaxValue, data.HeatMapRadius, DegreeEnum.LINEAR);\r\n\r\n heatmap.draw();\r\n\r\n this.add(heatmap);\r\n\r\n }\r\n else if (heatmap)\r\n {\r\n this.remove(heatmap);\r\n }\r\n\r\n linesHelper.setMinMax(-w, -h, w * 2, h * 2);\r\n\r\n ArrayHelper.replaceContent(this.currentRoofLayers, data.Layers);\r\n\r\n if (this.instanceObject) {\r\n this.remove(this.instanceObject);\r\n spt.ThreeJs.utils.disposeObject3D(this.instanceObject);\r\n this.instanceObject = null;\r\n this.instanceMaterials = [];\r\n }\r\n\r\n var worldTransform = this.generateWorldTransform(origin, orientationRad, groundz, layoutOrientationRad, layoutOrientationMoveToZero);\r\n\r\n if (dataRoofObject) {\r\n //var triangles: THREE.Vector3[][] = [];\r\n var instanceObject: THREE.Object3D = this.instanceObject = spt.ThreeJs.utils.ConvertThreeJsObject(dataRoofObject) || new THREE.Object3D();\r\n instanceObject.traverse(obj => {\r\n if (obj[\"LayerType\"] === \"RoofObjects\") {\r\n obj.traverse(o => {\r\n if (o instanceof THREE.Mesh) {\r\n var mat = o.material as THREE.MeshLambertMaterial;\r\n if (mat && mat.color)\r\n this.instanceMaterials.push({\r\n material: mat,\r\n defaultColor: new THREE.Color(mat.color)\r\n });\r\n }\r\n });\r\n }\r\n //if (data.InstanceHolderConfiguration.InstanceHolderType === \"FreeAreaObject\") {\r\n // obj.traverse(o => {\r\n // if (o instanceof THREE.Mesh) {\r\n // if (data.InstanceHolderConfiguration.InstanceHolderType === \"FreeAreaObject\") {\r\n // var trs = spt.ThreeJs.utils.GetTriangles(o);\r\n // if (trs.length)\r\n // triangles.push.apply(triangles, trs);\r\n // }\r\n // }\r\n // });\r\n //}\r\n });\r\n //if (triangles.length)\r\n // this.surfacePolygons = spt.ThreeJs.utils.TrianglesToSurfacePolygons(triangles);\r\n\r\n this.add(instanceObject);\r\n }\r\n\r\n this.surfacePolygons = null;\r\n\r\n if (data.SurfacePolygons && data.SurfacePolygons.length) {\r\n this.surfacePolygons = data.SurfacePolygons.map(surfacePolygon => {\r\n var plane = surfacePolygon.Plane;\r\n var polys = surfacePolygon.Polygons;\r\n var paths = new ClipperLib.Paths();\r\n polys.forEach(poly => {\r\n var path = new ClipperLib.Path();\r\n poly.forEach(p => {\r\n path.push(new ClipperLib.IntPoint(Math.round(p.x), Math.round(p.y), Math.round(p.z)));\r\n });\r\n paths.push(path);\r\n });\r\n return { plane: new THREE.Vector4(plane.x, plane.y, plane.z, plane.w), polygons: paths }\r\n });\r\n }\r\n\r\n var instanceContainer = this.instanceContainer;\r\n\r\n this.getLayoutOrientationTransform(this.localToWorldTransform).multiply(new THREE.Matrix4().makeRotationX(this.AngleRad)).multiply(this.getLayoutOrientationReverseTransform());\r\n\r\n spt.ThreeJs.utils.setMatrix4(instanceContainer, this.localToWorldTransform);\r\n \r\n this.addToScene(controller);\r\n\r\n this.localToWorldTransform.multiplyMatrices(worldTransform, this.localToWorldTransform);\r\n\r\n this.worldToLocalTransform.getInverse(this.localToWorldTransform, false);\r\n\r\n spt.ThreeJs.utils.setMatrix4(this.root, worldTransform);\r\n\r\n this.worldPlane.setComponents(0, 0, 1, 0).applyMatrix4(this.localToWorldTransform);\r\n\r\n var measureObjectHolder = this.measureObjectHolder,\r\n directedAreaHolder = this.directedAreaHolder;\r\n\r\n var measureObjects = data.MeasureObjects,\r\n directedAreas = data.DirectedAreas,\r\n interferenceObjects = data.InterferenceObjects,\r\n oldInterferenceObjects = this.getInterferenceObjects();\r\n\r\n if (measureObjects && measureObjects.length)\r\n measureObjectHolder.addMeasureObjects(measureObjects);\r\n\r\n if (directedAreas && directedAreas.length)\r\n directedAreaHolder.addDirectedAreaDefinitions(directedAreas);\r\n\r\n oldInterferenceObjects.forEach(o => o.dispose());\r\n\r\n if (interferenceObjects && interferenceObjects.length) {\r\n interferenceObjects.forEach(d => {\r\n Controller.Current.interferenceHelper.createInterferenceObjectFromData(d);\r\n });\r\n }\r\n\r\n this.onHighlightingChanged();\r\n\r\n return this;\r\n }\r\n\r\n onHighlightingChanged() {\r\n var highlighted = this.highlighted;\r\n\r\n if (this.instanceMaterials.length) {\r\n\r\n if (highlighted)\r\n this.instanceMaterials.forEach(instanceMaterial => {\r\n instanceMaterial.material.color.copy(instanceMaterial.defaultColor);\r\n instanceMaterial.material.needsUpdate = true;\r\n });\r\n //this.instanceMaterial.color.setRGB(1, 1, 1);\r\n else {\r\n this.instanceMaterials.forEach(instanceMaterial => {\r\n instanceMaterial.material.color.copy(instanceMaterial.defaultColor).multiplyScalar(0.8);\r\n instanceMaterial.material.needsUpdate = true;\r\n });\r\n //if (this.IsElevation) {\r\n // this.instanceMaterial.color.setRGB(0.8, 0.8, 0.8);\r\n //} else {\r\n // this.instanceMaterial.color.setRGB(0.7, 0.9, 0.9);\r\n //}\r\n }\r\n //this.instanceMaterial.needsUpdate = true;\r\n //console.log(\"instanceMaterial updated \" + highlighted);\r\n }\r\n }\r\n\r\n add(object: THREE.Object3D, asInstance?: boolean): void {\r\n if (asInstance) {\r\n if (object.parent) {\r\n if (object.parent === this.instanceContainer)\r\n return;\r\n else\r\n object.parent.remove(object);\r\n }\r\n if (this.instanceContainer.children.indexOf(object) === -1)\r\n this.instanceContainer.add(object);\r\n } else if (this.root.children.indexOf(object) === -1) {\r\n if (object.parent) {\r\n if (object.parent === this.root)\r\n return;\r\n else\r\n object.parent.remove(object);\r\n }\r\n this.root.add(object);\r\n }\r\n }\r\n\r\n remove(object: THREE.Object3D, asInstance?: boolean): void {\r\n if (asInstance)\r\n this.instanceContainer.remove(object);\r\n else\r\n this.root.remove(object);\r\n }\r\n\r\n getInterferenceObjects(): IDynamicInterferenceObject[] {\r\n return Controller.Current.viewModel.interferenceObjects.filter(o => o.BaseParentId === this.Id);\r\n }\r\n\r\n getClientObjects(): ClientObject[] {\r\n return this.instanceContainer.children.filter((o: ClientObject) => o.isClientObject) as ClientObject[];\r\n }\r\n\r\n addToOctree(object: THREE.Mesh, options?: spt.ThreeJs.utils.OctreeAddOptions) {\r\n this.octree.add(object, options);\r\n }\r\n\r\n removeFromOctree(object: THREE.Object3D) {\r\n this.octree.remove(object);\r\n }\r\n\r\n addToScene(controller?: Controller) {\r\n\r\n if (!controller)\r\n controller = Controller.Current;\r\n\r\n if (!controller)\r\n return;\r\n\r\n if (controller.scene.children.indexOf(this.root) === -1)\r\n controller.scene.add(this.root);\r\n }\r\n\r\n removeFromScene(controller?: Controller) {\r\n\r\n if (!controller)\r\n controller = Controller.Current;\r\n\r\n if (!controller)\r\n return;\r\n\r\n controller.scene.remove(this.root);\r\n }\r\n\r\n forEachOctreeObjects(fn: (o: THREE.Object3D) => void) {\r\n this.octree.objects.forEach(fn);\r\n }\r\n\r\n notifyOctree() {\r\n this.octree._needsRebuild = true;\r\n }\r\n\r\n searchOctree(position: THREE.Vector3, radius: number, organizeByObject?: boolean, direction?: THREE.Vector3): THREE.Object3D[] {\r\n return this.octree.search(position, radius, organizeByObject, direction).map(o => o.object);\r\n }\r\n\r\n getInstanceIntersections(worldRayCaster: THREE.Raycaster, filterOptions?: number): ClientObjectInstance[] {\r\n var octree = this.octree;\r\n this.ray.copy(worldRayCaster.ray);\r\n worldRayCaster.ray.applyMatrix4(this.worldToLocalTransform);\r\n var result = spt.ThreeJs.utils.getInstanceIntersections(worldRayCaster, octree, filterOptions);\r\n worldRayCaster.ray.copy(this.ray);\r\n return result;\r\n }\r\n\r\n getBoxIntersections(searchBox: THREE.Box3): THREE.Object3D[] {\r\n var octree = this.octree;\r\n return spt.ThreeJs.utils.getBoxIntersections(searchBox, octree);\r\n }\r\n\r\n getIntersectionsByViewVolume(viewVolume: spt.ThreeJs.utils.TestVolume): THREE.Object3D[] {\r\n return spt.ThreeJs.utils.getIntersectionsByViewVolume(this.testVolume.copy(viewVolume).applyMatrix4(this.worldToLocalTransform), this.octree);\r\n }\r\n\r\n getLocalPosition(worldRay: THREE.Ray, target?: THREE.Vector3): THREE.Vector3 {\r\n return this.ray.copy(worldRay).applyMatrix4(this.worldToLocalTransform).intersectPlane(this.plane, target || new THREE.Vector3());\r\n }\r\n\r\n updateModuleAppearance() {\r\n\r\n var baseParentId = this.Id;\r\n if (!baseParentId)\r\n return;\r\n\r\n var moduleCellType = (parseInt(\"\" + this.ModuleCellType) || ModuleCellType.Monocrystalline) as ModuleCellType;\r\n var moduleCellcols = Math.min(200, Math.max(0, parseInt(\"\" + this.ModuleCellcols) || 0));\r\n var moduleCellrows = Math.min(200, Math.max(0, parseInt(\"\" + this.ModuleCellrows) || 0));\r\n var moduleFrameWidth = Math.min(200, Math.max(0, parseFloat((\"\" + this.ModuleFrameWidth).replace(\",\", \".\")) || 0));\r\n var moduleCellColor = this.ModuleCellColor || '0b1b3c';;\r\n var moduleFrameColor = this.ModuleFrameColor || 'b5b5b5';;\r\n var moduleBacksheetColor = this.ModuleBacksheetColor || 'e5e5e5';;\r\n\r\n if (moduleCellColor && moduleCellColor.length && moduleCellColor.charAt(0) === '#')\r\n moduleCellColor = moduleCellColor.substr(1);\r\n moduleCellColor = moduleCellColor.toLowerCase();\r\n\r\n if (moduleFrameColor && moduleFrameColor.length && moduleFrameColor.charAt(0) === '#')\r\n moduleFrameColor = moduleFrameColor.substr(1);\r\n moduleFrameColor = moduleFrameColor.toLowerCase();\r\n\r\n if (moduleBacksheetColor && moduleBacksheetColor.length && moduleBacksheetColor.charAt(0) === '#')\r\n moduleBacksheetColor = moduleBacksheetColor.substr(1);\r\n moduleBacksheetColor = moduleBacksheetColor.toLowerCase();\r\n\r\n var objects = Controller.Current.Objects;\r\n for (var id in objects) {\r\n var clientObject = objects[id] as ClientObject;\r\n if (clientObject && clientObject.userData && clientObject.userData.BaseParentId === baseParentId && clientObject.SharedMeshes && clientObject.SharedMeshes.length) {\r\n for (var i = clientObject.SharedMeshes.length; i--;) {\r\n var sharedMesh = clientObject.SharedMeshes[i],\r\n material = sharedMesh.material;\r\n if (material instanceof THREE.ModuleAppearanceShader) {\r\n material.cellType = moduleCellType;\r\n material.cols = moduleCellcols;\r\n material.rows = moduleCellrows;\r\n material.frameWidth = moduleFrameWidth;\r\n material.moduleCellColor.set('#' + moduleCellColor);\r\n material.moduleFrameColor.set('#' + moduleFrameColor);\r\n material.moduleBacksheetColor.set('#' + moduleBacksheetColor);\r\n } else if (material instanceof THREE.DefaultAppearanceShader) {\r\n material.color.set('#' + moduleFrameColor);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n update() {\r\n var octree = this.octree;\r\n octree.update();\r\n if ((octree)._needsRebuild) {\r\n octree.rebuild();\r\n (octree)._needsRebuild = false;\r\n //console.log(\"octree count: \" + octree.objects.length);\r\n }\r\n }\r\n\r\n onDeactivate() {\r\n this.measureVisualizer.clearSteps();\r\n this.measureVisualizer.update();\r\n }\r\n\r\n onActivate() {\r\n\r\n }\r\n\r\n dispose() {\r\n this.insertableClientObjects.removeAll();\r\n this.scaleInsertableClientObjects.removeAll();\r\n this.removeFromScene();\r\n spt.ThreeJs.utils.disposeObject3D(this.root);\r\n }\r\n\r\n }\r\n}","module LS.Client3DEditor {\r\n import Interference3DOptions = SolarProTool.Interference3DOptions;\r\n\r\n export interface IDynamicInterferenceObject extends ISelectableUi, SolarProTool.IInterference3DObject {\r\n isHovered: boolean;\r\n update(): void;\r\n readonly instanceContext: InstanceContext;\r\n readonly object: THREE.Object3D;\r\n readonly state: InteferenceState;\r\n id: number;\r\n\r\n height: number;\r\n posx: number;\r\n posy: number;\r\n scalex: number;\r\n scaley: number;\r\n sizex: number;\r\n sizey: number;\r\n rotation: number;\r\n locked: boolean;\r\n\r\n setState(interference?: SolarProTool.IInterference3DObject): this;\r\n setData(data: number[]): void;\r\n getData(): number[];\r\n applyOffset(offsetx: number, offsety: number);\r\n intersectRaycaster(worldRaycaster: THREE.Raycaster): number;\r\n intersectTestVolume(testVolume: spt.ThreeJs.utils.TestVolume, linePrecision: number): boolean;\r\n remove(): void;\r\n dispose(): void;\r\n positionAndSize(pos: THREE.Vector3, size: THREE.Vector3);\r\n\r\n setHeight(v: number);\r\n setIsParallel(b: boolean);\r\n toggleLocked(b: boolean);\r\n }\r\n\r\n export class DynamicInterferenceObject implements IDynamicInterferenceObject {\r\n locked = false;\r\n IsParallel = false;\r\n Name = \"\";\r\n Type = \"DynamicInterferenceObject\";\r\n IconX = 16;\r\n IconY = 7;\r\n BaseParentId = null;\r\n TypeId = null;\r\n IdString = null;\r\n ClientOptions: Interference3DOptions = 0;\r\n readonly object: THREE.Object3D;\r\n readonly editablePolygon: EditablePolygon2D;\r\n _suppressUserUpdates;\r\n Settings: SolarProTool.BaseInterferenceSettings = null as SolarProTool.BaseInterferenceSettings;\r\n\r\n Data: number[];\r\n\r\n get sizex() {\r\n return this.localPolygon.sizeX;\r\n }\r\n\r\n set sizex(val: number) {\r\n var v = +val;\r\n if (v > 0 && this.localPolygon.sizeX !== v) {\r\n this.localPolygon.sizeX = v;\r\n this.onUserUpdated();\r\n }\r\n }\r\n\r\n get sizey() {\r\n return this.localPolygon.sizeY;\r\n }\r\n\r\n set sizey(val: number) {\r\n var v = +val;\r\n if (v > 0 && this.localPolygon.sizeY !== v) {\r\n this.localPolygon.sizeY = v;\r\n this.onUserUpdated();\r\n }\r\n }\r\n\r\n get posx() {\r\n return this.localPolygon.positionX;\r\n }\r\n\r\n set posx(val: number) {\r\n var v = +val;\r\n if (!isNaN(v) && isFinite(v) && this.localPolygon.positionX !== v) {\r\n this.localPolygon.positionX = v;\r\n this.onUserUpdated();\r\n }\r\n }\r\n\r\n get posy() {\r\n return this.localPolygon.positionY;\r\n }\r\n\r\n set posy(val: number) {\r\n var v = +val;\r\n if (!isNaN(v) && isFinite(v) && this.localPolygon.positionY !== v) {\r\n this.localPolygon.positionY = v;\r\n this.onUserUpdated();\r\n }\r\n }\r\n\r\n get scalex() {\r\n return this.localPolygon.scaleX;\r\n }\r\n\r\n set scalex(val: number) {\r\n var v = +val;\r\n if (v > 0 && this.localPolygon.scaleX !== v) {\r\n this.localPolygon.scaleX = v;\r\n this.onUserUpdated();\r\n }\r\n }\r\n\r\n get scaley() {\r\n return this.localPolygon.scaleY;\r\n }\r\n\r\n set scaley(val: number) {\r\n var v = +val;\r\n if (v > 0 && this.localPolygon.scaleY !== v) {\r\n this.localPolygon.scaleY = v;\r\n this.onUserUpdated();\r\n }\r\n }\r\n\r\n get rotation() {\r\n return this.localPolygon.rotation;\r\n }\r\n\r\n set rotation(val: number) {\r\n var v = +val;\r\n if (!isNaN(v) && isFinite(v) && this.localPolygon.rotation !== v) {\r\n this.localPolygon.rotation = v;\r\n this.onUserUpdated();\r\n }\r\n }\r\n\r\n get isLocked() {\r\n return this.locked || (/*!Controller.Current.viewModel.EnableMultiEdit && */(!Controller.Current.viewModel.currentInstance || Controller.Current.viewModel.currentInstance.Id !== this.BaseParentId));\r\n }\r\n\r\n get id(): number {\r\n return this.object.id;\r\n }\r\n\r\n set id(v: number) {\r\n this.object.id = v;\r\n }\r\n\r\n get isHovered() {\r\n return this._isHovered;\r\n }\r\n\r\n set isHovered(v: boolean) {\r\n if (this._isHovered != v) {\r\n this._isHovered = v;\r\n this.onMaterialChanged();\r\n }\r\n }\r\n\r\n get isSelected() {\r\n return this._selected;\r\n }\r\n\r\n set isSelected(v: boolean) {\r\n if (this._selected != v) {\r\n this._selected = !!v;\r\n //this.onGeometryChanged();\r\n this.onMaterialChanged();\r\n }\r\n }\r\n\r\n readonly state = new InteferenceState();\r\n readonly localPolygon: ObservablePolygon;\r\n localPolySubscription: KnockoutSubscription;\r\n\r\n private _geometryDynamic = false;\r\n _materialNeedsUpdate = true;\r\n _geometryNeedsUpdate = true;\r\n\r\n //private _gmNeedsUpdate = true;\r\n\r\n //get _geometryNeedsUpdate() {\r\n // return this._gmNeedsUpdate;\r\n //}\r\n\r\n //set _geometryNeedsUpdate(v: boolean) {\r\n // if (v) {\r\n // var tt = 0;\r\n // }\r\n // this._gmNeedsUpdate = v;\r\n //}\r\n\r\n _positionChanged = 0;\r\n instanceMesh: THREE.Mesh = null;\r\n\r\n _worldBounds = new THREE.Box3();\r\n _box3d = new THREE.Box3();\r\n _v1 = new THREE.Vector3();\r\n _mat = new THREE.Matrix4();\r\n _matNormal = new THREE.Matrix3();\r\n\r\n get worldBounds(): THREE.Box3 {\r\n if (this._worldBounds.isEmpty() && this.instanceMesh)\r\n this._worldBounds.setFromObject(this.instanceMesh);\r\n return this._worldBounds;\r\n }\r\n\r\n readonly localBounds: THREE.Box3;\r\n\r\n constructor() {\r\n ko.track(this);\r\n\r\n this.localPolygon = new ObservablePolygon();\r\n this.localPolySubscription = this.localPolygon.subscribe(() => {\r\n if (this._setPointsOnUpdate)\r\n this._geometryNeedsUpdate = true;\r\n });\r\n\r\n this.object = new THREE.Object3D();\r\n var editablePolygon = this.editablePolygon = new EditablePolygon2D(this.localPolygon, this.onUserUpdated.bind(this), this.onUserMoved.bind(this));\r\n this.object.add(editablePolygon);\r\n\r\n ko.getObservable(this, 'BaseParentId').subscribe((bpid: string) => {\r\n var instanceContext: InstanceContext = bpid ? Controller.Current.viewModel.instancesById[bpid] : null;\r\n if (instanceContext)\r\n instanceContext.remove(this.object, true);\r\n }, this, \"beforeChange\");\r\n\r\n ko.getObservable(this, 'BaseParentId').subscribe((bpid) => {\r\n var instanceContext: InstanceContext = bpid ? Controller.Current.viewModel.instancesById[bpid] : null;\r\n if (instanceContext)\r\n instanceContext.add(this.object, true);\r\n });\r\n\r\n var bounds = new THREE.Box3();\r\n\r\n ko.defineProperty(this, \"localBounds\", () => {\r\n bounds.copy(this.localPolygon.bounds);\r\n bounds.min.setZ(0);\r\n return bounds;\r\n });\r\n\r\n Controller.Current.viewModel.interferenceObjects.push(this);\r\n }\r\n\r\n moveBy(v: THREE.Vector3): void {\r\n this.editablePolygon.translatePoly(v);\r\n this.editablePolygon.userEdited = true;\r\n //this.editablePolygon.position.add(v);\r\n //this.instanceMesh.position.add(v);\r\n\r\n if (this._positionChanged)\r\n clearTimeout(this._positionChanged);\r\n\r\n this._positionChanged = setTimeout(() => {\r\n this._positionChanged = 0;\r\n Controller.Current.viewModel.editableObjectsManager.applyUserEdited();\r\n Controller.Current.notifyRefreshView();\r\n }, 500) as any;\r\n }\r\n\r\n GetPositionProperty(k: string): number {\r\n return this.localPolygon.position[k];\r\n }\r\n\r\n GetSizeProperty(k: string): number {\r\n return this.localPolygon.size[k];\r\n }\r\n\r\n OnChanged(viewModel?: ViewModel): void {\r\n if (this._positionChanged) {\r\n clearTimeout(this._positionChanged);\r\n this._positionChanged = 0;\r\n Controller.Current.viewModel.editableObjectsManager.applyUserEdited();\r\n }\r\n }\r\n\r\n applyObjectPosition(): void {\r\n\r\n }\r\n\r\n duplicate(count?: number, distance?: number, direction?: THREE.Vector3): void {\r\n\r\n }\r\n\r\n rotateByPivot(c: THREE.Vector3, angleRad: number) {\r\n var m = new THREE.Matrix4().makeTranslation(c.x, c.y, c.z).multiply(new THREE.Matrix4().makeRotationZ(angleRad).multiply(new THREE.Matrix4().makeTranslation(-c.x, -c.y, -c.z)));\r\n this.localPolygon.applyMatrix4(m);\r\n }\r\n\r\n getPivot(): THREE.Vector3 {\r\n return this.localPolygon.center;\r\n }\r\n\r\n setValue(k: string, val: any) {\r\n if (k in this)\r\n this[k] = val;\r\n }\r\n\r\n setSettings(settings: SolarProTool.IInterferenceSettings) {\r\n //settings currently not needed on DynamicInterferenceObject\r\n this.Settings = null as SolarProTool.BaseInterferenceSettings;\r\n }\r\n\r\n setState(state?: SolarProTool.IInterference3DObject): this {\r\n if (!state)\r\n return this;\r\n if (state.Type !== this.Type)\r\n throw \"setState: Wrong interference type.\";\r\n this._suppressUserUpdates = true;\r\n if (state) {\r\n\r\n Object.keys(state).forEach(k => {\r\n switch (k) {\r\n case \"Data\":\r\n break;\r\n case \"Settings\":\r\n break;\r\n case \"BaseParentId\":\r\n this.BaseParentId = state[k].toLowerCase();\r\n break;\r\n case \"Id\":\r\n case \"id\":\r\n this.id = state[k].toLowerCase();\r\n break;\r\n default:\r\n this.setValue(k, state[k]);\r\n break;\r\n }\r\n });\r\n\r\n if (state.Data)\r\n this.setData(state.Data);\r\n\r\n if (state.Settings)\r\n this.setSettings(state.Settings);\r\n\r\n this.onMaterialChanged();\r\n\r\n if (state instanceof InteferenceState) {\r\n this.localPolygon.resetScale(state.scalex, state.scaley, state.scalez);\r\n this.localPolygon.resetRotation(state.rotation);\r\n }\r\n\r\n this.state.copy(this);\r\n }\r\n this._suppressUserUpdates = false;\r\n\r\n return this;\r\n }\r\n\r\n setData(data: number[]) {\r\n this.editablePolygon.position.set(0, 0, 0);\r\n this.editablePolygon.userEdited = false;\r\n\r\n if (data && data.length) {\r\n var localPolygon = this.localPolygon;\r\n localPolygon.removeAll();\r\n for (var i = 0, l = data.length; i < l; i += 3) {\r\n localPolygon.push(data[i], data[i + 1], data[i + 2]);\r\n }\r\n }\r\n }\r\n\r\n getData(): number[] {\r\n return this.localPolygon.getData();\r\n }\r\n\r\n setHeight(v: number) {\r\n var h = this.height;\r\n Controller.Current.viewModel.setLength(this, 'height', v);\r\n\r\n if (this.height < 10)\r\n this.height = 10;\r\n\r\n if (this.height !== h) {\r\n this.onGeometryChanged();\r\n this.onUserUpdated();\r\n }\r\n }\r\n\r\n setIsParallel(b: boolean) {\r\n if (this.IsParallel !== b) {\r\n this.IsParallel = b;\r\n this.onGeometryChanged();\r\n this.onUserUpdated();\r\n }\r\n }\r\n\r\n toggleLocked(b: boolean) {\r\n this.locked = !!b;\r\n if (b && this.isSelected) {\r\n Controller.Current.viewModel.selectedUi.remove(this);\r\n }\r\n }\r\n\r\n get instanceContext(): InstanceContext {\r\n return Controller.Current.getInstanceContext(this.BaseParentId);\r\n }\r\n\r\n private _setPointsOnUpdate = true;\r\n private _selected: boolean = false;\r\n private _isHovered = false;\r\n _isDisposed = false;\r\n\r\n get height() {\r\n return this.localPolygon.height;\r\n }\r\n\r\n set height(v: number) {\r\n this.localPolygon.height = v;\r\n }\r\n\r\n isDynamicInterferenceObject = true;\r\n txtHolder: spt.ThreeJs.utils.SDFTextObjectInstances = null;\r\n\r\n applyOffset(offsetx: number, offsety: number, offsetz: number = 0) {\r\n this.localPolygon.array.forEach(p => { p.set(p.x + offsetx, p.y + offsety, p.z + offsetz) });\r\n }\r\n\r\n intersectRaycaster(worldRaycaster: THREE.Raycaster): number {\r\n if (this.isLocked)\r\n return -1;\r\n\r\n if (this.isSelected) {\r\n var inter = this.editablePolygon.intersecsRaycaster(worldRaycaster);\r\n if (inter)\r\n return inter.distSq;\r\n return -1;\r\n }\r\n\r\n var worldBounds = this._box3d.copy(this.worldBounds).expandByScalar(worldRaycaster.params.Line.threshold),\r\n v1 = this._v1,\r\n ray = worldRaycaster.ray;\r\n\r\n if (ray.intersectBox(worldBounds, v1)) {\r\n var intersects = worldRaycaster.intersectObject(this.instanceMesh);\r\n if (intersects && intersects.length) {\r\n var intersect = intersects[0],\r\n distanceSq = v1.copy(intersect.point).distanceToSquared(ray.origin);\r\n return distanceSq;\r\n }\r\n }\r\n\r\n return -1;\r\n }\r\n\r\n intersectTestVolume(testVolume: spt.ThreeJs.utils.TestVolume, linePrecision: number): boolean {\r\n if (this.isLocked)\r\n return false;\r\n\r\n var worldBounds = this._box3d.copy(this.worldBounds).expandByScalar(linePrecision);\r\n\r\n if (!testVolume.testBoxForSeparationAxis(worldBounds)) {\r\n var instanceMesh = this.instanceMesh;\r\n if (!testVolume.testBufferGeometryForSeparationAxis(instanceMesh.geometry as THREE.BufferGeometry, instanceMesh.matrixWorld))\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n onGeometryChanged() {\r\n this._geometryNeedsUpdate = true;\r\n }\r\n\r\n onMaterialChanged() {\r\n this._materialNeedsUpdate = true;\r\n }\r\n\r\n update() {\r\n if (this._geometryNeedsUpdate)\r\n this.updateGeometry();\r\n if (this._materialNeedsUpdate)\r\n this.updateMaterial();\r\n }\r\n\r\n onUserMoved() {\r\n if (this._suppressUserUpdates)\r\n return;\r\n\r\n //move other interfences with this one\r\n Controller.Current.viewModel.selectedUi.forEach(s => {\r\n if (s !== this && s instanceof DynamicInterferenceObject) {\r\n s.editablePolygon.setPosition(this.editablePolygon.position);\r\n s.editablePolygon.userEdited = true;\r\n }\r\n });\r\n }\r\n\r\n onUserUpdated() {\r\n if (this._suppressUserUpdates)\r\n return;\r\n\r\n var id = this.IdString;\r\n var baseParentId = this.BaseParentId;\r\n var oldState = this.state.clone();\r\n var newState = new InteferenceState().copy(this);\r\n this._geometryNeedsUpdate = true;\r\n\r\n Controller.Current.updateManager.dynamicUpdate(() => {\r\n var o = Controller.Current.interferenceHelper.getById(id);\r\n if (o) {\r\n o.setState(newState);\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(id, baseParentId, newState);\r\n }\r\n }, () => {\r\n var o = Controller.Current.interferenceHelper.getById(id);\r\n if (o) {\r\n o.setState(oldState);\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(id, baseParentId, oldState);\r\n }\r\n });\r\n\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(id, baseParentId, newState);\r\n\r\n this.state.copy(this);\r\n }\r\n\r\n removeInstance() {\r\n if (this._isDisposed)\r\n return;\r\n\r\n var id = this.IdString;\r\n var baseParentId = this.BaseParentId;\r\n var state = this.state.clone();\r\n\r\n Controller.Current.updateManager.dynamicUpdate(() => {\r\n var o = Controller.Current.interferenceHelper.getById(id);\r\n if (o) {\r\n o.remove();\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(id, baseParentId, null);\r\n }\r\n }, () => {\r\n Controller.Current.interferenceHelper.createInterferenceObjectFromData(state);\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(id, baseParentId, state);\r\n });\r\n\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(id, baseParentId, null);\r\n\r\n this.remove();\r\n }\r\n\r\n userEditPoint(p: ObservableVector3, k: 'x' | 'y' | 'z', v: number) {\r\n Controller.Current.viewModel.setLength(p, k, v);\r\n this.onUserUpdated();\r\n }\r\n\r\n userRemovePoint(p: ObservableVector3) {\r\n this.localPolygon.array.remove(p);\r\n this.onUserUpdated();\r\n }\r\n\r\n createGeometry(): THREE.BufferGeometry {\r\n\r\n var localPoly = this.localPolygon.array,\r\n geo = new THREE.BufferGeometry();\r\n\r\n this._setPointsOnUpdate = true;\r\n var instanceContext = Controller.Current.viewModel.instancesById[this.BaseParentId];\r\n if (instanceContext && instanceContext.surfacePolygons && instanceContext.surfacePolygons.length && localPoly.length) {\r\n\r\n var interHeight = localPoly[0].z,\r\n ptBounds = new THREE.Box3(),\r\n isVertical = !this.IsParallel,\r\n geometry = new THREE.Geometry();\r\n\r\n var polys = spt.ThreeJs.utils.ProjectPolygonsToSurface(localPoly, instanceContext.surfacePolygons, ptBounds);\r\n\r\n var idxOff = 0;\r\n\r\n for (var i = polys.length; i--;) {\r\n var poly = polys[i],\r\n pointsLower = poly.points,\r\n pointsTop = pointsLower.map(pLower => new THREE.Vector3(pLower.x, pLower.y, isVertical ? Math.max(pLower.z + 5, ptBounds.min.z + interHeight) : interHeight + pLower.z)),\r\n ptsLen = pointsLower.length - 1,\r\n plyIndices = THREE.ShapeUtils.triangulateShape(pointsTop, []);\r\n\r\n geometry.vertices.push.apply(geometry.vertices, pointsTop);\r\n\r\n for (var j = plyIndices.length; j--;) {\r\n var pi = plyIndices[j];\r\n geometry.faces.push(new THREE.Face3(pi[0] + idxOff, pi[1] + idxOff, pi[2] + idxOff));\r\n }\r\n\r\n idxOff += pointsTop.length;\r\n\r\n for (var j = ptsLen, j2 = 0; j2 <= ptsLen; j2++) {\r\n geometry.vertices.push(\r\n pointsLower[j],\r\n pointsLower[j2],\r\n pointsTop[j2],\r\n pointsTop[j]\r\n );\r\n\r\n geometry.faces.push(new THREE.Face3(idxOff, idxOff + 1, idxOff + 2));\r\n geometry.faces.push(new THREE.Face3(idxOff, idxOff + 2, idxOff + 3));\r\n\r\n idxOff += 4;\r\n \r\n j = j2;\r\n }\r\n }\r\n\r\n geometry.computeFlatVertexNormals();\r\n\r\n geo.fromGeometry(geometry);\r\n\r\n this._setPointsOnUpdate = false;\r\n\r\n return geo;\r\n }\r\n\r\n var isSelected = this.isSelected,\r\n vIndizes = THREE.ShapeUtils.triangulateShape(localPoly, []),\r\n polyLength = localPoly.length,\r\n vertCount = polyLength * 5,\r\n indicesCount = polyLength * 6 + vIndizes.length * 3;\r\n\r\n this._geometryDynamic = isSelected;\r\n\r\n var posAttribute = new THREE.BufferAttribute(new Float32Array(vertCount * 3), 3).setUsage(THREE.DynamicDrawUsage);\r\n var normAttribute = new THREE.BufferAttribute(new Float32Array(vertCount * 3), 3).setUsage(THREE.DynamicDrawUsage);\r\n\r\n geo.setAttribute('position', posAttribute);\r\n geo.setAttribute('normal', normAttribute);\r\n\r\n //geo.setAttribute('position', new THREE.BufferAttribute(new Float32Array(vertCount * 3), 3).setUsage(THREE.DynamicDrawUsage));\r\n //geo.setAttribute('normal', new THREE.BufferAttribute(new Float32Array(vertCount * 3), 3).setUsage(THREE.DynamicDrawUsage));\r\n //geo.computeVertexNormals();\r\n\r\n var indices = new Uint16Array(indicesCount);\r\n geo.setIndex(new THREE.BufferAttribute(indices, 1));\r\n\r\n var idx = 0;\r\n var iOff = polyLength;\r\n\r\n //sides\r\n for (var u = 0; u < polyLength; u++) {\r\n\r\n var i = u * 4;\r\n\r\n indices[idx++] = iOff + i + 2;\r\n indices[idx++] = iOff + i + 3;\r\n indices[idx++] = iOff + i + 1;\r\n\r\n indices[idx++] = iOff + i + 2;\r\n indices[idx++] = iOff + i + 1;\r\n indices[idx++] = iOff + i;\r\n }\r\n\r\n //top\r\n for (var m = 0, l2 = vIndizes.length; m < l2; m++) {\r\n var ind = vIndizes[m];\r\n\r\n indices[idx++] = ind[0];\r\n indices[idx++] = ind[1];\r\n indices[idx++] = ind[2];\r\n\r\n }\r\n\r\n return geo;\r\n }\r\n\r\n updateGeometry() {\r\n this._geometryNeedsUpdate = false;\r\n this._worldBounds.makeEmpty();\r\n\r\n var mesh = this.instanceMesh,\r\n localPoly: THREE.Vector3[] = this.localPolygon.array,\r\n localBounds = this.localBounds,\r\n localBoundsSize = localBounds.getSize(this._v1);\r\n\r\n if (!localPoly || !localPoly.length || localPoly.length < 3 || localBounds.isEmpty() || localBoundsSize.x <= 0 || localBoundsSize.y <= 0) {\r\n if (mesh && mesh.visible)\r\n mesh.visible = false;\r\n return;\r\n }\r\n\r\n var geo: THREE.BufferGeometry,\r\n //mat: THREE.Material,\r\n polyLength = localPoly.length,\r\n vertCount = polyLength * 5,\r\n isVertical = !this.IsParallel,\r\n geoDynamic = this.isSelected;\r\n\r\n if (!mesh) {\r\n geo = this.createGeometry();\r\n var mat = this.createMaterial();\r\n\r\n mesh = this.instanceMesh = new THREE.Mesh(geo, mat);\r\n this.object.add(mesh);\r\n\r\n this.object.updateMatrixWorld(true);\r\n } else {\r\n geo = mesh.geometry as THREE.BufferGeometry;\r\n //mat = mesh.material as THREE.Material;\r\n if (!mesh.visible)\r\n mesh.visible = true;\r\n\r\n mesh.position.set(0, 0, 0);\r\n\r\n if (!this._setPointsOnUpdate) {\r\n geo.dispose();\r\n geo = mesh.geometry = this.createGeometry();\r\n }\r\n }\r\n\r\n if (!this._setPointsOnUpdate)\r\n return;\r\n\r\n var positions = geo.getAttribute('position') as THREE.BufferAttribute,\r\n minZ = 10,\r\n groundZ = 0;\r\n\r\n if (positions.count !== vertCount || this._geometryDynamic !== geoDynamic) {\r\n geo.dispose();\r\n geo = mesh.geometry = this.createGeometry();\r\n positions = geo.getAttribute('position') as THREE.BufferAttribute;\r\n }\r\n\r\n if (isVertical) {\r\n\r\n this.object.updateMatrixWorld(false);\r\n\r\n var m = this.object.matrixWorld,\r\n min = this._box3d.copy(localBounds).applyMatrix4(m).min,\r\n v = this._v1;\r\n\r\n localPoly = localPoly.map(p => {\r\n var pt = v.copy(p).clone().setZ(0).applyMatrix4(m);\r\n\r\n return pt.setZ(Math.max(pt.z + minZ, p.z + min.z));\r\n });\r\n\r\n groundZ = min.z; //0;\r\n if (this.localPolygon.positionX < 0 || this.localPolygon.positionZ < 0) {\r\n groundZ = this.instanceContext.GroundZ;\r\n }\r\n //groundZ = this.instanceContext.GroundZ; // min.z;\r\n }\r\n\r\n //set positions\r\n for (var i1 = 0; i1 < polyLength; i1++) {\r\n var i2 = (i1 + 1) % polyLength;\r\n\r\n var p1 = localPoly[i1],\r\n p2 = localPoly[i2];\r\n\r\n //upper point\r\n positions.setXYZ(i1, p1.x, p1.y, Math.max(minZ, p1.z));\r\n\r\n var idx = polyLength + i1 * 4;\r\n\r\n //4 side points\r\n\r\n //upper\r\n positions.setXYZ(idx, p1.x, p1.y, Math.max(minZ, p1.z));\r\n positions.setXYZ(idx + 1, p2.x, p2.y, Math.max(minZ, p2.z));\r\n\r\n //lower\r\n positions.setXYZ(idx + 2, p1.x, p1.y, groundZ);\r\n positions.setXYZ(idx + 3, p2.x, p2.y, groundZ);\r\n\r\n }\r\n\r\n if (isVertical) {\r\n var m = this._mat.getInverse(this.object.matrixWorld);\r\n positions.applyMatrix4(m);\r\n //instanceContext.worldToLocalTransform.applyToBufferAttribute(positions);\r\n }\r\n\r\n geo.computeVertexNormals();\r\n geo.computeBoundingSphere();\r\n\r\n positions.needsUpdate = true;\r\n }\r\n\r\n createMaterial() {\r\n return new THREE.MeshLambertMaterial({ color: 0x333333 });\r\n }\r\n\r\n updateMaterial() {\r\n this._materialNeedsUpdate = false;\r\n\r\n var mesh = this.instanceMesh,\r\n material = mesh && mesh.material as THREE.MeshLambertMaterial;\r\n\r\n if (!material)\r\n return;\r\n\r\n var selected = this.isSelected,\r\n isHovered = this.isHovered && !selected;\r\n\r\n var intensity = 0x33; //51\r\n\r\n if (isHovered)\r\n intensity += 25;\r\n\r\n if (selected)\r\n intensity += 50;\r\n\r\n intensity = Math.max(0, Math.min(1, intensity / 255));\r\n\r\n material.transparent = !!selected;\r\n material.opacity = selected ? 0.75 : 1;\r\n material.color.setRGB(intensity, intensity, intensity);\r\n\r\n material.needsUpdate = true;\r\n\r\n this.onEnableEdit(selected);\r\n\r\n }\r\n\r\n onEnableEdit(selected: boolean) {\r\n this.editablePolygon.editable = selected;\r\n }\r\n\r\n positionAndSize(pos: THREE.Vector3, size: THREE.Vector3) {\r\n pos.set(this.posx, this.posy, 0);\r\n size.set(this.sizex, this.sizey, this.height);\r\n }\r\n\r\n remove() {\r\n if (this._isDisposed)\r\n return;\r\n\r\n this.dispose();\r\n }\r\n\r\n dispose() {\r\n if (this._isDisposed)\r\n return;\r\n this._isDisposed = true;\r\n\r\n if (this.localPolySubscription) {\r\n this.localPolySubscription.dispose();\r\n this.localPolySubscription = null;\r\n }\r\n\r\n Controller.Current.viewModel.interferenceObjects.remove(this);\r\n\r\n var instanceContext = this.instanceContext;\r\n\r\n if (instanceContext) {\r\n instanceContext.remove(this.object, true);\r\n }\r\n\r\n this.object.children.slice().forEach(ch => {\r\n spt.ThreeJs.utils.disposeObject3D(ch);\r\n });\r\n }\r\n\r\n }\r\n\r\n export class DormerInterferenceObject extends DynamicInterferenceObject implements IDynamicInterferenceObject {\r\n Type = \"DormerInterferenceObject\";\r\n\r\n _v2 = new THREE.Vector3();\r\n _v3 = new THREE.Vector3();\r\n _v4 = new THREE.Vector3();\r\n _q1 = new THREE.Quaternion();\r\n _mat2 = new THREE.Matrix4();\r\n _mat3 = new THREE.Matrix4();\r\n _transformControls: THREE.TransformControls[] = [];\r\n _transformTarget: THREE.Object3D = null;\r\n Settings: SolarProTool.DormerInterferenceObject = null as SolarProTool.DormerInterferenceObject;\r\n\r\n get sizex() {\r\n return this.Settings.DormerSizeX;\r\n }\r\n\r\n set sizex(val: number) {\r\n var v = +val;\r\n if (v > 0 && this.Settings.DormerSizeX !== v) {\r\n this.Settings.DormerSizeX = v;\r\n this.onUserUpdated();\r\n }\r\n }\r\n\r\n get sizey() {\r\n return this.Settings.DormerSizeY;\r\n }\r\n\r\n set sizey(val: number) {\r\n var v = +val;\r\n if (v > 0 && this.Settings.DormerSizeY !== v) {\r\n this.Settings.DormerSizeY = v;\r\n this.onUserUpdated();\r\n }\r\n }\r\n\r\n get height() {\r\n return this.Settings.DormerSizeZ;\r\n }\r\n\r\n set height(v: number) {\r\n this.Settings.DormerSizeZ = v;\r\n }\r\n\r\n get DormerTiltAngle() {\r\n return this.Settings.DormerTiltAngle;\r\n }\r\n\r\n set DormerTiltAngle(val: number) {\r\n var v = +val;\r\n if (v >= 0 && v < 90 && this.Settings.DormerTiltAngle !== v) {\r\n this.Settings.DormerTiltAngle = v;\r\n this.onUserUpdated();\r\n }\r\n }\r\n\r\n get DormerHeight() {\r\n return Math.max(0, Math.tan(this.DormerTiltAngle / 180 * Math.PI) * this.sizex * 0.5);\r\n }\r\n\r\n set DormerHeight(h: number) {\r\n if (h <= 0)\r\n this.Settings.DormerTiltAngle = 0;\r\n else if (this.sizex > 0)\r\n this.Settings.DormerTiltAngle = Math.max(0, Math.min(89, Math.atan((h * 2) / this.sizex) / Math.PI * 180));\r\n }\r\n\r\n GetSizeProperty(k: string): number {\r\n return k === \"y\" ? 0 : this.localPolygon.size[k];\r\n }\r\n\r\n constructor() {\r\n super();\r\n\r\n this.IconX = 0;\r\n this.IconY = 8;\r\n\r\n ko.track(this);\r\n\r\n var settings = this.Settings;\r\n\r\n if (!settings)\r\n settings = this.Settings = {} as SolarProTool.DormerInterferenceObject;\r\n\r\n settings.DormerTiltAngle = 0;\r\n settings.DormerSizeX = 0;\r\n settings.DormerSizeY = 0;\r\n settings.DormerSizeZ = 0;\r\n settings.InterferenceType = this.Type;\r\n\r\n ko.track(settings);\r\n\r\n if (this.localPolySubscription) {\r\n this.localPolySubscription.dispose();\r\n this.localPolySubscription = null;\r\n }\r\n\r\n this.editablePolygon.clickable = true;\r\n this.editablePolygon.draggable = true;\r\n this.editablePolygon.editOptions = EditablePolygon2D.ShowEdges | EditablePolygon2D.ShowSurface;\r\n }\r\n\r\n onUserUpdated() {\r\n if (this._suppressUserUpdates)\r\n return;\r\n\r\n this.updateLocalPoly();\r\n\r\n this._geometryNeedsUpdate = true;\r\n\r\n super.onUserUpdated();\r\n }\r\n\r\n setState(state?: SolarProTool.IInterference3DObject): this {\r\n super.setState(state);\r\n\r\n this._geometryNeedsUpdate = true;\r\n this.updateTransformControls();\r\n\r\n return this;\r\n }\r\n\r\n updateLocalPoly() {\r\n var size = new THREE.Vector3(Math.max(10, this.sizex), Math.max(10, this.sizey), Math.max(10, this.height)),\r\n pos = new THREE.Vector3(this.posx, this.posy, 0),\r\n pts: THREE.Vector3[] = [\r\n pos.clone(),\r\n pos.clone().setX(pos.x + size.x),\r\n pos.clone().setX(pos.x + size.x).setY(pos.y + size.y),\r\n pos.clone().setY(pos.y + size.y)\r\n ],\r\n localPoly = this.localPolygon;\r\n\r\n localPoly.setLength(4);\r\n\r\n for (var i = 0, l = pts.length - 1; i <= l; i++) {\r\n localPoly.array[i].copy(pts[i]);\r\n }\r\n\r\n this.updateTransformControls();\r\n }\r\n\r\n updateTransformControls() {\r\n if (this._transformControls.length) {\r\n this._transformControls.forEach((tr: any) => {\r\n tr.updateMe();\r\n });\r\n }\r\n }\r\n\r\n //setData(data: number[]) {\r\n // super.setData(data);\r\n\r\n // var localPolygon = this.localPolygon;\r\n\r\n // var p = localPolygon.position;\r\n\r\n // this.dormerPosX = p.x;\r\n // this.dormerPosY = p.y;\r\n\r\n // this._geometryNeedsUpdate = true;\r\n //}\r\n\r\n onEnableEdit(selected: boolean) {\r\n //this.editablePolygon.editable = selected;\r\n\r\n var viewModel = Controller.Current.viewModel;\r\n\r\n if (!selected && this._transformControls.length) {\r\n\r\n this._transformControls.forEach(tr => {\r\n tr.detach();\r\n if (tr.object) {\r\n if (tr.object.parent)\r\n tr.object.parent.remove(tr.object);\r\n spt.ThreeJs.utils.disposeObject3D(tr.object);\r\n }\r\n tr.dispose();\r\n });\r\n\r\n this._transformControls = [];\r\n }\r\n else if (selected && !this._transformControls.length && this.instanceMesh) {\r\n\r\n //height control\r\n var transformControl = this.createTransformControl(false, (tc) => {\r\n //update transformcontrol\r\n if (this._isDisposed || !tc.object)\r\n return;\r\n var pos = this._v1.set(this.posx + this.sizex * 0.5, this.posy, 0).add(this._v2.set(0, 0, this.height + this.DormerHeight).applyQuaternion(tc.object.quaternion));\r\n tc.object.position.copy(pos);\r\n\r\n }, (tc) => {\r\n //on transform change\r\n if (this._isDisposed || !tc.object)\r\n return;\r\n var target = tc.object,\r\n pos = this._v1.copy(this.localPolygon.position);\r\n pos.setX(pos.x + this.localPolygon.sizeX * 0.5);\r\n if (tc.ctrlDown) {\r\n this.DormerHeight = Math.max(0, pos.distanceTo(target.position) - this.Settings.DormerSizeZ);\r\n } else {\r\n if (target.position.z <= 0)\r\n this.Settings.DormerSizeZ = 0;\r\n else\r\n this.Settings.DormerSizeZ = Math.max(0, pos.distanceTo(target.position) - this.DormerHeight);\r\n }\r\n\r\n });\r\n\r\n transformControl.enabled = !viewModel.selectedTool;\r\n\r\n transformControl.showX = false;\r\n transformControl.showY = false;\r\n transformControl.showZ = true;\r\n\r\n //position\r\n transformControl = this.createTransformControl(true, (tc) => {\r\n //update transformcontrol\r\n if (this._isDisposed || !tc.object)\r\n return;\r\n if (tc.ctrlDown && (tc.axis === \"X\" || tc.axis === \"Y\")) {\r\n if (tc.axis === \"X\") {\r\n var pos = this._v1.set(this.posx + this.sizex, this.posy /*+ this.sizey * 0.5*/, 0);\r\n tc.object.position.copy(pos);\r\n\r\n } else if (tc.axis === \"Y\") {\r\n var pos = this._v1.set(this.posx + this.sizex * 0.5, this.posy + this.sizey, 0);\r\n tc.object.position.copy(pos);\r\n }\r\n } else {\r\n var pos = this._v1.set(this.posx + this.sizex * 0.5, this.posy /*+ this.sizey * 0.5*/, 0);\r\n tc.object.position.copy(pos);\r\n }\r\n\r\n }, (tc) => {\r\n //on transform change\r\n if (this._isDisposed || !tc.object)\r\n return;\r\n var target = tc.object;\r\n\r\n if (!tc.ctrlDown && Controller.Current.viewModel.ctrlDown) {\r\n tc.ctrlDown = true;\r\n }\r\n\r\n if (tc.axis === \"X\" && tc.ctrlDown) {\r\n var m = this._v1.set(this.posx + this.sizex * 0.5, this.posy /*+ this.sizey * 0.5*/, 0);\r\n\r\n this.Settings.DormerSizeX = Math.max(10, Math.abs(m.x - target.position.x) * 2);\r\n this.localPolygon.positionX = m.x - this.Settings.DormerSizeX * 0.5;\r\n\r\n } else if (tc.axis === \"Y\" && tc.ctrlDown) {\r\n this.Settings.DormerSizeY = Math.max(10, Math.abs(this.localPolygon.positionY - target.position.y));\r\n } else {\r\n var pos = this._v1.set(target.position.x - this.sizex * 0.5, target.position.y /*- this.sizey * 0.5*/, 0);\r\n this.localPolygon.position = pos;\r\n }\r\n console.log((tc as any).axis);\r\n\r\n });\r\n\r\n transformControl.showX = true;\r\n transformControl.showY = true;\r\n transformControl.showZ = false;\r\n\r\n this.updateTransformControls();\r\n\r\n }\r\n }\r\n\r\n createTransformControl(local: boolean, doUpdate: (tc: THREE.TransformControls) => void, onChanged: (tc: THREE.TransformControls) => void) {\r\n var target = this._transformTarget = new THREE.Object3D();\r\n\r\n if (!local) {\r\n target.applyMatrix4(this._mat.getInverse(this.object.matrixWorld));\r\n }\r\n target.position.set(0, 0, 0);\r\n\r\n this.object.add(target);\r\n\r\n var transformControl = Controller.Current.createTransformControls();\r\n this._transformControls.push(transformControl);\r\n\r\n transformControl.showX = false;\r\n transformControl.showY = false;\r\n transformControl.showZ = true;\r\n\r\n transformControl.setSpace('local');\r\n transformControl.attach(target);\r\n\r\n (transformControl).updateMe = doUpdate.bind(this, transformControl);\r\n\r\n transformControl.addEventListener('objectChange', (event) => {\r\n onChanged(transformControl);\r\n this._geometryNeedsUpdate = true;\r\n });\r\n\r\n //transformControl.addEventListener('mouseDown', (event) => {\r\n // if (transformControl.enabled)\r\n // doUpdate(transformControl);\r\n //});\r\n\r\n transformControl.addEventListener('dragging-changed', (event) => {\r\n if (!event.value) //on dragging end\r\n this.onUserUpdated();\r\n });\r\n\r\n return transformControl;\r\n }\r\n\r\n setSettings(settings: SolarProTool.IInterferenceSettings) {\r\n if (settings) {\r\n var mySettings = this.Settings;\r\n Object.keys(settings).forEach(k => {\r\n if (k in mySettings)\r\n mySettings[k] = settings[k];\r\n });\r\n }\r\n }\r\n\r\n createGeometry(): THREE.BufferGeometry {\r\n\r\n this.updateLocalPoly();\r\n\r\n var size = new THREE.Vector3(Math.max(10, this.sizex), Math.max(10, this.sizey), Math.max(10, this.height)),\r\n pos = new THREE.Vector3(this.posx, this.posy, 0),\r\n ptsLower: THREE.Vector3[] = this.localPolygon.array.map(p => new THREE.Vector3().copy(p)),\r\n ptsUpper: THREE.Vector3[] = ptsLower.map(p => p.clone().setZ(p.z + this.height)),\r\n geo = new THREE.Geometry(),\r\n dormerAngle = this.Settings.DormerTiltAngle;\r\n\r\n var idx = 0;\r\n\r\n for (var i = 0, l = ptsLower.length - 1; i <= l; i++) {\r\n\r\n var i2 = i == l ? 0 : i + 1;\r\n\r\n geo.faces.push(new THREE.Face3(idx, idx + 1, idx + 2), new THREE.Face3(idx, idx + 2, idx + 3));\r\n geo.vertices.push(ptsLower[i], ptsLower[i2], ptsUpper[i2], ptsUpper[i]);\r\n idx += 4;\r\n }\r\n\r\n if (dormerAngle > 0) {\r\n var h = Math.tan(dormerAngle / 180 * Math.PI) * size.x * 0.5,\r\n mpLower1 = ptsUpper[0].clone().add(ptsUpper[1]).multiplyScalar(0.5),\r\n mpLower2 = ptsUpper[2].clone().add(ptsUpper[3]).multiplyScalar(0.5),\r\n mpUpper1 = mpLower1.setZ(mpLower1.z + h),\r\n mpUpper2 = mpLower2.setZ(mpLower2.z + h);\r\n\r\n geo.faces.push(new THREE.Face3(idx, idx + 1, idx + 2));\r\n geo.vertices.push(ptsUpper[0], ptsUpper[1], mpUpper1);\r\n idx += 3;\r\n\r\n geo.faces.push(new THREE.Face3(idx, idx + 1, idx + 2));\r\n geo.vertices.push(ptsUpper[2], ptsUpper[3], mpUpper2);\r\n idx += 3;\r\n\r\n geo.faces.push(new THREE.Face3(idx, idx + 1, idx + 2), new THREE.Face3(idx, idx + 2, idx + 3));\r\n geo.vertices.push(ptsUpper[1], ptsUpper[2], mpUpper2, mpUpper1);\r\n idx += 4;\r\n\r\n geo.faces.push(new THREE.Face3(idx, idx + 1, idx + 2), new THREE.Face3(idx, idx + 2, idx + 3));\r\n geo.vertices.push(ptsUpper[3], ptsUpper[0], mpUpper1, mpUpper2);\r\n idx += 4;\r\n\r\n } else {\r\n geo.faces.push(new THREE.Face3(idx, idx + 1, idx + 2), new THREE.Face3(idx, idx + 2, idx + 3));\r\n geo.vertices.push(ptsUpper[0], ptsUpper[1], ptsUpper[2], ptsUpper[3]);\r\n idx += 4;\r\n }\r\n\r\n geo.computeFaceNormals();\r\n\r\n geo.computeBoundingSphere();\r\n\r\n var result = new THREE.BufferGeometry().fromGeometry(geo);\r\n\r\n var normalMatrix = this._matNormal.getNormalMatrix(this._mat.getInverse(this.object.matrixWorld));\r\n\r\n var zAxis = this._v1.set(0, 0, 1).applyMatrix3(normalMatrix);\r\n\r\n if (zAxis.z < 1) {\r\n var xAxis = this._v2.copy(zAxis).cross(this._v3.set(0, 0, 1)).normalize(),\r\n yAxis = this._v3.copy(zAxis).cross(xAxis).normalize(),\r\n m = this._mat.makeTranslation(pos.x, pos.y, pos.z).multiply(this._mat3.makeBasis(xAxis, yAxis, zAxis)).multiply(this._mat2.makeTranslation(-pos.x, -pos.y, -pos.z));\r\n\r\n result.applyMatrix4(m);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n updateGeometry() {\r\n this._geometryNeedsUpdate = false;\r\n this._worldBounds.makeEmpty();\r\n\r\n this.object.updateMatrixWorld(false);\r\n\r\n var mesh = this.instanceMesh;\r\n\r\n //if (!localPoly || !localPoly.length || localPoly.length < 3 || localBounds.isEmpty() || localBoundsSize.x <= 0 || localBoundsSize.y <= 0) {\r\n // if (mesh && mesh.visible)\r\n // mesh.visible = false;\r\n // return;\r\n //}\r\n\r\n if (!mesh) {\r\n var geo = this.createGeometry();\r\n var mat = this.createMaterial();\r\n\r\n mesh = this.instanceMesh = new THREE.Mesh(geo, mat);\r\n this.object.add(mesh);\r\n\r\n this.object.updateMatrixWorld(true);\r\n } else {\r\n mesh.geometry.dispose();\r\n mesh.geometry = this.createGeometry();\r\n }\r\n\r\n if (!mesh.visible)\r\n mesh.visible = true;\r\n\r\n //var tr = this._v1,\r\n // scale = this._v2,\r\n // quat = this._q1;\r\n\r\n //var normalMatrix = this._mat3.getNormalMatrix(this._mat.getInverse(this.object.matrixWorld));\r\n\r\n //this._mat.getInverse(this.object.matrixWorld).decompose(tr, quat, scale);\r\n\r\n //var normal = this._v1.set(0, 0, 1).applyMatrix3(normalMatrix);\r\n\r\n\r\n //var zAxis = this._v1.set(0, 0, 1).applyMatrix3(normalMatrix),\r\n // xAxis = this._v2.set(0, 0, 1).cross(zAxis).normalize(),\r\n // yAxis = this._v3.copy(zAxis).cross(xAxis).normalize();\r\n //this._v4.projectOnPlane()\r\n\r\n }\r\n\r\n dispose() {\r\n if (this._isDisposed)\r\n return;\r\n super.dispose();\r\n\r\n this._transformControls.forEach(tr => {\r\n tr.detach();\r\n if (tr.object) {\r\n if (tr.object.parent)\r\n tr.object.parent.remove(tr.object);\r\n spt.ThreeJs.utils.disposeObject3D(tr.object);\r\n }\r\n tr.dispose();\r\n });\r\n\r\n this._transformControls = [];\r\n }\r\n }\r\n\r\n export interface IMultiInterferenceSettings extends SolarProTool.IInterferenceSettings, SolarProTool.DormerInterferenceObject {\r\n\r\n }\r\n\r\n export class MultiInterferenceObjectView {\r\n interferenceDatas: IDynamicInterferenceObject[];\r\n\r\n Name: string;\r\n height: number;\r\n posx: number;\r\n posy: number;\r\n sizex: number;\r\n sizey: number;\r\n scalex: number;\r\n scaley: number;\r\n rotation: number;\r\n IsParallel: boolean;\r\n locked: boolean;\r\n\r\n readonly Settings: IMultiInterferenceSettings = {} as IMultiInterferenceSettings;\r\n\r\n detailsViewVisible = false;\r\n Type: { Name: string, Type: string };\r\n allTypes: { Name: string, Type: string }[] = [{ Name: AO3DStrings.Interference, Type: \"DynamicInterferenceObject\" }, { Name: AO3DStrings.Dormer, Type: \"DormerInterferenceObject\" }];\r\n readonly isDynamicInterferenceObject: boolean;\r\n readonly isDormerInterferenceObject: boolean;\r\n showOptions: boolean;\r\n\r\n constructor(viewModel: LS.Client3DEditor.ViewModel) {\r\n ko.track(this);\r\n\r\n ko.defineProperty(this, \"interferenceDatas\", () => {\r\n //this.detailsViewVisible = false;\r\n return viewModel.currentInterferenceObjects.filter(o => o.isSelected);\r\n });\r\n\r\n ko.defineProperty(this, \"showOptions\", () => {\r\n return this.interferenceDatas.length > 0;\r\n });\r\n\r\n ko.getObservable(this, \"showOptions\").extend({ rateLimit: 100 });\r\n\r\n ko.defineProperty(this, \"isDynamicInterferenceObject\", () => {\r\n return this.interferenceDatas.length && this.interferenceDatas.every(inter => inter.Type === \"DynamicInterferenceObject\");\r\n });\r\n\r\n ko.defineProperty(this, \"isDormerInterferenceObject\", () => {\r\n return this.interferenceDatas.length && this.interferenceDatas.some(inter => inter.Type === \"DormerInterferenceObject\");\r\n });\r\n\r\n ko.defineProperty(this.Settings, \"DormerTiltAngle\",\r\n {\r\n get: () => {\r\n if (this.interferenceDatas.length) {\r\n var v0: number;\r\n if (this.interferenceDatas.some(d => { return !!(v0 = (d.Settings && (d.Settings as SolarProTool.DormerInterferenceObject).DormerTiltAngle)); }))\r\n return v0;\r\n }\r\n return 0;\r\n },\r\n set: (v: number) => {\r\n this.interferenceDatas.forEach(d => {\r\n if (d instanceof DormerInterferenceObject) {\r\n d.DormerTiltAngle = v;\r\n }\r\n });\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"Type\",\r\n {\r\n get: () => {\r\n if (this.interferenceDatas.length === 1) {\r\n var allTypes = this.allTypes,\r\n t = this.interferenceDatas[0].Type;\r\n for (var i = 0, l = allTypes.length; i < l; i++) {\r\n if (allTypes[i].Type == t) {\r\n return allTypes[i];\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n set: (val) => {\r\n if (this.interferenceDatas.length === 1 && val && val.Type) {\r\n var t = this.interferenceDatas[0].Type;\r\n if (t !== val.Type) {\r\n viewModel.changeInterType(val.Type, this.interferenceDatas[0]);\r\n }\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"posx\",\r\n {\r\n get: () => {\r\n return this.interferenceDatas.reduce((c: number, inter) => inter.posx < c ? inter.posx : c, Infinity);\r\n },\r\n set: (val) => {\r\n var v = +val || 0;\r\n var d = v - this.posx;\r\n this.interferenceDatas.forEach(p => { p.posx += d; });\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"posy\",\r\n {\r\n get: () => {\r\n return this.interferenceDatas.reduce((c: number, inter) => inter.posy < c ? inter.posy : c, Infinity);\r\n },\r\n set: (val) => {\r\n var v = +val || 0;\r\n var d = v - this.posy;\r\n this.interferenceDatas.forEach(p => { p.posy += d; });\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"IsParallel\",\r\n {\r\n get: () => {\r\n return this.interferenceDatas.every(d => d.IsParallel);\r\n },\r\n set: (v: boolean) => {\r\n this.interferenceDatas.forEach(d => { d.setIsParallel(v); });\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"locked\",\r\n {\r\n get: () => {\r\n return this.interferenceDatas.some(d => d.locked);\r\n },\r\n set: (v: boolean) => {\r\n this.interferenceDatas.forEach(d => { d.toggleLocked(v); });\r\n }\r\n });\r\n\r\n //var sharedBooleans: (keyof this)[] = [\"locked\"];\r\n var sharedStrings: (keyof this)[] = [\"Name\"];\r\n var sharedNumbers: (keyof this)[] = [\"height\", \"scalex\", \"scaley\", \"sizex\", \"sizey\", \"rotation\"];\r\n\r\n sharedNumbers.forEach(k => {\r\n ko.defineProperty(this, k as any,\r\n {\r\n get: () => {\r\n if (this.interferenceDatas.length) {\r\n var v0 = this.interferenceDatas[0][k as string];\r\n return this.interferenceDatas.every(d => d[k as string] === v0) ? v0 : 0;\r\n }\r\n\r\n return 0;\r\n },\r\n set: (v: number) => {\r\n this.interferenceDatas.forEach(d => { d[k as string] = v; });\r\n }\r\n } as any);\r\n });\r\n\r\n //sharedBooleans.forEach(k => {\r\n\r\n // ko.defineProperty(this, k,\r\n // {\r\n // get: () => {\r\n // return this.interferenceDatas.every(d => !!d[k as string]);\r\n // },\r\n // set: (v: boolean) => {\r\n // this.interferenceDatas.forEach(d => { d[k as any] = !!v; });\r\n // }\r\n // } as any);\r\n //});\r\n\r\n sharedStrings.forEach(k => {\r\n\r\n ko.defineProperty(this, k as any,\r\n {\r\n get: () => {\r\n if (this.interferenceDatas.length) {\r\n var rd = this.interferenceDatas[0][k as string];\r\n if (this.interferenceDatas.every(d => d[k as string] === rd))\r\n return rd;\r\n }\r\n\r\n return null;\r\n },\r\n set: (v: string) => {\r\n this.interferenceDatas.forEach(d => { d[k as string] = v; });\r\n }\r\n } as any);\r\n });\r\n }\r\n\r\n setHeight(v: number) {\r\n this.interferenceDatas.forEach(d => { d.setHeight(v); });\r\n }\r\n\r\n toggleDetailsViewVisible(b: boolean) {\r\n this.detailsViewVisible = !!b;\r\n }\r\n\r\n toggleLocked(b: boolean) {\r\n this.locked = !!b;\r\n }\r\n\r\n deleteInters() {\r\n this.interferenceDatas.slice().forEach(inter => {\r\n inter.removeInstance();\r\n });\r\n }\r\n }\r\n\r\n export interface IInteferenceState extends SolarProTool.IInterference3DObject {\r\n getData?(): number[];\r\n scalex?: number;\r\n scaley?: number;\r\n scalez?: number;\r\n rotation?: number;\r\n }\r\n\r\n export class InteferenceState implements IInteferenceState {\r\n IsParallel = false;\r\n Name = null;\r\n Type: string = null;\r\n TypeId: string = null;\r\n BaseParentId: string = null;\r\n IdString: string = null;\r\n ClientOptions: Interference3DOptions = 0;\r\n Data: number[] = [];\r\n scalex: number = 0;\r\n scaley: number = 0;\r\n scalez: number = 0;\r\n rotation: number = 0;\r\n\r\n dormerPosX: number = 0;\r\n dormerPosY: number = 0;\r\n dormerSizeX: number = 0;\r\n dormerSizeY: number = 0;\r\n dormerSizeZ: number = 0;\r\n DormerTiltAngle: number = 0;\r\n\r\n Settings: SolarProTool.IInterferenceSettings = null as SolarProTool.IInterferenceSettings;\r\n\r\n clone(): InteferenceState {\r\n return new InteferenceState().copy(this);\r\n }\r\n\r\n copy(source: IInteferenceState): this {\r\n Object.keys(source).forEach(k => {\r\n switch (k) {\r\n case 'Data':\r\n case 'Settings':\r\n break;\r\n case 'scalex':\r\n case 'scaley':\r\n case 'scalez':\r\n this[k] = source[k] || 1;\r\n break;\r\n default:\r\n if (k in this)\r\n this[k] = source[k];\r\n }\r\n });\r\n\r\n if (source.Settings) {\r\n var settings = {} as SolarProTool.IInterferenceSettings;\r\n\r\n Object.keys(source.Settings).forEach(k => {\r\n settings[k] = source.Settings[k];\r\n });\r\n\r\n this.Settings = settings;\r\n } else {\r\n this.Settings = null as SolarProTool.IInterferenceSettings;\r\n }\r\n\r\n if (source.getData)\r\n this.Data = source.getData();\r\n else if (source.Data)\r\n this.Data = source.Data.slice();\r\n\r\n return this;\r\n }\r\n\r\n apply(target: IDynamicInterferenceObject) {\r\n target.setState(this);\r\n }\r\n\r\n equals(other: SolarProTool.IInterference3DObject): boolean {\r\n if (other) {\r\n var keys = Object.keys(other);\r\n for (var j = 0, kl = keys.length; j < kl; j++) {\r\n var k = keys[j];\r\n switch (k) {\r\n case \"Data\":\r\n var l = this.Data ? this.Data.length : 0;\r\n if (l !== (other.Data ? other.Data.length : 0))\r\n return false;\r\n for (var i = 0; i < l; i++) {\r\n if (this.Data[i] !== other.Data[i])\r\n return false;\r\n }\r\n break;\r\n default:\r\n if (this[k] !== other[k])\r\n return false;\r\n break;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n\r\n }\r\n }\r\n\r\n export class InterferenceHelper {\r\n\r\n stateUpdateQuery: { id: string, baseParentId: string, state: SolarProTool.IInterference3DObject, callback?: (newId: string) => void }[] = [];\r\n _needsStateUpdate = false;\r\n\r\n hoverObject: IDynamicInterferenceObject = null;\r\n\r\n update(controller: LS.Client3DEditor.Controller) {\r\n controller.viewModel.interferenceObjects.forEach(o => o.update());\r\n if (this._needsStateUpdate) {\r\n this._needsStateUpdate = false;\r\n\r\n var idStrings: string[] = [],\r\n baseParentIds: string[] = [],\r\n states: SolarProTool.IInterference3DObject[] = [],\r\n callBacks: ((newId: string) => void)[] = [];\r\n\r\n this.stateUpdateQuery.forEach(o => {\r\n idStrings.push(o.id);\r\n baseParentIds.push(o.baseParentId);\r\n states.push(o.state);\r\n callBacks.push(o.callback);\r\n });\r\n\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"SetInterferenceStates\").Data({ idStrings: idStrings, baseParentIds: baseParentIds, states: states }).CallBack((newIds) => {\r\n if (newIds && newIds.length) {\r\n callBacks.forEach((cb, i) => {\r\n if (cb)\r\n cb(newIds[i]);\r\n });\r\n }\r\n });\r\n\r\n this.stateUpdateQuery = [];\r\n }\r\n }\r\n\r\n getById(id: string) {\r\n id = id.toLowerCase();\r\n var interferenceObjects = Controller.Current.viewModel.interferenceObjects,\r\n idx = interferenceObjects.findIndex(o => o && o.IdString === id);\r\n if (idx !== -1)\r\n return interferenceObjects[idx];\r\n return null;\r\n }\r\n\r\n clearCurrent(controller?: LS.Client3DEditor.Controller) {\r\n if (!controller)\r\n controller = Controller.Current;\r\n\r\n var interferenceObjects = controller.viewModel.currentInterferenceObjects.slice();\r\n interferenceObjects.forEach(o => o.dispose());\r\n }\r\n\r\n clearAll(controller?: LS.Client3DEditor.Controller) {\r\n if (!controller)\r\n controller = Controller.Current;\r\n\r\n var interferenceObjects = controller.viewModel.interferenceObjects.splice(0, controller.viewModel.interferenceObjects.length);\r\n interferenceObjects.forEach(o => o.dispose());\r\n }\r\n\r\n getByRaycaster(worlRaycaster: THREE.Raycaster) {\r\n var controller = Controller.Current,\r\n viewModel = controller.viewModel,\r\n interferenceObjects = viewModel.interferenceObjects,\r\n interObject: IDynamicInterferenceObject = null,\r\n dist = Number.MAX_VALUE;\r\n\r\n interferenceObjects.forEach(interferenceObject => {\r\n var d = interferenceObject.intersectRaycaster(worlRaycaster);\r\n if (d >= 0 && d < dist) {\r\n dist = d;\r\n interObject = interferenceObject;\r\n }\r\n });\r\n\r\n return interObject;\r\n }\r\n\r\n getByTestVolume(testVolume: spt.ThreeJs.utils.TestVolume): IDynamicInterferenceObject[] {\r\n var controller = Controller.Current,\r\n linePrecision = controller.linePrecision;\r\n\r\n return controller.viewModel.interferenceObjects.filter(o => !!o.intersectTestVolume(testVolume, linePrecision));\r\n }\r\n\r\n setHoverObject(hoverObject?: IDynamicInterferenceObject) {\r\n if (this.hoverObject) {\r\n this.hoverObject.isHovered = false;\r\n this.hoverObject = null;\r\n }\r\n if (hoverObject) {\r\n hoverObject.isHovered = true;\r\n this.hoverObject = hoverObject;\r\n }\r\n\r\n }\r\n\r\n createInterferenceObjectFromData(interference: SolarProTool.IInterference3DObject): IDynamicInterferenceObject {\r\n if (!interference || !interference.IdString || !interference.Type)\r\n return null;\r\n\r\n return (constructObject(LS.Client3DEditor[interference.Type], []) as IDynamicInterferenceObject).setState(interference);\r\n }\r\n\r\n updateSetInterferenceState(id: string, baseParentId: string, state: SolarProTool.IInterference3DObject, callback?: (newId: string) => void) {\r\n this.stateUpdateQuery.push({ id: id, baseParentId: baseParentId, state: state, callback: callback });\r\n this._needsStateUpdate = true;\r\n }\r\n }\r\n}","module LS.Client3DEditor {\r\n export class NavigationHelper extends THREE.Object3D {\r\n\r\n private _camera: THREE.OrthographicCamera;\r\n private _uiCamera: THREE.OrthographicCamera;\r\n private _worldX: THREE.Vector3;\r\n private _worldY: THREE.Vector3;\r\n private _worldZ: THREE.Vector3;\r\n private _isHovering: boolean;\r\n private _uvDist: number;\r\n private _uvDistU: number;\r\n private _sizePx: number;\r\n private _sizePxHalf: number;\r\n private _paddingPx: number;\r\n private _maxSizePx: number;\r\n private _raycaster: THREE.Raycaster;\r\n private _minPos: THREE.Vector2;\r\n private _rotatedRoot: THREE.Object3D;\r\n private _rotatedObjects: THREE.Object3D;\r\n private _pointers: THREE.Object3D;\r\n private _highlights: THREE.Object3D;\r\n private _highlightsRotated: THREE.Object3D;\r\n private _maps: IUI3DImages;\r\n private _compass: THREE.Mesh;\r\n private _lowerPointer: THREE.Mesh;\r\n private _pointerMat: THREE.MeshBasicMaterial;\r\n private _rolls: THREE.Mesh[];\r\n private _sides: THREE.Mesh[];\r\n private _ui: THREE.Mesh[];\r\n private _hideControls: boolean;\r\n\r\n constructor(camera: THREE.OrthographicCamera, uiCamera: THREE.OrthographicCamera, hideControls?: boolean) {\r\n super();\r\n this._camera = camera;\r\n this._uiCamera = uiCamera;\r\n this._worldX = new THREE.Vector3(1, 0, 0);\r\n this._worldY = new THREE.Vector3(0, 1, 0);\r\n this._worldZ = new THREE.Vector3(0, 0, 1);\r\n this._isHovering = false;\r\n this._hideControls = !!hideControls;\r\n\r\n var renderOrder = 0;\r\n\r\n var wPx = 44;\r\n var uvOverlapPx = 1;\r\n var edgeWidth = 8;\r\n var paddingPx = 35;\r\n\r\n var sizePx = wPx;\r\n var globalOpacity = 1.0;\r\n var uvDist = edgeWidth / wPx;\r\n var uvDistU = 1 - uvDist;\r\n var edgeDist = 0.5 - uvDist;\r\n\r\n var uvDistOverlap = (edgeWidth - uvOverlapPx) / wPx;\r\n var uvDistUOverlap = 1 - uvDistOverlap;\r\n var edgeDistOverlap = 0.5 - uvDistOverlap;\r\n\r\n var edgePadding = 0.51;\r\n this._uvDist = uvDist;\r\n this._uvDistU = uvDistU;\r\n var sizePxHalf = sizePx / 2;\r\n var maxSizePx = (new THREE.Vector3(sizePxHalf, sizePxHalf, sizePxHalf)).length();\r\n \r\n //Geometries\r\n\r\n var planeGeometry = new THREE.PlaneBufferGeometry(1, 1, 1, 1);\r\n\r\n var compassGeometry = spt.ThreeJs.utils.BufferGeometryFromJsonObject({\r\n \"position\": {\r\n \"array\": [1.41552, 0, 1.41552, 1.41552, -0, -1.41552, -1.41552, -0, -1.41552, -1.41552, 0, 1.41552],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 3\r\n },\r\n \"uv\": {\r\n \"array\": [0.744053, 0.255947, 0.744053, 0.744053, 0.255947, 0.744053, 0.255947, 0.255947],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 2\r\n },\r\n \"index\": {\r\n \"array\": [0, 1, 2, 3, 0, 2],\r\n \"type\": \"Uint16Array\",\r\n \"itemSize\": 3\r\n }\r\n });\r\n \r\n var pointerGeometry = spt.ThreeJs.utils.BufferGeometryFromJsonObject({\r\n \"position\": {\r\n \"array\": [0.152634, -0, -0.74886, 0.152035, -0, -0.807967, -0.152035, -0, -0.807967, 0.032171, -0, -0.592755, -0.152634, -0, -0.74886, -0.032171, -0, -0.592755],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 3\r\n },\r\n \"uv\": {\r\n \"array\": [0.526316, 0.629113, 0.526213, 0.639304, 0.473787, 0.639304, 0.505547, 0.602198, 0.473684, 0.629113, 0.494453, 0.602198],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 2\r\n },\r\n \"index\": {\r\n \"array\": [0, 1, 2, 3, 0, 4, 4, 0, 2, 5, 3, 4],\r\n \"type\": \"Uint16Array\",\r\n \"itemSize\": 3\r\n }\r\n });\r\n\r\n var homeGeometry = spt.ThreeJs.utils.BufferGeometryFromJsonObject({\r\n \"position\": {\r\n \"array\": [-1.06336, -0, -1.32994, -1.06336, -0, -1.39259, -1.59856, -0, -1.39259, -1.55077, -0, -1.29337, -1.11115, -0, -1.29337, -1.11115, -0, -1.12238, -1.38193, -0, -1.60317, -1.26692, -0, -1.58623, -1.12213, -0, -1.44742, -1.12213, -0, -1.58623, -1.59856, -0, -1.32994, -1.55077, -0, -1.12238, -1.29205, -0, -1.60317],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 3\r\n },\r\n \"uv\": {\r\n \"array\": [0.316664, 0.729298, 0.316664, 0.7401, 0.224388, 0.7401, 0.232628, 0.722993, 0.308424, 0.722993, 0.308424, 0.693513, 0.261737, 0.776407, 0.281567, 0.773487, 0.306531, 0.749553, 0.306531, 0.773487, 0.224388, 0.729298, 0.232628, 0.693513, 0.277234, 0.776407],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 2\r\n },\r\n \"index\": {\r\n \"array\": [0, 1, 2, 3, 4, 0, 5, 4, 3, 6, 2, 7, 7, 2, 1, 7, 8, 9, 10, 0, 2, 10, 3, 0, 11, 5, 3, 12, 6, 7, 8, 7, 1],\r\n \"type\": \"Uint16Array\",\r\n \"itemSize\": 3\r\n }\r\n });\r\n\r\n var rollGeometry = spt.ThreeJs.utils.BufferGeometryFromJsonObject({\r\n \"position\": {\r\n \"array\": [1.19049, -0, -1.3296, 1.19049, -0, -1.60742, 1.06177, -0, -1.47285, 1.28536, -0, -1.3722, 1.32901, -0, -1.34339, 1.43215, -0, -1.45306, 1.22753, -0, -1.3296, 1.23627, -0, -1.38279, 1.23627, -0, -1.53373, 1.33825, -0, -1.52298, 1.22753, -0, -1.60742],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 3\r\n },\r\n \"uv\": {\r\n \"array\": [0.705256, 0.729239, 0.705256, 0.77714, 0.683062, 0.753939, 0.721613, 0.736585, 0.729138, 0.731617, 0.746921, 0.750525, 0.711642, 0.729239, 0.713149, 0.73841, 0.713149, 0.764434, 0.730731, 0.762582, 0.711642, 0.77714],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 2\r\n },\r\n \"index\": {\r\n \"array\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 3, 9, 8, 10, 1, 0, 9, 3, 5, 10, 6, 8, 7, 3, 8, 6, 10, 0],\r\n \"type\": \"Uint16Array\",\r\n \"itemSize\": 3\r\n }\r\n });\r\n\r\n var rollGeometry2 = spt.ThreeJs.utils.BufferGeometryFromJsonObject({\r\n \"index\": {\r\n \"type\": \"Uint16Array\",\r\n \"itemSize\": 3,\r\n \"array\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 4, 3, 0, 2, 7, 9, 3, 5, 10, 6, 8, 10, 8, 3, 6, 0, 7]\r\n },\r\n \"position\": {\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 3,\r\n \"array\": [1.3296, -0, -1.19049, 1.47285, -0, -1.06177, 1.60742, -0, -1.19049, 1.3722, -0, -1.28536, 1.52298, -0, -1.33825, 1.45306, -0, -1.43215, 1.3296, -0, -1.22753, 1.60742, -0, -1.22753, 1.53373, -0, -1.23627, 1.34339, -0, -1.32901, 1.38279, -0, -1.23627]\r\n },\r\n \"uv\": {\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 2,\r\n \"array\": [0.705256, 0.729239, 0.683062, 0.753939, 0.705256, 0.77714, 0.721613, 0.736585, 0.730731, 0.762582, 0.746921, 0.750525, 0.711642, 0.729239, 0.711642, 0.77714, 0.713149, 0.764434, 0.729138, 0.731617, 0.713149, 0.73841]\r\n }\r\n });\r\n\r\n var dropdownGeometry = spt.ThreeJs.utils.BufferGeometryFromJsonObject({\r\n \"position\": {\r\n \"array\": [1.60313, 0, 1.35392, 1.56816, 0, 1.3231, 1.33864, 0, 1.3231, 1.4749, 0, 1.60365, 1.60313, 0, 1.4797, 1.30367, 0, 1.4797, 1.30367, 0, 1.35392, 1.43191, 0, 1.60365],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 3\r\n },\r\n \"uv\": {\r\n \"array\": [0.7764, 0.266568, 0.77037, 0.271882, 0.730799, 0.271882, 0.754291, 0.22351, 0.7764, 0.244882, 0.724769, 0.244882, 0.724769, 0.266568, 0.746879, 0.22351],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 2\r\n },\r\n \"index\": {\r\n \"array\": [0, 1, 2, 3, 4, 5, 4, 0, 6, 6, 0, 2, 7, 3, 5, 5, 4, 6],\r\n \"type\": \"Uint16Array\",\r\n \"itemSize\": 3\r\n }\r\n });\r\n\r\n var planeTopGeometry = spt.ThreeJs.utils.BufferGeometryFromJsonObject({\r\n \"position\": {\r\n \"array\": [edgeDistOverlap, edgePadding, edgeDistOverlap, edgeDistOverlap, edgePadding, -edgeDistOverlap, -edgeDistOverlap, edgePadding, -edgeDistOverlap, -edgeDistOverlap, edgePadding, edgeDistOverlap],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 3\r\n },\r\n \"uv\": {\r\n \"array\": [uvDistUOverlap, uvDistOverlap, uvDistUOverlap, uvDistUOverlap, uvDistOverlap, uvDistUOverlap, uvDistOverlap, uvDistOverlap],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 2\r\n },\r\n \"index\": {\r\n \"array\": [0, 1, 2, 3, 0, 2],\r\n \"type\": \"Uint16Array\",\r\n \"itemSize\": 3\r\n }\r\n });\r\n\r\n var edgeGeometry = spt.ThreeJs.utils.BufferGeometryFromJsonObject({\r\n \"position\": {\r\n \"array\": [-edgePadding, edgeDist, -edgeDistOverlap, -edgePadding, edgeDist, edgeDistOverlap, -edgePadding, edgePadding, edgeDistOverlap, -edgeDist, edgePadding, edgeDistOverlap, -edgeDist, edgePadding, -edgeDistOverlap, -edgePadding, edgePadding, -edgeDistOverlap, -edgePadding, edgePadding, -edgeDistOverlap, -edgePadding, edgePadding, edgeDistOverlap],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 3\r\n },\r\n \"uv\": {\r\n \"array\": [uvDist, uvDistOverlap, uvDist, uvDistUOverlap, 0, uvDistUOverlap, uvDist, uvDistOverlap, uvDist, uvDistUOverlap, 0, uvDistUOverlap, 0, uvDistOverlap, 0, uvDistOverlap],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 2\r\n },\r\n \"index\": {\r\n \"array\": [0, 1, 2, 3, 4, 5, 6, 0, 2, 7, 3, 5],\r\n \"type\": \"Uint16Array\",\r\n \"itemSize\": 3\r\n }\r\n });\r\n\r\n var cornerGeometry = spt.ThreeJs.utils.BufferGeometryFromJsonObject({\r\n \"position\": {\r\n \"array\": [-edgePadding, edgeDist, edgePadding, -edgeDist, edgeDist, edgePadding, -edgeDist, edgePadding, edgePadding, -edgePadding, edgeDist, edgeDist, -edgePadding, edgeDist, edgePadding, -edgePadding, edgePadding, edgePadding, -edgePadding, edgePadding, edgePadding, -edgeDist, edgePadding, edgePadding, -edgeDist, edgePadding, edgeDist, -edgePadding, edgePadding, edgePadding, -edgePadding, edgePadding, edgeDist, -edgePadding, edgePadding, edgeDist],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 3\r\n },\r\n \"uv\": {\r\n \"array\": [uvDist, 0, uvDist, uvDist, -0, uvDist, uvDist, uvDist, 0, uvDist, 0, 0, 0, 0, uvDist, 0, uvDist, uvDist, 0, 0, uvDist, 0, 0, uvDist],\r\n \"type\": \"Float32Array\",\r\n \"itemSize\": 2\r\n },\r\n \"index\": {\r\n \"array\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 10, 3, 5, 11, 6, 8],\r\n \"type\": \"Uint16Array\",\r\n \"itemSize\": 3\r\n }\r\n });\r\n \r\n //END Geometries\r\n\r\n //Textures\r\n\r\n var maps: IUI3DImages = ({});\r\n\r\n var maxAnisotropy = Detector.webglParameters.maxAnisotropy;\r\n var floatPrecision = Detector.webglParameters.maxFloatPrecision;\r\n\r\n var textureloader = new THREE.TextureLoader();\r\n\r\n for (var n in UI3DImages) {\r\n var tex = textureloader.load(UI3DImages[n] as string, () => {\r\n LoaderManager.notifyResourceLoaded();\r\n });\r\n tex.anisotropy = maxAnisotropy;\r\n maps[n] = tex;\r\n }\r\n\r\n [\"top\", \"bottom\", \"front\", \"back\", \"left\", \"right\"].forEach((n) => {\r\n (maps[n]).minFilter = THREE.LinearFilter;\r\n });\r\n\r\n //END Textures\r\n\r\n //Materials\r\n\r\n var topMat = new THREE.RawShaderMaterial({\r\n uniforms: {\r\n map: { type: \"t\", value: (maps.top) }//,\r\n //center: { type: \"v3\", value: new THREE.Vector3() }\r\n },\r\n vertexShader: [\r\n \"precision \" + floatPrecision + \" float;\",\r\n \"uniform mat4 modelViewMatrix;\",\r\n \"uniform mat4 projectionMatrix;\",\r\n //\"uniform vec3 center;\",\r\n \"attribute vec3 position;\",\r\n \"attribute vec2 uv;\",\r\n \"varying vec2 vUv;\",\r\n \"void main() {\",\r\n \"vUv = uv;\",\r\n //\"vec4 vc = projectionMatrix * modelViewMatrix * vec4( 0, 0, 0, 1.0 );\",\r\n //\"vec4 vPos = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\r\n //\"vc.z = vPos.z;\",\r\n //\"vPos.xyz += (vPos.xyz - vc.xyz) * (1.5 - vPos.z);\",\r\n //\"vPos.xyz += (vc.xyz - vPos.xyz) * 0.1;\",\r\n \"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\r\n \"}\"\r\n ].join(\"\\n\"),\r\n fragmentShader: [\r\n \"precision \" + floatPrecision + \" float;\",\r\n \"uniform sampler2D map;\",\r\n \"varying vec2 vUv;\",\r\n \"void main()\t{\",\r\n \"gl_FragColor = texture2D(map, vUv);\",\r\n \"}\"\r\n ].join(\"\\n\"),\r\n side: THREE.FrontSide,\r\n transparent: false,\r\n fog: false,\r\n flatShading: true\r\n });\r\n \r\n var hoverMat = new THREE.MeshBasicMaterial({\r\n transparent: true,\r\n opacity: globalOpacity,\r\n map: maps.compassComposedHover as THREE.Texture,\r\n alphaMap: maps.compassComposedHover_a as THREE.Texture,\r\n color: new THREE.Color(0xFFFFFF) as any,\r\n fog: false,\r\n depthTest: false,\r\n depthWrite: false\r\n });\r\n\r\n (maps.compassSidesHover as THREE.Texture).magFilter = (maps.compassSidesHover as THREE.Texture).minFilter = THREE.LinearFilter;\r\n\r\n var sidesHoverMat = new THREE.MeshBasicMaterial({\r\n transparent: true,\r\n opacity: globalOpacity * 0.8,\r\n map: maps.compassSidesHover as THREE.Texture,\r\n color: new THREE.Color(0xFFFFFF) as any,\r\n fog: false,\r\n depthTest: false,\r\n depthWrite: false\r\n });\r\n\r\n var stdMat = new THREE.MeshBasicMaterial({\r\n transparent: true,\r\n opacity: globalOpacity,\r\n map: maps.compassComposed as THREE.Texture,\r\n alphaMap: maps.compassComposed_a as THREE.Texture,\r\n color: new THREE.Color(0xFFFFFF) as any,\r\n fog: false,\r\n depthTest: false,\r\n depthWrite: false\r\n });\r\n\r\n var compassMat = new THREE.MeshBasicMaterial({\r\n transparent: true,\r\n opacity: globalOpacity,\r\n map: maps.compassComposedNEWS as THREE.Texture,\r\n alphaMap: maps.compassComposedNEWS_a as THREE.Texture,\r\n color: new THREE.Color(0xFFFFFF) as any,\r\n fog: false,\r\n depthTest: true,\r\n depthWrite: true,\r\n side: THREE.DoubleSide\r\n });\r\n\r\n //END Materials\r\n\r\n this._sizePx = sizePx;\r\n this._sizePxHalf = sizePxHalf;\r\n this._paddingPx = paddingPx;\r\n this._maxSizePx = maxSizePx;\r\n this._raycaster = new THREE.Raycaster();\r\n this._minPos = new THREE.Vector2();\r\n\r\n this.scale.set(sizePx, sizePx, sizePx);\r\n\r\n var rotatedRoot = new THREE.Object3D();\r\n this.add(rotatedRoot);\r\n\r\n var rotated = new THREE.Object3D();\r\n rotatedRoot.add(rotated);\r\n\r\n this._rotatedRoot = rotatedRoot;\r\n this._rotatedObjects = rotated;\r\n\r\n var pointers = new THREE.Object3D();\r\n this.add(pointers);\r\n this._pointers = pointers;\r\n\r\n var pi2 = Math.PI / 2.0;\r\n\r\n var top = new THREE.Mesh(planeGeometry, topMat);\r\n top.renderOrder = renderOrder;\r\n top.frustumCulled = false;\r\n top.position.set(0, 0, 0.5);\r\n rotated.add(top);\r\n\r\n var bottom = top.clone();\r\n bottom.material = (bottom.material).clone();\r\n //bottom.material.map = (maps.bottom);\r\n (bottom.material as THREE.RawShaderMaterial).uniforms[\"map\"].value = (maps.bottom);\r\n bottom.position.set(0, 0, -0.5);\r\n bottom.rotation.x = Math.PI;\r\n rotated.add(bottom);\r\n\r\n var front = top.clone();\r\n front.material = (front.material).clone();\r\n //front.material.map = (maps.front);\r\n (front.material as THREE.RawShaderMaterial).uniforms[\"map\"].value = (maps.front);\r\n front.position.set(0, -0.5, 0);\r\n front.rotation.x = pi2;\r\n rotated.add(front);\r\n\r\n var back = top.clone();\r\n back.material = (back.material).clone();\r\n //back.material.map = (maps.back);\r\n (back.material as THREE.RawShaderMaterial).uniforms[\"map\"].value = (maps.back);\r\n back.position.set(0, 0.5, 0);\r\n back.rotation.x = pi2;\r\n back.rotation.y = Math.PI;\r\n rotated.add(back);\r\n\r\n var left = top.clone();\r\n left.material = (left.material).clone();\r\n //left.material.map = (maps.left);\r\n (left.material as THREE.RawShaderMaterial).uniforms[\"map\"].value = (maps.left);\r\n left.position.set(-0.5, 0, 0);\r\n left.rotation.x = pi2;\r\n left.rotation.y = -pi2;\r\n rotated.add(left);\r\n\r\n var right = top.clone();\r\n right.material = (right.material).clone();\r\n //right.material.map = (maps.right);\r\n (right.material as THREE.RawShaderMaterial).uniforms[\"map\"].value = (maps.right);\r\n right.position.set(0.5, 0, 0);\r\n right.rotation.x = pi2;\r\n right.rotation.y = pi2;\r\n rotated.add(right);\r\n\r\n var sides = [top, bottom, front, back, left, right];\r\n\r\n for (var i = 0, j = sides.length; i < j; i++) {\r\n var side = sides[i],\r\n map = (side.material as THREE.RawShaderMaterial).uniforms[\"map\"].value;\r\n //map = side.material.map;\r\n if (map)\r\n map.magFilter = map.minFilte = THREE.LinearFilter;\r\n (side)._useUv = true;\r\n }\r\n\r\n (top)._norm = new THREE.Vector3(0, 0, 1);\r\n (bottom)._norm = new THREE.Vector3(0, 0, -1);\r\n (front)._norm = new THREE.Vector3(0, -1, 0);\r\n (back)._norm = new THREE.Vector3(0, 1, 0);\r\n (left)._norm = new THREE.Vector3(-1, 0, 0);\r\n (right)._norm = new THREE.Vector3(1, 0, 0);\r\n\r\n //Highligt sides----------------------\r\n \r\n var ui = sides.slice(0);\r\n\r\n var highlights = new THREE.Object3D();\r\n highlights.visible = false;\r\n this.add(highlights);\r\n this._highlights = highlights;\r\n\r\n var highlightsRotated = new THREE.Object3D();\r\n highlightsRotated.visible = false;\r\n rotated.add(highlightsRotated);\r\n this._highlightsRotated = highlightsRotated;\r\n\r\n var side = new THREE.Mesh(planeTopGeometry, sidesHoverMat);\r\n\r\n side.renderOrder = renderOrder+1;\r\n side.frustumCulled = false;\r\n highlightsRotated.add(side);\r\n\r\n side = side.clone();\r\n side.rotation.x = pi2;\r\n highlightsRotated.add(side);\r\n\r\n side = side.clone();\r\n side.rotation.z = pi2;\r\n highlightsRotated.add(side);\r\n\r\n //side = side.clone();\r\n //side.rotation.z = Math.PI;\r\n //highlightsRotated.add(side);\r\n\r\n side = side.clone();\r\n side.rotation.z = -pi2;\r\n highlightsRotated.add(side);\r\n\r\n side = side.clone();\r\n side.rotation.z = 0;\r\n side.rotation.x = Math.PI;\r\n highlightsRotated.add(side);\r\n\r\n var clone4 = (tObj, src, k) => {\r\n var n = src.clone();\r\n n.rotation[k] = pi2;\r\n tObj.add(n);\r\n\r\n n = src.clone();\r\n n.rotation[k] = Math.PI;\r\n tObj.add(n);\r\n\r\n n = src.clone();\r\n n.rotation[k] = -pi2;\r\n tObj.add(n);\r\n };\r\n\r\n //edges\r\n var edge = new THREE.Mesh(edgeGeometry, sidesHoverMat);\r\n edge.renderOrder = renderOrder+1;\r\n edge.frustumCulled = false;\r\n highlightsRotated.add(edge);\r\n\r\n clone4(highlightsRotated, edge, 'z');\r\n\r\n edge = edge.clone();\r\n edge.rotation.x = pi2;\r\n highlightsRotated.add(edge);\r\n clone4(highlightsRotated, edge, 'y');\r\n\r\n //edge = edge.clone();\r\n //edge.rotation.x = -pi2;\r\n //highlightsRotated.add(edge);\r\n //clone4(highlightsRotated, edge, 'y');\r\n\r\n //corners\r\n var corner = new THREE.Mesh(cornerGeometry, sidesHoverMat);\r\n corner.renderOrder = renderOrder+1;\r\n corner.frustumCulled = false;\r\n highlightsRotated.add(corner);\r\n\r\n clone4(highlightsRotated, corner, 'z');\r\n \r\n //corner = corner.clone();\r\n //corner.rotation.x = -pi2;\r\n //highlightsRotated.add(corner);\r\n //clone4(highlightsRotated, corner, 'y');\r\n\r\n //Highligt sides end------------------\r\n \r\n //compass elements\r\n\r\n this._maps = maps;\r\n\r\n var compass = new THREE.Mesh(compassGeometry, compassMat);\r\n compass.rotation.x = pi2;\r\n compass.renderOrder = renderOrder+2;\r\n compass.frustumCulled = false;\r\n this._compass = compass;\r\n rotated.add(compass);\r\n\r\n var pointer = new THREE.Mesh(pointerGeometry, stdMat.clone());\r\n pointer.rotation.x = pi2;\r\n pointer.renderOrder = renderOrder;\r\n pointer.frustumCulled = false;\r\n (pointer)._side = 1;\r\n pointers.add(pointer);\r\n\r\n pointer = pointer.clone();\r\n pointer.rotation.y = pi2;\r\n (pointer)._side = 2;\r\n pointers.add(pointer);\r\n\r\n pointer = pointer.clone();\r\n pointer.rotation.y = -pi2;\r\n (pointer)._side = 4;\r\n pointers.add(pointer);\r\n\r\n pointer = pointer.clone();\r\n pointer.rotation.y = Math.PI;\r\n (pointer)._side = 3;\r\n pointers.add(pointer);\r\n\r\n this._lowerPointer = pointer;\r\n this._pointerMat = pointer.material as THREE.MeshBasicMaterial;\r\n\r\n for (var l = 0, m = pointers.children.length; l < m; l++) {\r\n var pt = pointers.children[l] as THREE.Mesh;\r\n var pth = pt.clone();\r\n pth.material = hoverMat;\r\n pth.position.z = 0.01;\r\n (pt)._highlight = pth;\r\n highlights.add(pth);\r\n ui.push(pt);\r\n }\r\n\r\n //HOME\r\n var home = new THREE.Mesh(homeGeometry, currentTheme === \"Tritec\" ? hoverMat : stdMat);\r\n home.rotation.x = pi2;\r\n home.renderOrder = renderOrder;\r\n home.frustumCulled = false;\r\n (home)._resetView = true;\r\n (home)._norm = new THREE.Vector3(0, 0, 1);\r\n this.add(home);\r\n ui.push(home);\r\n\r\n var homeHighlight = home.clone();\r\n homeHighlight.material = hoverMat;\r\n homeHighlight.position.z = 0.01;\r\n (home)._highlight = homeHighlight;\r\n highlights.add(homeHighlight);\r\n\r\n //ROLLING\r\n\r\n var rolls: THREE.Mesh[] = [];\r\n\r\n var roll = new THREE.Mesh(rollGeometry, stdMat);\r\n roll.rotation.x = pi2;\r\n roll.renderOrder = renderOrder;\r\n roll.frustumCulled = false;\r\n (roll)._roll = 1;\r\n ui.push(roll);\r\n rolls.push(roll);\r\n this.add(roll);\r\n\r\n var rollHighlight = roll.clone();\r\n rollHighlight.material = hoverMat;\r\n rollHighlight.position.z = 0.01;\r\n (roll)._highlight = rollHighlight;\r\n highlights.add(rollHighlight);\r\n\r\n roll = new THREE.Mesh(rollGeometry2, stdMat);\r\n roll.rotation.x = pi2;\r\n roll.renderOrder = renderOrder;\r\n roll.frustumCulled = false;\r\n (roll)._roll = -1;\r\n ui.push(roll);\r\n rolls.push(roll);\r\n this.add(roll);\r\n\r\n rollHighlight = roll.clone();\r\n rollHighlight.material = hoverMat;\r\n rollHighlight.position.z = 0.01;\r\n (roll)._highlight = rollHighlight;\r\n highlights.add(rollHighlight);\r\n\r\n //DROPWDOWN\r\n\r\n //var dropdown = new THREE.Mesh(dropdownGeometry, stdMat);\r\n //dropdown.rotation.x = pi2;\r\n //dropdown.renderOrder = renderOrder;\r\n //dropdown.frustumCulled = false;\r\n //(dropdown)._click = ToolBox.toggleNavDropdown;\r\n //this.add(dropdown);\r\n //ui.push(dropdown);\r\n\r\n //var dropdownHighlight = dropdown.clone();\r\n //dropdownHighlight.material = hoverMat;\r\n //dropdownHighlight.position.z = 0.01;\r\n //(dropdown)._highlight = dropdownHighlight;\r\n //highlights.add(dropdownHighlight);\r\n\r\n this._rolls = rolls;\r\n this._sides = sides;\r\n this._ui = ui;\r\n\r\n if (hideControls) {\r\n rolls.forEach((m: THREE.Object3D) => {\r\n m.visible = false;\r\n });\r\n pointers.children.forEach((m: THREE.Object3D) => {\r\n m.visible = false;\r\n });\r\n pointers.visible = false;\r\n highlights.visible = false;\r\n //dropdown.visible = false;\r\n home.visible = false;\r\n roll.visible = false;\r\n this._lowerPointer.visible = false;\r\n }\r\n\r\n //DEBUG\r\n //var dGeo = new THREE.BoxGeometry(2, 0.5, 1, 1, 1, 1);\r\n //var dMat = new THREE.MeshBasicMaterial({\r\n // color: 0xFF0000,\r\n // transparent: true\r\n //});\r\n //var dMesh = new THREE.Mesh(dGeo, dMat);\r\n //dMesh.renderOrder = renderOrder+3;\r\n //this.add(dMesh);\r\n }\r\n\r\n UpdateOrientation = (() => {\r\n var rotmat = new THREE.Matrix4();\r\n return () => {\r\n var camera = this._camera,\r\n uiCamera = this._uiCamera,\r\n paddingPx = this._paddingPx,\r\n maxSizePx = this._maxSizePx,\r\n pos = this.position;\r\n\r\n camera.matrixWorldInverse.getInverse(camera.matrixWorld);\r\n rotmat.extractRotation(camera.matrixWorldInverse);\r\n this._rotatedRoot.setRotationFromMatrix(rotmat);\r\n\r\n var t = Math.ceil(maxSizePx + paddingPx),\r\n t2 = t * 2;\r\n pos.set(uiCamera.right - t, uiCamera.top - t, 0);\r\n this._minPos.set((uiCamera.right - t2) / uiCamera.right, (uiCamera.top - t2) / uiCamera.top);\r\n\r\n var cn = camera.getWorldDirection(new THREE.Vector3()),\r\n pointerMat = this._pointerMat;\r\n\r\n var wx = this._worldX.dot(cn);\r\n var wy = this._worldY.dot(cn);\r\n var wz = this._worldZ.dot(cn);\r\n\r\n var pOpacity = (1.0 - Math.min(((Math.abs(wx) + Math.abs(wy) + Math.abs(wz)) - 1.0) * 5, 1.0)) * 0.8;\r\n\r\n if (pointerMat.opacity !== pOpacity) {\r\n pointerMat.opacity = pOpacity;\r\n pointerMat.needsUpdate = true;\r\n this._pointers.visible = pOpacity > 0.01;\r\n }\r\n \r\n //hide lower pointer\r\n if (!this._hideControls) {\r\n var lpVisible = wz < -0.999;\r\n var lp = this._lowerPointer;\r\n if (lp.visible !== lpVisible)\r\n lp.visible = lpVisible;\r\n\r\n var rolls = this._rolls;\r\n for (var i = rolls.length; i--;) {\r\n if (rolls[i].visible !== lpVisible)\r\n rolls[i].visible = lpVisible;\r\n }\r\n }\r\n };\r\n })();\r\n\r\n SetCompassOrientation(degree: number) {\r\n (this._compass).rotation.y = THREE.MathUtils.degToRad(degree - 180);\r\n }\r\n\r\n GetCompassOrientation() {\r\n return THREE.MathUtils.radToDeg((this._compass).rotation.y) + 180;\r\n }\r\n\r\n SetElevationAngle(angle: THREE.Quaternion) {\r\n var quat = new THREE.Quaternion().copy(angle).inverse();\r\n this._rotatedObjects.quaternion.copy(quat);\r\n this._worldX.set(1, 0, 0).applyQuaternion(quat);\r\n this._worldY.set(0, 1, 0).applyQuaternion(quat);\r\n this._worldZ.set(0, 0, 1).applyQuaternion(quat);\r\n \r\n //var radx = THREE.MathUtils.degToRad(-degree);\r\n //var rady = THREE.MathUtils.degToRad(0);\r\n //this._rotatedObjects.rotation.x = radx;\r\n //this._rotatedObjects.rotation.y = rady;\r\n //this._worldZ.set(0, 0, 1).applyEuler(new THREE.Euler(radx, rady, 0));\r\n //this._worldY.copy(this._worldZ).cross(this._worldX).normalize();\r\n }\r\n\r\n setHovering(b: boolean) {\r\n if (this._isHovering !== b) {\r\n if (b)\r\n Controller.Current.viewModel.Cursor = 'pointer';\r\n else\r\n Controller.Current.viewModel.Cursor = Controller.Current.viewModel.GetCurrentDefaultCursor();\r\n this._isHovering = b;\r\n }\r\n }\r\n\r\n onMouseMove(mouse: { x: number; y: number; }) {\r\n var minPos = this._minPos,\r\n highlightsRotated = this._highlightsRotated,\r\n highlights = this._highlights;\r\n\r\n if (mouse.x < minPos.x || mouse.y < minPos.y) {\r\n if (highlights.visible || highlightsRotated.visible) {\r\n highlights.visible = false;\r\n highlightsRotated.visible = false;\r\n }\r\n this.setHovering(false);\r\n return;\r\n }\r\n\r\n var uiCamera = this._uiCamera,\r\n raycaster = this._raycaster;\r\n\r\n raycaster.setFromCamera(mouse, uiCamera);\r\n\r\n var intersecs = raycaster.intersectObjects(this._ui.filter((ui) => { return ui.visible && (ui.material).opacity > 0.1; }));\r\n if (!intersecs.length) {\r\n if (highlights.visible || highlightsRotated.visible) {\r\n highlights.visible = false;\r\n highlightsRotated.visible = false;\r\n }\r\n this.setHovering(false);\r\n return;\r\n }\r\n\r\n //highlights.children.forEach(function (hs) { hs.visible = true; });\r\n //var highlightIntersecs = raycaster.intersectObjects(highlights.children.filter(function (ui) { return ui.visible && ui.material.opacity > 0.1; }));\r\n var highlightIntersecs = intersecs.map((i) => { return (i.object)._highlight as THREE.Mesh; }).filter((i) => { return !!i; });\r\n\r\n if (highlightIntersecs.length) {\r\n var hIntersec = highlightIntersecs[0];\r\n highlights.visible = true;\r\n highlights.children.forEach((hs) => { hs.visible = false; });\r\n hIntersec.visible = true;\r\n if (highlightsRotated.visible) highlightsRotated.visible = false;\r\n this.setHovering(true);\r\n } else {\r\n highlightsRotated.children.forEach((hs) => { hs.visible = true; });\r\n var hlIntersecs = raycaster.intersectObjects(highlightsRotated.children);\r\n\r\n if (hlIntersecs.length) {\r\n var hlIntersec = hlIntersecs[0];\r\n highlightsRotated.visible = true;\r\n highlightsRotated.children.forEach((hs) => { hs.visible = false; });\r\n hlIntersec.object.visible = true;\r\n if (highlights.visible) highlights.visible = false;\r\n this.setHovering(true);\r\n } else {\r\n if (highlights.visible || highlightsRotated.visible) {\r\n highlights.visible = false;\r\n highlightsRotated.visible = false;\r\n }\r\n this.setHovering(false);\r\n }\r\n }\r\n }\r\n\r\n handleMouseDown = (() => {\r\n var cameraNormal = new THREE.Vector3();\r\n var targetNormal = new THREE.Vector3();\r\n var targetUpNormal = new THREE.Vector3();\r\n var targetRight = new THREE.Vector3();\r\n var roofRotation = new THREE.Quaternion();\r\n return (mouse: THREE.Vector2, controls: CameraControls, controller: LS.Client3DEditor.Controller) => {\r\n var minPos = this._minPos;\r\n if (mouse.x < minPos.x || mouse.y < minPos.y)\r\n return false;\r\n\r\n var camera = this._camera,\r\n uiCamera = this._uiCamera,\r\n raycaster = this._raycaster;\r\n\r\n raycaster.setFromCamera(mouse, uiCamera);\r\n\r\n var intersecs = raycaster.intersectObjects(this._ui.filter(ui => ui.visible && (ui.material).opacity > 0.1));\r\n if (!intersecs.length)\r\n return false;\r\n \r\n var highlights = this._highlights;\r\n if (highlights.visible) highlights.visible = false;\r\n\r\n var intersection = intersecs[0];\r\n\r\n if ((intersection.object)._click) {\r\n (intersection.object)._click();\r\n return true;\r\n }\r\n\r\n if ((intersection.object)._resetView) {\r\n Controller.Current.resetView();\r\n return true;\r\n }\r\n\r\n //var resetView = !!(intersection.object)._resetView;\r\n var useUv = !!(intersection.object)._useUv;\r\n\r\n camera.getWorldDirection(cameraNormal).negate();\r\n\r\n controls.rollEnd.copy(camera.up);\r\n\r\n if ((intersection.object)._roll) {\r\n targetUpNormal.crossVectors(camera.up, cameraNormal).normalize().multiplyScalar((intersection.object)._roll);\r\n\r\n targetNormal.copy(cameraNormal);\r\n\r\n controls.rotateStart.copy(targetNormal);\r\n controls.rotateEnd.copy(cameraNormal);\r\n\r\n controls.rollStart.copy(targetUpNormal);\r\n\r\n return true;\r\n }\r\n\r\n if ((intersection.object)._norm)\r\n targetNormal.copy((intersection.object)._norm);\r\n else\r\n spt.ThreeJs.utils.toNearestAxisNormal(cameraNormal, targetNormal);\r\n \r\n spt.ThreeJs.utils.getUpNormal(targetNormal, targetUpNormal);\r\n\r\n if ((intersection.object)._side) {\r\n switch ((intersection.object)._side) {\r\n case 1:\r\n targetNormal.copy(targetUpNormal);\r\n break;\r\n case 2:\r\n targetNormal.crossVectors(targetUpNormal, targetNormal).normalize().negate();\r\n break;\r\n case 3:\r\n targetNormal.copy(targetUpNormal).negate();\r\n break;\r\n case 4:\r\n targetNormal.crossVectors(targetUpNormal, targetNormal).normalize();\r\n break;\r\n }\r\n targetUpNormal = spt.ThreeJs.utils.getUpNormal(targetNormal);\r\n }\r\n\r\n targetRight.crossVectors(targetUpNormal, targetNormal).normalize();\r\n\r\n var uvDist = this._uvDist,\r\n uvDistU = this._uvDistU;\r\n\r\n var isTop = targetNormal.z > 0.1,\r\n isBottom = targetNormal.z < -0.1,\r\n uv = (intersection).uv,\r\n toLeft = useUv && uv.x <= uvDist,\r\n toRight = useUv && uv.x >= uvDistU,\r\n toBottom = useUv && uv.y <= uvDist,\r\n toTop = useUv && uv.y >= uvDistU;\r\n\r\n if (toLeft)\r\n targetNormal.sub(targetRight);\r\n if (toRight)\r\n targetNormal.add(targetRight);\r\n if (toBottom)\r\n targetNormal.sub(targetUpNormal);\r\n if (toTop)\r\n targetNormal.add(targetUpNormal);\r\n targetNormal.normalize();\r\n\r\n if ((!isTop && !isBottom) || toLeft || toRight || toBottom || toTop)\r\n targetUpNormal.set(0, 0, -1).cross(targetNormal).normalize().cross(targetNormal).normalize();\r\n\r\n if (targetNormal.z < 0)\r\n return false;\r\n\r\n //if (resetView) {\r\n // var roofyAngle = Math.atan2(this._worldZ.x, this._worldZ.z),\r\n // roofyAngleDegree = Math.abs(roofyAngle / Math.PI * 180),\r\n // roofxAngle = Math.atan2(this._worldZ.y, this._worldZ.z),\r\n // roofxAngleDegree = -roofxAngle / Math.PI * 180;\r\n \r\n // if (roofxAngleDegree > 0 && roofxAngleDegree < 45)\r\n // targetNormal.applyAxisAngle(new THREE.Vector3(1, 0, 0), -roofxAngle);\r\n\r\n // if (roofyAngleDegree > 0 && roofyAngleDegree < 45)\r\n // targetNormal.applyAxisAngle(new THREE.Vector3(0,1,0), roofyAngle);\r\n //}\r\n\r\n controls.rotateStart.copy(targetNormal);\r\n controls.rotateEnd.copy(cameraNormal);\r\n\r\n controls.rollStart.copy(targetUpNormal);\r\n\r\n //if (resetView) {\r\n // var rw = controller.roofWidth,\r\n // rh = controller.roofHeight,\r\n // rw2 = rw / 2,\r\n // rh2 = rh / 2,\r\n // target = controls.target;\r\n\r\n // controls.zoomStart = camera.zoom;\r\n // controls.zoomEnd = Math.min((controller.ContainerWidth - controller.CameraPadding) / rw, (controller.ContainerHeight - controller.CameraPadding) / rh);\r\n\r\n // controls.panStart.set(0, 0);\r\n // controls.panEnd.set(0, 0);\r\n\r\n // controls.moveStart.copy(target);\r\n // controls.moveEnd.set(rw2, rh2, 0);\r\n //} else {\r\n roofRotation.setFromEuler(this._rotatedObjects.rotation);\r\n\r\n controls.rotateStart.applyQuaternion(roofRotation);\r\n controls.rollStart.applyQuaternion(roofRotation);\r\n //}\r\n setTimeout(this.onMouseMove.bind(this, mouse), 0);\r\n return true;\r\n };\r\n })();\r\n }\r\n}","interface Window {\r\n CheckStaticAndLoadBackup: () => void;\r\n ReDrawConstruction: (checkstatic?: boolean) => void;\r\n DrawStaticOnLoad: (checkstatic?: boolean) => void;\r\n GetCurrentCADLayersUri: (seperator?: string) => string;\r\n GetCurrentCameraMvmUri: (seperator?: string) => string;\r\n ShowAo3dHelp: () => void;\r\n}\r\n\r\nmodule LS.Client3DEditor {\r\n export function switchToAnordnung(e?: JQueryEventObject) {\r\n if (e)\r\n e.preventDefault();\r\n\r\n if (window.EditorViewMode === \"Anordnung\" || LoaderManager.isLoading()) {\r\n DManager.Navigate($('#_itemAnordnung').attr(\"href\"));\r\n return;\r\n }\r\n var viewModel = Controller.Current.viewModel;\r\n\r\n if (viewModel && ToolBox && viewModel.FlyoutVisible) {\r\n viewModel.ShowInverterFlyout = false;\r\n ToolBox.toggleFlyout();\r\n }\r\n if (viewModel && viewModel.selectedTool) {\r\n viewModel.deselectTool();\r\n ko.tasks.runEarly();\r\n setTimeout(() => { switchToAnordnung(); }, 0);\r\n return;\r\n }\r\n\r\n if (window[\"OnEnd\" + window.EditorViewMode])\r\n window[\"OnEnd\" + window.EditorViewMode]();\r\n\r\n //See AnordnungController Edit\r\n window.EditorViewMode = \"Anordnung\";\r\n\r\n LoaderManager.addLoadingJob();\r\n\r\n $.ajax({\r\n url: \"/Anordnung/PartialAnordnung\", type: \"POST\", dataType: \"html\",\r\n context: document.body,\r\n data: {},\r\n contentType: \"application/json\",\r\n success: (html) => {\r\n if (html) {\r\n var controller = Controller.Current;\r\n controller.updateManager.clearHistory();\r\n controller.clearClientObjects(true);\r\n //controller.removeRoofObject();\r\n\r\n //history.pushState({ page: \"/Anordnung/Edit\" }, document.title, \"/Anordnung/Edit?pid=\" + spt.Utils.GenerateGuid());\r\n history.pushState({ page: \"/Anordnung/Edit\" }, document.title, \"/Anordnung/Edit\");\r\n\r\n var $html = $(html),\r\n $cmenu = $html.filter(\"#ao-cmenu-content\"),\r\n $tb = $html.filter(\"#ao-toolbox-content\"),\r\n $progress = $html.filter(\"#ao-progress-content\");\r\n\r\n var $flyOutContainer = $('#ao-tools-overview');\r\n ko.cleanNode($flyOutContainer.get(0));\r\n $flyOutContainer.empty().append($tb.contents());\r\n ko.applyBindings(controller.viewModel, $flyOutContainer.get(0));\r\n controller.viewModel.EditorViewMode = window.EditorViewMode;\r\n\r\n clearExtraContent();\r\n\r\n ThemeManager.ResetTheme(\"Anordnung\");\r\n\r\n $('#clientEditor-contextmenu').empty().append($cmenu.contents());\r\n controller.loadAnordnungObjects();\r\n\r\n $html.empty();\r\n\r\n if (window[\"OnStart\" + window.EditorViewMode])\r\n window[\"OnStart\" + window.EditorViewMode]();\r\n\r\n LoaderManager.finishLoadingJob();\r\n\r\n } else\r\n DManager.Navigate('/home/index');\r\n },\r\n error: (jqXHR, textStatus, errorThrown) => {\r\n DManager.Navigate('/home/index');\r\n }\r\n });\r\n }\r\n\r\n export function switchToAutoCad(e?: JQueryEventObject) {\r\n if (e)\r\n e.preventDefault();\r\n\r\n //var initDialogs = !$('#ScaleContainer').length;\r\n\r\n if (window.EditorViewMode === \"AutoCAD\" || LoaderManager.isLoading()) {\r\n DManager.Navigate($('#_itemAutoCAD').attr(\"href\"));\r\n return;\r\n }\r\n\r\n var viewModel = Controller.Current.viewModel;\r\n\r\n if (viewModel && ToolBox && viewModel.FlyoutVisible) {\r\n viewModel.ShowInverterFlyout = false;\r\n ToolBox.toggleFlyout();\r\n }\r\n if (viewModel && viewModel.selectedTool) {\r\n viewModel.deselectTool();\r\n ko.tasks.runEarly();\r\n setTimeout(() => { switchToAutoCad(); }, 0);\r\n return;\r\n }\r\n\r\n if (window[\"OnEnd\" + window.EditorViewMode])\r\n window[\"OnEnd\" + window.EditorViewMode]();\r\n\r\n //See AutoCADController Edit\r\n window.EditorViewMode = \"AutoCAD\";\r\n\r\n LoaderManager.addLoadingJob();\r\n\r\n $.ajax({\r\n url: \"/AutoCAD/PartialAutoCad\", type: \"POST\", dataType: \"html\",\r\n context: document.body,\r\n data: {},\r\n contentType: \"application/json\",\r\n success: (html) => {\r\n\r\n if (html) {\r\n var controller = Controller.Current;\r\n controller.updateManager.clearHistory();\r\n controller.clearClientObjects(true);\r\n //controller.removeRoofObject();\r\n\r\n //history.pushState({ page: \"/AutoCAD/Edit\" }, document.title, \"/AutoCAD/Edit?pid=\" + spt.Utils.GenerateGuid());\r\n history.pushState({ page: \"/AutoCAD/Edit\" }, document.title, \"/AutoCAD/Edit\");\r\n\r\n var $html = $(html),\r\n $cmenu = $html.filter(\"#cad-cmenu-content\"),\r\n $tb = $html.filter(\"#cad-layers-content\");\r\n\r\n var $flyOutContainer = $('#ao-tools-overview');\r\n ko.cleanNode($flyOutContainer.get(0));\r\n $flyOutContainer.empty().append($tb.contents());\r\n ko.applyBindings(controller.viewModel, $flyOutContainer.get(0));\r\n controller.viewModel.EditorViewMode = window.EditorViewMode;\r\n\r\n clearExtraContent();\r\n\r\n ThemeManager.ResetTheme(\"AutoCAD\");\r\n\r\n $('#clientEditor-contextmenu').empty().append($cmenu.contents());\r\n controller.loadCADObjects(true, true);\r\n\r\n $html.empty();\r\n\r\n if ($('#ScaleContainer').length)\r\n DManager.init('ScaleContainer', 400, \"auto\", SetWidthDialogTitleBarWidth, SetPaddingBack);\r\n\r\n if (window[\"OnStart\" + window.EditorViewMode])\r\n window[\"OnStart\" + window.EditorViewMode]();\r\n\r\n LoaderManager.finishLoadingJob();\r\n } else\r\n DManager.Navigate('/home/index');\r\n },\r\n error: (jqXHR, textStatus, errorThrown) => {\r\n DManager.Navigate('/home/index');\r\n }\r\n });\r\n }\r\n\r\n export function switchToStatic(e?: JQueryEventObject) {\r\n if (e)\r\n e.preventDefault();\r\n\r\n //var initDialogs = !$('#ScaleContainer').length;\r\n\r\n if (window.EditorViewMode === \"Static\" || LoaderManager.isLoading()) {\r\n DManager.Navigate($('#_itemStatic').attr(\"href\"));\r\n return;\r\n }\r\n\r\n var viewModel = Controller.Current.viewModel;\r\n\r\n if (viewModel && ToolBox && viewModel.FlyoutVisible) {\r\n viewModel.ShowInverterFlyout = false;\r\n ToolBox.toggleFlyout();\r\n }\r\n if (viewModel && viewModel.selectedTool) {\r\n viewModel.deselectTool();\r\n ko.tasks.runEarly();\r\n setTimeout(() => { switchToStatic(); }, 0);\r\n return;\r\n }\r\n\r\n if (window[\"OnEnd\" + window.EditorViewMode])\r\n window[\"OnEnd\" + window.EditorViewMode]();\r\n\r\n //See StaticController Edit\r\n window.EditorViewMode = \"Static\";\r\n\r\n LoaderManager.addLoadingJob();\r\n\r\n $.ajax({\r\n url: \"/Static/PartialStatic\", type: \"POST\", dataType: \"html\",\r\n context: document.body,\r\n data: {},\r\n contentType: \"application/json\",\r\n success: (html) => {\r\n\r\n if (html) {\r\n var controller = Controller.Current;\r\n controller.updateManager.clearHistory();\r\n controller.clearClientObjects(true);\r\n //controller.removeRoofObject();\r\n\r\n //history.pushState({ page: \"/Static/Edit\" }, document.title, \"/Static/Edit?pid=\" + spt.Utils.GenerateGuid());\r\n history.pushState({ page: \"/Static/Edit\" }, document.title, \"/Static/Edit\");\r\n\r\n var $html = $(html),\r\n $cmenu = $html.filter(\"#static-cmenu-content\"),\r\n $tb = $html.filter(\"#static-layers-content\");\r\n\r\n var $flyOutContainer = $('#ao-tools-overview');\r\n ko.cleanNode($flyOutContainer.get(0));\r\n $flyOutContainer.empty().append($tb.contents());\r\n ko.applyBindings(controller.viewModel, $flyOutContainer.get(0));\r\n controller.viewModel.EditorViewMode = window.EditorViewMode;\r\n\r\n clearExtraContent();\r\n\r\n ThemeManager.ResetTheme(\"Static\");\r\n\r\n $('#clientEditor-contextmenu').empty().append($cmenu.contents());\r\n controller.loadStaticObjects(true, true);\r\n\r\n $html.empty();\r\n\r\n if (window[\"OnStart\" + window.EditorViewMode])\r\n window[\"OnStart\" + window.EditorViewMode]();\r\n\r\n LoaderManager.finishLoadingJob();\r\n } else\r\n DManager.Navigate('/home/index');\r\n },\r\n error: (jqXHR, textStatus, errorThrown) => {\r\n DManager.Navigate('/home/index');\r\n }\r\n });\r\n\r\n }\r\n\r\n export function switchToElectric(e?: JQueryEventObject) {\r\n if (e)\r\n e.preventDefault();\r\n\r\n if (window.EditorViewMode === \"Electric\" || LoaderManager.isLoading()) {\r\n DManager.Navigate($('#_itemElectric').attr(\"href\"));\r\n return;\r\n }\r\n var viewModel = Controller.Current.viewModel;\r\n if (viewModel && ToolBox && viewModel.FlyoutVisible) {\r\n viewModel.ShowInverterFlyout = false;\r\n ToolBox.toggleFlyout();\r\n }\r\n if (viewModel && viewModel.selectedTool) {\r\n viewModel.deselectTool();\r\n ko.tasks.runEarly();\r\n setTimeout(() => { switchToElectric(); }, 0);\r\n return;\r\n }\r\n\r\n if (window[\"OnEnd\" + window.EditorViewMode])\r\n window[\"OnEnd\" + window.EditorViewMode]();\r\n\r\n //See ElectricController Edit\r\n window.EditorViewMode = \"Electric\";\r\n\r\n LoaderManager.addLoadingJob();\r\n\r\n $.ajax({\r\n url: \"/Electric/Electric/PartialElectric\", type: \"POST\", dataType: \"html\",\r\n context: document.body,\r\n data: {},\r\n contentType: \"application/json\",\r\n success: (html) => {\r\n if (html) {\r\n var controller = Controller.Current;\r\n controller.updateManager.clearHistory();\r\n controller.clearClientObjects(true);\r\n //controller.removeRoofObject();\r\n\r\n //history.pushState({ page: \"/Electric/Electric/Edit\" }, document.title, \"/Electric/Electric/Edit?pid=\" + spt.Utils.GenerateGuid());\r\n history.pushState({ page: \"/Electric/Electric/Edit\" }, document.title, \"/Electric/Electric/Edit\");\r\n\r\n var $html = $(html),\r\n $cmenu = $html.filter(\"#electric-cmenu-content\"),\r\n $tb = $html.filter(\"#electric-toolbox-content\"),\r\n $bc = $html.filter(\"#electric-body-content\");\r\n\r\n var $flyOutContainer = $('#ao-tools-overview');\r\n ko.cleanNode($flyOutContainer.get(0));\r\n $flyOutContainer.empty().append($tb.contents());\r\n ko.applyBindings(controller.viewModel, $flyOutContainer.get(0));\r\n controller.viewModel.EditorViewMode = window.EditorViewMode;\r\n\r\n clearExtraContent();\r\n\r\n $('#ao-extra-content').append($bc.contents());\r\n\r\n ThemeManager.ResetTheme(\"Electric\");\r\n\r\n $('#clientEditor-contextmenu').empty().append($cmenu.contents());\r\n\r\n $html.empty();\r\n\r\n if ($('#ScaleContainer').length)\r\n DManager.init('ScaleContainer', 400, \"auto\", SetWidthDialogTitleBarWidth, SetPaddingBack);\r\n\r\n controller.loadElectricObjects(true, () => {\r\n if (window[\"OnStart\" + window.EditorViewMode])\r\n window[\"OnStart\" + window.EditorViewMode]();\r\n });\r\n\r\n LoaderManager.finishLoadingJob();\r\n\r\n } else\r\n DManager.Navigate('/home/index');\r\n },\r\n error: (jqXHR, textStatus, errorThrown) => {\r\n DManager.Navigate('/home/index');\r\n }\r\n });\r\n }\r\n\r\n export function clearExtraContent() {\r\n $('#infoPlaceholder').empty();\r\n $('#electric-body-content').empty();\r\n }\r\n \r\n //Global window functions\r\n\r\n window.ReDrawConstruction = (checkstatic?: boolean) => {\r\n var controller = Controller.Current;\r\n controller.updateManager.clearHistory();\r\n controller.clearClientObjects(true);\r\n switch (window.EditorViewMode) {\r\n case \"Static\":\r\n controller.loadStaticObjects(false, checkstatic);\r\n break;\r\n default: //case \"AutoCAD\":\r\n controller.loadCADObjects(false, checkstatic);\r\n break;\r\n }\r\n };\r\n\r\n window.GetCurrentCADLayersUri = (seperator?: string) => {\r\n var layers = [];\r\n $('input[name=Layer]:checked').each((idx, elem) => {\r\n var val = $(elem).val() as string;\r\n if (val.indexOf('|') != -1) {\r\n layers.push(val.split('|')[0]);\r\n layers.push(val.split('|')[1]);\r\n }\r\n else {\r\n layers.push($(elem).val());\r\n }\r\n\r\n });\r\n if (!seperator)\r\n seperator = \"?\";\r\n if (layers.length) {\r\n return seperator + \"layer=\" + layers.join(\"+\");\r\n }\r\n return seperator + \"layer=+\";\r\n };\r\n\r\n window.GetCurrentCameraMvmUri = (seperator?: string) => {\r\n if (!seperator)\r\n seperator = \"?\";\r\n if (Controller.Current && Controller.Current.orthoCamera) {\r\n var m = Controller.Current.orthoCamera.matrixWorldInverse;\r\n if (m)\r\n return seperator + \"mvm=\" + spt.Utils.arrayFrom(m.elements).join(\"+\");\r\n }\r\n return seperator + \"mvm=+\";\r\n };\r\n\r\n window.DrawStaticOnLoad = (checkstatic?: boolean) => {\r\n window.ReDrawConstruction(checkstatic);\r\n };\r\n\r\n window.CheckStaticAndLoadBackup = () => {\r\n if (!isElevation) {\r\n window.CheckStatic();\r\n } else {\r\n AManager.Ajax('AppServices.asmx', 'CheckLoadBackup', \"{}\", (result) => {\r\n if (result) {\r\n DManager.showErrorMessage(result);\r\n }\r\n });\r\n }\r\n };\r\n\r\n window.ShowAo3dHelp = () => {\r\n LoaderManager.addLoadingJob();\r\n $.ajax({\r\n url: \"/Anordnung/GetAO3DHelpDialog\",\r\n type: \"POST\",\r\n dataType: \"html\",\r\n data: {},\r\n success: (data) => {\r\n $('#ao3dHelpDialog').html(data);\r\n DManager.show('ao3dHelpDialog');\r\n LoaderManager.finishLoadingJob();\r\n },\r\n error: (jqXHR, textStatus, errorThrown) => {\r\n LoaderManager.finishLoadingJob();\r\n OnError(jqXHR, textStatus + \" on \" + \"/Anordnung/GetAO3DHelpDialog\", errorThrown);\r\n }\r\n });\r\n };\r\n}","module LS.Client3DEditor {\r\n export class ToolBox {\r\n\r\n static navDropdownVisible: boolean = false;\r\n\r\n static toggleNavDropdown() {\r\n var $navdropdown = $(\"#nav-dropdown\"),\r\n $aoes5View = $(\"#aoes5-view\"),\r\n offset = $aoes5View.offset(),\r\n width = $aoes5View.outerWidth();\r\n\r\n if (ToolBox.navDropdownVisible)\r\n DManager.hideWithEffect($navdropdown, 'size', { origin: [\"top\", \"right\"] }, \"fast\");\r\n else\r\n DManager.showWithEffect($navdropdown.css({ left: offset.left + width - 50, top: offset.top - 17 }), 'size', { origin: [\"top\", \"right\"] }, \"fast\");\r\n\r\n ToolBox.navDropdownVisible = !ToolBox.navDropdownVisible;\r\n }\r\n\r\n static showInverterFlyout() {\r\n var viewModel = Controller.Current.viewModel;\r\n\r\n if (!viewModel.FlyoutVisible)\r\n ToolBox.innerToggleFlyout(viewModel);\r\n\r\n viewModel.ShowInverterFlyout = true;\r\n }\r\n\r\n static toggleInverterFlyout() {\r\n var viewModel = Controller.Current.viewModel;\r\n\r\n if (viewModel.selectedTool === \"conduitTool\")\r\n viewModel.deselectTool();\r\n else if (!viewModel.FlyoutVisible || viewModel.ShowInverterFlyout)\r\n ToolBox.innerToggleFlyout(viewModel);\r\n\r\n viewModel.ShowInverterFlyout = true;\r\n }\r\n\r\n static toggleFlyout() {\r\n\r\n var viewModel = Controller.Current.viewModel;\r\n\r\n if (viewModel.selectedTool === \"conduitTool\")\r\n viewModel.deselectTool();\r\n if (!viewModel.FlyoutVisible || !viewModel.ShowInverterFlyout)\r\n ToolBox.innerToggleFlyout(viewModel);\r\n\r\n viewModel.ShowInverterFlyout = false;\r\n }\r\n\r\n static closeFlyout() {\r\n var viewModel = Controller.Current.viewModel;\r\n\r\n if (viewModel.FlyoutVisible)\r\n ToolBox.innerToggleFlyout(viewModel);\r\n }\r\n\r\n private static innerToggleFlyout(viewModel: LS.Client3DEditor.ViewModel) {\r\n var $aoFlyout = $(\"#ao-Flyout\");\r\n\r\n if (!viewModel.FlyoutVisible) {\r\n var windowSize = getSize();\r\n var aoButtonClientRect = document.getElementById('ao-FlyoutButton').getBoundingClientRect();\r\n \r\n var h = Math.max(windowSize[1] - aoButtonClientRect.top - 20, 100);\r\n\r\n parseFloat($('#ao-Toolbox').css('width').slice(0, -2))\r\n\r\n var leftPos = parseFloat($('#ao-Toolbox').css('left').slice(0, -2)) + parseFloat($('#ao-Toolbox').css('width').slice(0, -2)) + 10 + \"px\";\r\n var topPos = $('#ao-Toolbox').css('top');\r\n\r\n $aoFlyout.css(\"max-height\", h + \"px\").show();\r\n if($aoFlyout.animate)\r\n $aoFlyout.animate({ left: leftPos, top: topPos }, { duration: 500 });\r\n else\r\n $aoFlyout.css({ left: leftPos, top: topPos });\r\n //$('#ao-FlyoutButton, #ao-inverter-FlyoutButton').addClass('ao-insert-item-selected');\r\n } else {\r\n if($aoFlyout.animate)\r\n $aoFlyout.animate({ left: \"-400px\", top: $('#ao-Toolbox').css('top') }, { duration: 500, complete: () => { $aoFlyout.hide(); } });\r\n else\r\n $aoFlyout.hide();\r\n //$('#ao-FlyoutButton, #ao-inverter-FlyoutButton').removeClass('ao-insert-item-selected');\r\n }\r\n\r\n viewModel.FlyoutVisible = !viewModel.FlyoutVisible;\r\n }\r\n\r\n public static GetMarginTopFromSelectedMenu() {\r\n \r\n }\r\n\r\n }\r\n\r\n\r\n\r\n //Document ready function\r\n $(() => {\r\n if(window.SkipAO3DSetup)\r\n return;\r\n\r\n //$(\"#ao-Flyout-CloseButton, #ao-FlyoutButton\").click(ToolBox.toggleFlyout);\r\n $(\"#nav-dropdown\").click(ToolBox.toggleNavDropdown);\r\n $(\"#ao-Flyout\").css('top', document.getElementById('ao-Toolbox').offsetTop - 5);\r\n\r\n\r\n $(\"#ao-UndockButton\").click(function () {\r\n var toolBox = $(\"#ao-Toolbox\");\r\n var flyOut = $(\"#ao-Flyout\");\r\n\r\n if (!toolBox.hasClass(\"undockedAOToolbox\")) {\r\n DManager.makeDraggable(toolBox);\r\n DManager.makeDraggable(flyOut);\r\n toolBox.addClass(\"undockedAOToolbox\");\r\n toolBox.css(\"border-top-color\", $(\"#contextmenu_layout\").css(\"background-color\"));\r\n } else {\r\n DManager.makeDraggable(toolBox);\r\n DManager.makeDraggable(flyOut);\r\n toolBox.removeClass(\"undockedAOToolbox\");\r\n toolBox.css({ \"top\": \"\", \"left\": \"\" });\r\n }\r\n });\r\n\r\n });\r\n}","module LS.Client3DEditor {\r\n export class KeyboardSteps extends BaseTool {\r\n needsUpdate: boolean = false;\r\n\r\n onSelect(viewModel: ViewModel, params: { enforce?: string }) {\r\n if ((!viewModel.selected.length && !viewModel.selectedUi.length) || (params.enforce != \"1\" && viewModel.mouseDown)) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n viewModel.isDragging = true;\r\n viewModel.startDrag();\r\n viewModel.disableMouseMove = true;\r\n viewModel.startRoofPosition.set(0, 0, 0);\r\n viewModel.roofPosition.set(0, 0, 0);\r\n this.needsUpdate = false;\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n if (this.needsUpdate)\r\n this.applyMove(false);\r\n viewModel.disableMouseMove = false;\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n return false;\r\n }\r\n\r\n onMouseDown(viewModel: ViewModel) {\r\n this.applyMove(true);\r\n return false;\r\n }\r\n\r\n onMouseUp(viewModel: ViewModel) {\r\n this.applyMove(true);\r\n return false;\r\n }\r\n\r\n onKeyDown(viewModel: ViewModel) {\r\n if (viewModel.keyPressed([37, 38, 39, 40])) { //Left, Up, Right, Down\r\n var l = viewModel.keyPressed(37) ? -1 : 0;\r\n var u = viewModel.keyPressed(38) ? 1 : 0;\r\n var r = viewModel.keyPressed(39) ? 1 : 0;\r\n var d = viewModel.keyPressed(40) ? -1 : 0;\r\n var steps = viewModel.keyBoardSteps.internalValue;\r\n this.moveSelected(steps * l + steps * r, steps * u + steps * d, 0);\r\n }\r\n return false;\r\n }\r\n\r\n applyMove(unselectTool) {\r\n var controller = Controller.Current,\r\n viewModel = controller.viewModel,\r\n ray = controller.worldRaycaster.ray,\r\n incstanceContext = viewModel.currentInstance;\r\n\r\n if (viewModel.selectedTool !== 'keyboardSteps') return;\r\n\r\n viewModel.ApplyDiffSnapPosition();\r\n\r\n this.needsUpdate = false;\r\n\r\n var roofPos = incstanceContext.getLocalPosition(ray);\r\n if (roofPos) {\r\n viewModel.roofPosition.copy(roofPos);\r\n viewModel.startRoofPosition.copy(viewModel.roofPosition);\r\n }\r\n viewModel.startViewPosition.copy(viewModel.viewPosition);\r\n viewModel.disableMouseMove = false;\r\n viewModel.isDragging = false;\r\n viewModel.isSelecting = false;\r\n viewModel.canSelect = false;\r\n viewModel.canDrag = false;\r\n\r\n if (unselectTool)\r\n viewModel.deselectTool();\r\n }\r\n\r\n moveSelected(x, y, z) {\r\n var viewModel = Controller.Current.viewModel;\r\n var roofPosition = viewModel.roofPosition;\r\n roofPosition.x += x || 0;\r\n roofPosition.y += y || 0;\r\n roofPosition.z += z || 0;\r\n viewModel.updateSelected();\r\n this.needsUpdate = true;\r\n }\r\n }\r\n\r\n export class SmartDelete extends BaseTool {\r\n cursor: string = 'default';\r\n\r\n onSelect(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n linesHelper = controller.linesHelper,\r\n boxHelper = controller.boxHelper,\r\n measureObjectHolder = controller.measureObjectHolder,\r\n stringObjectHolder = controller.stringObjectHolder;\r\n\r\n if (viewModel.selected.length || viewModel.selectedUi.length) {\r\n viewModel.deselectTool();\r\n controller.deleteSelected();\r\n return;\r\n }\r\n\r\n viewModel.deselectAll();\r\n\r\n linesHelper.setHoverLine(null);\r\n measureObjectHolder.setHoverDimObj(null);\r\n stringObjectHolder.setHoverObject(null);\r\n\r\n if (boxHelper.visible)\r\n setBoxhelper(null);\r\n }\r\n\r\n onDeselect(viewModel: LS.Client3DEditor.ViewModel) {\r\n\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n instanceContext = controller.viewModel.currentInstance,\r\n linesHelper = controller.linesHelper,\r\n raycaster = controller.worldRaycaster,\r\n boxHelper = controller.boxHelper,\r\n measureObjectHolder = controller.measureObjectHolder,\r\n stringObjectHolder = controller.stringObjectHolder;\r\n\r\n var cursor = this.cursor;\r\n\r\n linesHelper.setHoverLine(null);\r\n measureObjectHolder.setHoverDimObj(null);\r\n stringObjectHolder.setHoverObject(null);\r\n\r\n var intersections = instanceContext.getInstanceIntersections(raycaster);\r\n\r\n if (intersections.length > 0 && viewModel.EditorViewMode !== \"Electric\") {\r\n LS.Client3DEditor.setBoxhelper(intersections[0]);\r\n cursor = 'pointer';\r\n } else {\r\n LS.Client3DEditor.setBoxhelper(null);\r\n\r\n var precision = controller.ClickTolerance / controller.orthoCamera.zoom;\r\n\r\n //Helperlines\r\n var hl = linesHelper.GetByPoint(viewModel.roofPosition, precision);\r\n\r\n if (hl) {\r\n linesHelper.setHoverLine(hl);\r\n cursor = 'pointer';\r\n } else {\r\n //MeasureObject\r\n var mo = measureObjectHolder.getByRaycaster(raycaster, precision);\r\n if (mo) {\r\n measureObjectHolder.setHoverDimObj(mo);\r\n cursor = 'pointer';\r\n } else {\r\n var so = stringObjectHolder.getByRaycaster(raycaster, precision);\r\n if (so) {\r\n stringObjectHolder.setHoverObject(so);\r\n cursor = 'pointer';\r\n } else if (intersections.length > 0) {\r\n LS.Client3DEditor.setBoxhelper(intersections[0]);\r\n\r\n cursor = 'pointer';\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n controller.viewModel.Cursor = cursor;\r\n return false;\r\n }\r\n\r\n onMouseUp(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n instanceContext = controller.viewModel.currentInstance,\r\n linesHelper = controller.linesHelper,\r\n raycaster = controller.worldRaycaster,\r\n boxHelper = controller.boxHelper,\r\n measureObjectHolder = controller.measureObjectHolder,\r\n stringObjectHolder = controller.stringObjectHolder;\r\n\r\n if (boxHelper.visible) {\r\n var intersections = instanceContext.getInstanceIntersections(raycaster, Client3DObectOptions.CanDeleteInstances);\r\n\r\n if (intersections.length > 0) {\r\n var instance = intersections[0];\r\n\r\n viewModel.addToSelection([instance], true);\r\n\r\n controller.deleteSelected();\r\n }\r\n\r\n setBoxhelper(null);\r\n }\r\n if (linesHelper.hoverLine) {\r\n linesHelper.hoverLine.removeInstance();\r\n linesHelper.setHoverLine(null);\r\n }\r\n if (measureObjectHolder.hoverDimObj) {\r\n measureObjectHolder.hoverDimObj.removeInstance();\r\n measureObjectHolder.setHoverDimObj(null);\r\n }\r\n if (stringObjectHolder.hoverObject) {\r\n stringObjectHolder.hoverObject.removeInstance();\r\n stringObjectHolder.setHoverObject(null);\r\n }\r\n\r\n controller.viewModel.Cursor = this.cursor;\r\n return false;\r\n }\r\n }\r\n\r\n export class DimensionLines extends BaseTool {\r\n cursor = 'crosshair';\r\n private _p1 = new THREE.Vector3();\r\n private _p2 = new THREE.Vector3();\r\n private _p3 = new THREE.Vector3();\r\n private _octree: spt.ThreeJs.utils.Octree = null;\r\n private _lineMat: THREE.LineBasicMaterial = new THREE.LineBasicMaterial();\r\n private _dimObj: spt.ThreeJs.utils.DimensionAligned = null;\r\n private _step: number = 0;\r\n private _shiftDown = false;\r\n private _ctrlDown = false;\r\n\r\n addLineToOctree(p1: THREE.Vector3, p2: THREE.Vector3) {\r\n if (!this._octree)\r\n return;\r\n var geo = new THREE.Geometry();\r\n geo.vertices.push(p1, p2);\r\n geo.computeBoundingSphere();\r\n\r\n geo.boundingSphere.radius += 200;\r\n\r\n var line = new THREE.Line(geo, this._lineMat);\r\n this._octree.add(line);\r\n }\r\n\r\n onSelect(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n pointingHelper = controller.pointingHelper,\r\n measureObjectHolder = controller.measureObjectHolder;\r\n\r\n measureObjectHolder.setHoverDimObj(null);\r\n\r\n viewModel.deselectAll();\r\n\r\n if (this._octree == null) {\r\n this._octree = new spt.ThreeJs.utils.Octree({\r\n //scene: scene,\r\n undeferred: false,\r\n depthMax: Infinity,\r\n objectsThreshold: 8,\r\n overlapPct: 0.15\r\n });\r\n\r\n ko.getObservable(viewModel, 'align90Degree').subscribe(() => {\r\n if (viewModel.selectedTool === \"dimensionLines\")\r\n this.onMouseMove(viewModel);\r\n });\r\n\r\n ko.getObservable(viewModel, 'keepDepth').subscribe(() => {\r\n if (viewModel.selectedTool === \"dimensionLines\")\r\n this.onMouseMove(viewModel);\r\n });\r\n }\r\n\r\n this._shiftDown = false;\r\n this._ctrlDown = false;\r\n\r\n var col = window.EditorViewMode === \"Anordnung\" ? 0xdbe2fc : 0x414141;\r\n var textSize = window.EditorViewMode === \"Anordnung\" ? 150 : 100;\r\n\r\n if (this._dimObj == null)\r\n this._dimObj = new THREE.DimensionAligned(undefined, undefined, undefined, new THREE.Color(col), textSize, undefined, true);\r\n else {\r\n this._dimObj.textSize = textSize;\r\n this._dimObj.color.setHex(col);\r\n this._dimObj.reset();\r\n }\r\n\r\n Controller.Current.viewModel.currentInstance.add(this._dimObj, true);\r\n\r\n this._step = 0;\r\n\r\n pointingHelper.visible = false;\r\n\r\n //var p1 = this._p1;\r\n //var p2 = this._p2;\r\n\r\n var instanceContext = controller.viewModel.currentInstance;\r\n\r\n if (window.EditorViewMode === \"Anordnung\") {\r\n instanceContext.forEachOctreeObjects(obj => {\r\n if (obj instanceof THREE.Mesh) {\r\n this.addMeshToOctree(obj);\r\n }\r\n });\r\n var polygons = instanceContext.instancePolygons;\r\n if (polygons && polygons.length) {\r\n polygons.forEach(poly => {\r\n if (poly && poly.length) {\r\n for (var i = 0, l = poly.length; i < l; i++) {\r\n var p1 = poly[i],\r\n p2 = poly[(i + 1) % l];\r\n this.addLineToOctree(p1.clone().setZ(10), p2.clone().setZ(10));\r\n }\r\n }\r\n });\r\n }\r\n } else {\r\n var instanceObject = instanceContext.instanceObject,\r\n transform = instanceContext.worldToLocalTransform;\r\n if (instanceObject) {\r\n instanceObject.traverse((obj) => {\r\n if (obj instanceof THREE.Line) {\r\n this.addLineMeshToOctree(obj, transform);\r\n }\r\n });\r\n }\r\n }\r\n\r\n this._octree.update();\r\n }\r\n\r\n addMeshToOctree = (() => {\r\n var box = new THREE.Box3(),\r\n p2 = new THREE.Vector3(),\r\n p4 = new THREE.Vector3();\r\n return (mesh: THREE.Mesh) => {\r\n box.copy(mesh.geometry.boundingBox).translate(mesh.position);\r\n if (mesh.parent)\r\n box.applyMatrix4(mesh.parent.matrixWorld);\r\n var p1 = box.min.setZ(Math.max(10, box.min.z)),\r\n p3 = box.max.setZ(p1.z);\r\n p2.set(p3.x, p1.y, p1.z);\r\n p4.set(p1.x, p3.y, p1.z);\r\n if (p3.x - p1.x > 0) {\r\n this.addLineToOctree(p1.clone(), p2.clone());\r\n this.addLineToOctree(p3.clone(), p4.clone());\r\n }\r\n if (p3.y - p1.y > 0) {\r\n this.addLineToOctree(p2.clone(), p3.clone());\r\n this.addLineToOctree(p4.clone(), p1.clone());\r\n }\r\n };\r\n })();\r\n\r\n addLineMeshToOctree = (() => {\r\n var p1 = new THREE.Vector3(),\r\n p2 = new THREE.Vector3(),\r\n m = new THREE.Matrix4();\r\n return (obj: THREE.Line, transform: THREE.Matrix4) => {\r\n obj.updateMatrixWorld(true);\r\n m.copy(transform).multiply(obj.matrixWorld);\r\n var geometry = obj.geometry;\r\n if (geometry instanceof THREE.BufferGeometry) {\r\n var position = geometry.attributes['position'];\r\n if (!position)\r\n return;\r\n var arr = position.array;\r\n var ipp = obj instanceof THREE.LineSegments ? 6 : 3;\r\n var l = obj instanceof THREE.LineSegments ? arr.length : arr.length - 3;\r\n for (var i = 0; i < l; i += ipp) {\r\n var v1 = p1.set(arr[i], arr[i + 1], arr[i + 2]).applyMatrix4(m);\r\n var v2 = p2.set(arr[i + 3], arr[i + 4], arr[i + 5]).applyMatrix4(m);\r\n\r\n this.addLineToOctree(v1.clone(), v2.clone());\r\n }\r\n }\r\n };\r\n })();\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n pointingHelper = controller.pointingHelper,\r\n measureObjectHolder = controller.measureObjectHolder;\r\n\r\n pointingHelper.visible = false;\r\n\r\n viewModel.deselectAll();\r\n\r\n measureObjectHolder.setHoverDimObj(null);\r\n\r\n this._octree = null;\r\n\r\n Controller.Current.viewModel.currentInstance.remove(this._dimObj, true);\r\n\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n pointingHelper = controller.pointingHelper,\r\n tolerance = controller.linePrecision,\r\n toleranceSq = tolerance * tolerance,\r\n octree = this._octree,\r\n raycaster = controller.localRaycaster,\r\n EPS = 0.0001,\r\n measureObjectHolder = controller.measureObjectHolder,\r\n align90degree = viewModel.align90Degree,\r\n keepDepth = viewModel.keepDepth;\r\n\r\n if (!octree)\r\n return false;\r\n\r\n controller.viewModel.Cursor = this.cursor;\r\n\r\n if (this._step === 2 || this._step === 3) {\r\n var dimObj = this._step === 3 ? measureObjectHolder.hoverDimObj : this._dimObj;\r\n dimObj.dimensionPosition.copy(viewModel.roofPosition);\r\n dimObj.dimensionPosition.setZ((dimObj.start.z + dimObj.end.z) * 0.5);\r\n dimObj.rebuild();\r\n return false;\r\n }\r\n\r\n measureObjectHolder.setHoverDimObj(null);\r\n\r\n raycaster.params.Line.threshold = tolerance;\r\n\r\n if (this._step === 0) {\r\n var mObj = controller.measureObjectHolder.getByRaycaster(raycaster);\r\n if (mObj) {\r\n measureObjectHolder.setHoverDimObj(mObj);\r\n controller.viewModel.Cursor = 'pointer';\r\n if (pointingHelper.visible)\r\n pointingHelper.visible = false;\r\n return false;\r\n }\r\n }\r\n\r\n var ray = raycaster.ray;\r\n var objs = octree.search(ray.origin, raycaster.far, true, ray.direction).map((m) => { return m.object; });\r\n if (!objs.length)\r\n return false;\r\n\r\n var intersections = raycaster.intersectObjects(objs, false);\r\n if (intersections && intersections.length) {\r\n\r\n var minDist = Number.MAX_VALUE;\r\n var minP: THREE.Vector3 = null;\r\n\r\n var intersecLines = intersections.map((it) => { return it.object as THREE.Line; });\r\n\r\n var p43 = this._p1;\r\n var p21 = this._p2;\r\n var p13 = this._p3;\r\n\r\n for (var j = 0, k = intersecLines.length - 1; j < k; j++) {\r\n var l1 = intersecLines[j];\r\n var geo1 = l1.geometry as THREE.Geometry;\r\n var p1 = geo1.vertices[0];\r\n var p2 = geo1.vertices[1];\r\n for (var l = j + 1, n = intersecLines.length; l < n; l++) {\r\n var l2 = intersecLines[l];\r\n var geo2 = l2.geometry as THREE.Geometry;\r\n var p3 = geo2.vertices[0];\r\n var p4 = geo2.vertices[1];\r\n\r\n p43.copy(p4).sub(p3);\r\n\r\n if (p43.lengthSq() < EPS)\r\n continue;\r\n\r\n p21.copy(p2).sub(p1);\r\n\r\n if (p21.lengthSq() < EPS)\r\n continue;\r\n\r\n p13.copy(p1).sub(p3);\r\n\r\n var d1343 = p13.x * p43.x + p13.y * p43.y + p13.z * p43.z;\r\n var d4321 = p43.x * p21.x + p43.y * p21.y + p43.z * p21.z;\r\n var d1321 = p13.x * p21.x + p13.y * p21.y + p13.z * p21.z;\r\n var d4343 = p43.x * p43.x + p43.y * p43.y + p43.z * p43.z;\r\n var d2121 = p21.x * p21.x + p21.y * p21.y + p21.z * p21.z;\r\n\r\n var denom = d2121 * d4343 - d4321 * d4321;\r\n\r\n if (Math.abs(denom) < EPS)\r\n continue;\r\n\r\n var numer = d1343 * d4321 - d1321 * d4343;\r\n\r\n var mua = numer / denom;\r\n var mub = (d1343 + d4321 * (mua)) / d4343;\r\n\r\n if (mua >= 0 && mua <= 1 && mub >= 0 && mub <= 1) {\r\n p21.set(p1.x + mua * p21.x, p1.y + mua * p21.y, p1.z + mua * p21.z);\r\n p43.set(p3.x + mub * p43.x, p3.y + mub * p43.y, p3.z + mub * p43.z);\r\n\r\n p13.copy(p21).sub(p43);\r\n if (p13.lengthSq() <= EPS) {\r\n //intersection\r\n var rdistSq = ray.distanceSqToPoint(p21);\r\n if (rdistSq <= toleranceSq && rdistSq < minDist) {\r\n minDist = rdistSq;\r\n if (minP == null)\r\n minP = p21.clone();\r\n else\r\n minP.copy(p21);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (minP == null) {\r\n //var interpoints = intersections.map((it) => { return it.point; });\r\n\r\n //for (var o = 0, q = interpoints.length; o < q; o++) {\r\n // var p = interpoints[o];\r\n // var rdistSqp = ray.distanceSqToPoint(p);\r\n // if (rdistSqp <= toleranceSq && rdistSqp < minDist) {\r\n // minDist = rdistSqp;\r\n // minP = p43.copy(p);\r\n // }\r\n //}\r\n\r\n //if (minP == null) {\r\n for (var i = intersections.length; i--;) {\r\n var cur = intersections[i],\r\n curP = cur.point,\r\n d = ray.distanceSqToPoint(curP);\r\n\r\n if (d < minDist) {\r\n minDist = d;\r\n minP = p43.copy(curP);\r\n }\r\n }\r\n //}\r\n }\r\n\r\n pointingHelper.position.copy(minP);\r\n\r\n if (this._step === 1) {\r\n if (viewModel.keyPressed(72)) { // h\r\n minP.setY(this._dimObj.start.y);\r\n } else if (viewModel.keyPressed(86)) { // v\r\n minP.setX(this._dimObj.start.x);\r\n } else if (align90degree) {\r\n if (Math.abs(this._dimObj.start.x - minP.x) > Math.abs(this._dimObj.start.y - minP.y))\r\n minP.setY(this._dimObj.start.y);\r\n else\r\n minP.setX(this._dimObj.start.x);\r\n }\r\n if (keepDepth)\r\n minP.setZ(this._dimObj.start.z);\r\n\r\n this._dimObj.setEndAutoPosition(minP);\r\n }\r\n\r\n if (!pointingHelper.visible)\r\n pointingHelper.visible = true;\r\n } else if (this._step === 1) {\r\n\r\n var minP = this._p1.copy(viewModel.roofPosition);\r\n\r\n pointingHelper.position.copy(minP);\r\n\r\n if (viewModel.keyPressed(72)) { // h\r\n minP.setY(this._dimObj.start.y);\r\n } else if (viewModel.keyPressed(86)) { // v\r\n minP.setX(this._dimObj.start.x);\r\n } else if (align90degree) {\r\n if (Math.abs(this._dimObj.start.x - minP.x) > Math.abs(this._dimObj.start.y - minP.y))\r\n minP.setY(this._dimObj.start.y);\r\n else\r\n minP.setX(this._dimObj.start.x);\r\n }\r\n if (keepDepth)\r\n minP.setZ(this._dimObj.start.z);\r\n\r\n this._dimObj.setEndAutoPosition(minP);\r\n\r\n if (!pointingHelper.visible)\r\n pointingHelper.visible = true;\r\n } else if (pointingHelper.visible) {\r\n pointingHelper.visible = false;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n onMouseDown(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n pointingHelper = controller.pointingHelper,\r\n measureObjectHolder = controller.measureObjectHolder;\r\n\r\n if (!this._octree)\r\n return false;\r\n\r\n switch (this._step) {\r\n case 0:\r\n if (measureObjectHolder.hoverDimObj) {\r\n var hoverDimObj = measureObjectHolder.hoverDimObj;\r\n\r\n controller.viewModel.Cursor = this.cursor;\r\n this.reset();\r\n\r\n this._step = 3;\r\n hoverDimObj.isSelected = true;\r\n hoverDimObj.userData.prevDimensionPosition = measureObjectHolder.hoverDimObj.dimensionPosition.clone();\r\n hoverDimObj.OnChanged();\r\n\r\n } else if (pointingHelper.visible) {\r\n this._dimObj.start.copy(pointingHelper.position);\r\n this._dimObj.end.copy(pointingHelper.position);\r\n this._dimObj.rebuild();\r\n this._step = 1;\r\n }\r\n break;\r\n case 1:\r\n var diff = this._dimObj.end.clone().sub(this._dimObj.start);\r\n\r\n if (diff.lengthSq() > 1)\r\n this._step = 2;\r\n else\r\n this.reset();\r\n break;\r\n case 2:\r\n this.saveDimesionLine(false);\r\n break;\r\n case 3:\r\n this.saveDimesionLine(true);\r\n measureObjectHolder.setHoverDimObj(null);\r\n break;\r\n default:\r\n this.reset();\r\n break;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n saveDimesionLine(hovered: boolean) {\r\n var controller = Controller.Current;\r\n controller.measureObjectHolder.saveDimensionLine(hovered ? controller.measureObjectHolder.hoverDimObj : this._dimObj);\r\n this.reset();\r\n }\r\n\r\n onKeyDown(viewModel: ViewModel) {\r\n if (!this._octree)\r\n return false;\r\n\r\n if (viewModel.keyPressed(27)) // esc\r\n this.reset();\r\n else {\r\n if (viewModel.shiftDown && !this._shiftDown) {\r\n this._shiftDown = true;\r\n viewModel.align90Degree = true;\r\n } else if (viewModel.ctrlDown && !this._ctrlDown) {\r\n this._ctrlDown = true;\r\n viewModel.keepDepth = true;\r\n } else if (viewModel.keyPressed([72, 86])) {\r\n this.onMouseMove(viewModel);\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n onKeyUp(viewModel: ViewModel) {\r\n if (!this._octree)\r\n return false;\r\n\r\n if (!viewModel.shiftDown && this._shiftDown) {\r\n this._shiftDown = false;\r\n viewModel.align90Degree = false;\r\n } else if (!viewModel.ctrlDown && this._ctrlDown) {\r\n this._ctrlDown = false;\r\n viewModel.keepDepth = false;\r\n }\r\n return false;\r\n }\r\n\r\n reset() {\r\n var controller = Controller.Current,\r\n measureObjectHolder = controller.measureObjectHolder,\r\n hoverDimObj = measureObjectHolder.hoverDimObj;\r\n this._dimObj.reset();\r\n this._step = 0;\r\n if (hoverDimObj && hoverDimObj.userData.prevDimensionPosition) {\r\n hoverDimObj.dimensionPosition = hoverDimObj.userData.prevDimensionPosition;\r\n hoverDimObj.isSelected = false;\r\n delete hoverDimObj.userData.prevDimensionPosition;\r\n }\r\n }\r\n }\r\n\r\n export class HelperLines extends BaseTool {\r\n cursor = 'crosshair';\r\n v1 = new THREE.Vector3();\r\n v2 = new THREE.Vector3();\r\n closestPoint = new THREE.Vector3();\r\n isVertical = false;\r\n box1 = new THREE.Box3();\r\n box2 = new THREE.Box3();\r\n vLine: HelperLine = null;\r\n hLine: HelperLine = null;\r\n freeLine: HelperLine = null;\r\n lineMode = 3;\r\n lineModeVertival = 1;\r\n lineModeHorizontal = 2;\r\n lineModeAuto = 3;\r\n lineModeFree = 4;\r\n lineDeleteMode = false;\r\n step = 0;\r\n\r\n onSelect(viewModel: ViewModel, params: { lineMode?: string, delete?: string }) {\r\n var controller = Controller.Current,\r\n pointingHelper = controller.pointingHelper,\r\n linesHelper = controller.linesHelper;\r\n\r\n pointingHelper.visible = false;\r\n this.lineMode = params.lineMode ? parseInt(params.lineMode) : 0;\r\n this.lineDeleteMode = params.delete == \"1\";\r\n\r\n this.step = 0;\r\n\r\n if (!this.vLine)\r\n this.vLine = new HelperLine(true);\r\n this.vLine.visible = false;\r\n Object.defineProperty(this.vLine, 'pos', { enumerable: true, configurable: true, writable: false, value: null });\r\n\r\n if (!this.hLine)\r\n this.hLine = new HelperLine(false);\r\n this.hLine.visible = false;\r\n Object.defineProperty(this.hLine, 'pos', { enumerable: true, configurable: true, writable: false, value: null });\r\n\r\n if (!this.freeLine)\r\n this.freeLine = new HelperLine(false, new THREE.Vector3(0, 0, 0), new THREE.Vector3(0, 1, 0));\r\n this.freeLine.visible = false;\r\n Object.defineProperty(this.freeLine, 'pos', { enumerable: true, configurable: true, writable: false, value: null });\r\n\r\n var s = Math.max(linesHelper.w, linesHelper.h);\r\n this.freeLine.scale.set(s, 1, 1);\r\n\r\n linesHelper.setHoverLine(null);\r\n\r\n linesHelper.addLine(this.vLine);\r\n linesHelper.addLine(this.hLine);\r\n linesHelper.addLine(this.freeLine);\r\n\r\n linesHelper.visible = true;\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n pointingHelper = controller.pointingHelper,\r\n linesHelper = controller.linesHelper;\r\n\r\n pointingHelper.visible = false;\r\n\r\n linesHelper.setHoverLine(null);\r\n\r\n if (this.vLine) {\r\n this.vLine.removeInstance();\r\n this.vLine = null;\r\n }\r\n\r\n if (this.hLine) {\r\n this.hLine.removeInstance();\r\n this.hLine = null;\r\n }\r\n\r\n if (this.freeLine) {\r\n this.freeLine.removeInstance();\r\n this.freeLine = null;\r\n }\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n instanceContext = controller.viewModel.currentInstance,\r\n pointingHelper = controller.pointingHelper,\r\n rp = viewModel.roofPosition,\r\n camera = controller.orthoCamera,\r\n tolerance = controller.ClickTolerance / camera.zoom,\r\n toleranceSq = tolerance * tolerance,\r\n v1 = this.v1,\r\n v2 = this.v2,\r\n closestPoint = this.closestPoint,\r\n box1 = this.box1,\r\n box2 = this.box2,\r\n vLine = this.vLine,\r\n hLine = this.hLine,\r\n freeLine = this.freeLine,\r\n linesHelper = controller.linesHelper,\r\n lineMode = this.lineMode,\r\n lineDeleteMode = this.lineDeleteMode,\r\n modeVertical = this.lineModeVertival,\r\n modeFree = this.lineModeFree,\r\n modeHorizontal = this.lineModeHorizontal,\r\n modeAuto = this.lineModeAuto,\r\n directedAreaHolder = controller.directedAreaHolder;\r\n\r\n vLine.visible = hLine.visible = freeLine.visible = false;\r\n\r\n if (lineDeleteMode) {\r\n var cursor = this.cursor;\r\n\r\n var hoverLine = linesHelper.GetByPoint(viewModel.roofPosition, tolerance);\r\n linesHelper.setHoverLine(hoverLine);\r\n\r\n if (hoverLine != null)\r\n cursor = 'pointer';\r\n\r\n controller.viewModel.Cursor = cursor;\r\n return false;\r\n }\r\n\r\n box1.min.set(rp.x - tolerance, rp.y - tolerance, -camera.far);\r\n box1.max.set(rp.x + tolerance, rp.y + tolerance, camera.far);\r\n\r\n var distance = Number.MAX_VALUE;\r\n var pointFound = false;\r\n var isVertical = false;\r\n var isFree = lineMode === modeFree;\r\n var radius = box1.getSize(v2).setZ(0).length() * 0.5;\r\n var octreeObjects = instanceContext.searchOctree(rp, radius, false);\r\n\r\n for (var i = octreeObjects.length; i--;) {\r\n var object = octreeObjects[i] as THREE.Mesh;\r\n\r\n box2.copy(object.geometry.boundingBox).translate(object.position);\r\n if (object.parent)\r\n box2.applyMatrix4(object.parent.matrixWorld);\r\n\r\n if (box1.intersectsBox(box2)) {\r\n\r\n v1.copy(rp).clamp(box2.min, box2.max).setZ(0);\r\n if (lineMode === modeVertical || lineMode === modeFree)\r\n v1.x += (Math.abs(box2.min.x - v1.x) < Math.abs(box2.max.x - v1.x)) ? box2.min.x - v1.x : box2.max.x - v1.x;\r\n if (lineMode === modeHorizontal || lineMode === modeFree)\r\n v1.y += (Math.abs(box2.min.y - v1.y) < Math.abs(box2.max.y - v1.y)) ? box2.min.y - v1.y : box2.max.y - v1.y;\r\n\r\n var dist = v2.copy(v1).sub(rp).lengthSq();\r\n\r\n if (dist < distance && dist <= toleranceSq) {\r\n distance = dist;\r\n if (lineMode === modeAuto || lineMode === modeFree) {\r\n //automatic\r\n box2.getCenter(v2).sub(rp);\r\n\r\n //center of the box\r\n if (v2.y === 0) {\r\n isVertical = true;\r\n\r\n box2.getCenter(closestPoint).setZ(box2.min.z);\r\n if (v2.x > 0)\r\n closestPoint.setX(box2.min.x);\r\n else\r\n closestPoint.setX(box2.max.x);\r\n pointFound = true;\r\n } else {\r\n var r = Math.abs(v2.x) / Math.abs(v2.y);\r\n\r\n box2.getSize(v1);\r\n\r\n //box with zero size\r\n if (v1.y === 0)\r\n continue;\r\n\r\n var rBox = Math.abs(v1.x) / Math.abs(v1.y);\r\n\r\n if (r > rBox) {\r\n isVertical = true;\r\n var cp = (v2.x > 0) ? spt.ThreeJs.utils.GetClosestPointToLine(v1.set(box2.min.x, box2.min.y, box2.min.z), v2.set(box2.min.x, box2.max.y, box2.min.z), rp) : spt.ThreeJs.utils.GetClosestPointToLine(v1.set(box2.max.x, box2.min.y, box2.min.z), v2.set(box2.max.x, box2.max.y, box2.min.z), rp);\r\n closestPoint.copy(cp.p);\r\n pointFound = true;\r\n } else {\r\n isVertical = false;\r\n var cp = (v2.y > 0) ? spt.ThreeJs.utils.GetClosestPointToLine(v1.set(box2.min.x, box2.min.y, box2.min.z), v2.set(box2.max.x, box2.min.y, box2.min.z), rp) : spt.ThreeJs.utils.GetClosestPointToLine(v1.set(box2.min.x, box2.max.y, box2.min.z), v2.set(box2.max.x, box2.max.y, box2.min.z), rp);\r\n closestPoint.copy(cp.p);\r\n pointFound = true;\r\n }\r\n }\r\n } else {\r\n isVertical = lineMode === modeVertical;\r\n closestPoint.copy(v1).setZ(box2.min.z);\r\n pointFound = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n var da = directedAreaHolder.getClosestByPosition(rp, tolerance);\r\n if (da && da.distance < distance && da.distance <= toleranceSq) {\r\n closestPoint.copy(da.point);\r\n pointFound = true;\r\n }\r\n\r\n if (!pointFound) {\r\n if (isFree) {\r\n closestPoint.copy(viewModel.roofPosition);\r\n if (this.step === 1 && viewModel.shiftDown)\r\n spt.ThreeJs.utils.ProjectVectorToClosestAxis(closestPoint.sub(freeLine.position), 1).add(freeLine.position);\r\n pointFound = true;\r\n } else if (lineMode !== modeAuto) {\r\n isVertical = lineMode === modeVertical;\r\n closestPoint.copy(viewModel.roofPosition);\r\n pointFound = true;\r\n }\r\n }\r\n\r\n this.isVertical = isVertical && !isFree;\r\n\r\n if (pointFound) {\r\n if (isFree) {\r\n freeLine.visible = true;\r\n vLine.visible = false;\r\n hLine.visible = false;\r\n\r\n if (this.step === 0)\r\n freeLine.setPosition(closestPoint, closestPoint);\r\n else\r\n freeLine.setTarget(closestPoint);\r\n } else if (isVertical) {\r\n freeLine.visible = false;\r\n vLine.visible = true;\r\n hLine.visible = false;\r\n\r\n vLine.setPosition(closestPoint);\r\n } else {\r\n freeLine.visible = false;\r\n vLine.visible = false;\r\n hLine.visible = true;\r\n\r\n hLine.setPosition(closestPoint);\r\n }\r\n\r\n pointingHelper.position.copy(closestPoint);\r\n } else {\r\n freeLine.visible = false;\r\n vLine.visible = false;\r\n hLine.visible = false;\r\n }\r\n\r\n if (!pointingHelper.visible)\r\n pointingHelper.visible = true;\r\n\r\n return false;\r\n }\r\n\r\n onMouseDown(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n pointingHelper = controller.pointingHelper,\r\n linesHelper = controller.linesHelper;\r\n\r\n if (this.lineDeleteMode && linesHelper.hoverLine) {\r\n linesHelper.hoverLine.removeInstance();\r\n controller.viewModel.Cursor = this.cursor;\r\n }\r\n\r\n if (pointingHelper.visible) {\r\n if (this.lineMode === this.lineModeFree) {\r\n if (this.step === 0) {\r\n this.step = 1;\r\n } else {\r\n if (!this.freeLine.position.equals(this.freeLine.target)) {\r\n let newLine = new HelperLine(false, this.freeLine.position, this.freeLine.target);\r\n\r\n if (!linesHelper.hasLine(newLine))\r\n linesHelper.addLine(newLine);\r\n }\r\n\r\n pointingHelper.visible = false;\r\n\r\n this.step = 0;\r\n }\r\n } else {\r\n let newLine = new HelperLine(this.isVertical, this.closestPoint);\r\n\r\n if (!linesHelper.hasLine(newLine))\r\n linesHelper.addLine(newLine);\r\n\r\n pointingHelper.visible = false;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n onKeyDown(viewModel: ViewModel) {\r\n if (viewModel.keyPressed(27)) { //esc\r\n var controller = Controller.Current,\r\n pointingHelper = controller.pointingHelper;\r\n\r\n if (this.lineMode === this.lineModeFree) {\r\n if (this.step === 1) {\r\n\r\n var pos = new THREE.Vector3().copy(viewModel.roofPosition);\r\n this.freeLine.setPosition(pos, pos);\r\n\r\n pointingHelper.visible = false;\r\n\r\n this.step = 0;\r\n\r\n return true;\r\n }\r\n }\r\n\r\n //viewModel.deselectTool();\r\n //return true;\r\n }\r\n return false;\r\n }\r\n }\r\n\r\n export class RectInsert extends BaseTool {\r\n\r\n cursor = 'crosshair';\r\n orientation: number;\r\n ModCount: number;\r\n target: string;\r\n typeId: string;\r\n tempColors: number[];\r\n canSelect: boolean;\r\n isSelecting: boolean;\r\n\r\n private _v1 = new THREE.Vector3();\r\n\r\n onSelect(viewModel: ViewModel) {\r\n if (!viewModel.selectedInsertable) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n var controller = Controller.Current,\r\n selectionHelper = controller.instanceSelectionHelper,\r\n clientObject = viewModel.selectedInsertable;\r\n\r\n selectionHelper.visible = false;\r\n this.target = clientObject.dataType;\r\n this.orientation = clientObject.userData.Orientation;\r\n this.ModCount = clientObject.userData.ModCount;\r\n this.typeId = clientObject.userData.TypeId;\r\n\r\n if (!this.target) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n\r\n var tempColors: number[] = [];\r\n for (var i = 0, l = selectionHelper.children.length; i < l; i++) {\r\n var mat = (selectionHelper.children[i] as THREE.Mesh).material as THREE.MeshBasicMaterial;\r\n tempColors.push(mat.color.getHex());\r\n var hsl = mat.color.getHSL({ h: 0, s: 0, l: 0 });\r\n mat.color.setHSL(0, hsl.s, hsl.l);\r\n mat.needsUpdate = true;\r\n }\r\n this.tempColors = tempColors;\r\n\r\n viewModel.deselectAll();\r\n }\r\n\r\n onDeselect() {\r\n var controller = Controller.Current,\r\n selectionHelper = controller.instanceSelectionHelper,\r\n pointingHelper = controller.pointingHelper;\r\n var tempColors = this.tempColors;\r\n selectionHelper.visible = false;\r\n pointingHelper.visible = false;\r\n if (tempColors) {\r\n for (var i = 0, l = selectionHelper.children.length; i < l; i++) {\r\n var mat = (selectionHelper.children[i] as THREE.Mesh).material as THREE.MeshBasicMaterial;\r\n mat.color.setHex(tempColors[i]);\r\n mat.needsUpdate = true;\r\n }\r\n }\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n selectionHelper = controller.instanceSelectionHelper,\r\n pointingHelper = controller.pointingHelper,\r\n _v1 = this._v1;\r\n if (!pointingHelper.visible)\r\n pointingHelper.visible = true;\r\n\r\n if (this.canSelect && viewModel.mouseDown && viewModel.diffViewPosition.lengthSq() >= 100) {\r\n _v1.copy(viewModel.startRoofPosition);\r\n if (viewModel.enableSnapping && viewModel.canSnap) {\r\n var sp = controller.linesHelper.GetSnapWithPoint(_v1, controller.ClickTolerance / controller.orthoCamera.zoom);\r\n if (sp)\r\n _v1.add(sp);\r\n }\r\n\r\n selectionHelper.setCorner1(_v1);\r\n selectionHelper.visible = true;\r\n this.isSelecting = true;\r\n this.canSelect = false;\r\n }\r\n\r\n _v1.copy(viewModel.roofPosition);\r\n if (viewModel.enableSnapping && viewModel.canSnap) {\r\n var sp = controller.linesHelper.GetSnapWithPoint(_v1, controller.ClickTolerance / controller.orthoCamera.zoom);\r\n if (sp)\r\n _v1.add(sp);\r\n }\r\n pointingHelper.position.copy(_v1);\r\n\r\n if (this.isSelecting)\r\n selectionHelper.setCorner2(_v1);\r\n return false;\r\n }\r\n\r\n onMouseDown(viewModel: ViewModel) {\r\n this.isSelecting = false;\r\n this.canSelect = !viewModel.keyPressed(32); //spacebar\r\n return false;\r\n }\r\n\r\n onMouseUp(viewModel: ViewModel) {\r\n if (this.isSelecting) {\r\n var controller = Controller.Current,\r\n selectionHelper = controller.instanceSelectionHelper;\r\n selectionHelper.visible = false;\r\n var box = new THREE.Box3().setFromPoints([selectionHelper.corner1, selectionHelper.corner2]);\r\n if (box.max.x - box.min.x > 0 && box.max.y - box.min.y > 0) {\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"InsertClientObjectByRect\").Data({ x1: box.min.x, y1: box.min.y, x2: box.max.x, y2: box.max.y, orientation: this.orientation, typeString: this.target, typeId: this.typeId || null, disableSnapping: !!Controller.Current.viewModel.snappingDeactivated }).CallBack(result => {\r\n controller.updateManager.clearHistory();\r\n controller.clearClientObjects();\r\n if (result) {\r\n var clientObjects = result.ClientObects,\r\n changes = result.Changes;\r\n\r\n if (clientObjects && clientObjects.length)\r\n controller.addClientObjects(clientObjects);\r\n\r\n controller.updateManager.handleModifiedChanges(changes, false);\r\n }\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n });\r\n }\r\n }\r\n this.isSelecting = false;\r\n\r\n return false;\r\n }\r\n }\r\n\r\n export class SwitchTransparenceAll extends BaseTool {\r\n\r\n isSwitchOn = false;\r\n\r\n onSelect(viewModel: ViewModel) {\r\n console.log(\"SwitchTransparenceAll onSelect!!!\");\r\n Controller.Current.switchTransparenceAll();\r\n this.isSwitchOn = !this.isSwitchOn;\r\n //if (!this.isSwitchOn)\r\n // viewModel.setTool(null);\r\n viewModel.deselectTool();\r\n //viewModel.deselectAll();\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n console.log(\"SwitchTransparenceAll DESELECT!!!\");\r\n }\r\n\r\n //onMouseMove(viewModel: ViewModel) {\r\n // return false;\r\n //}\r\n\r\n //onMouseUp(viewModel: ViewModel) {\r\n // console.log(\"SwitchTransparenceAll\");\r\n // return false;\r\n //}\r\n }\r\n\r\n export class ChangeInstanceType extends BaseTool {\r\n\r\n onSelect(viewModel: ViewModel, params: { newType?: string }) {\r\n var controller = Controller.Current;\r\n if (params && params.newType && typeof params.newType == \"string\") {\r\n\r\n var newType = params.newType,\r\n selectedIds = viewModel.selected.map((o) => {\r\n return o.instanceData.Id;\r\n });\r\n if (selectedIds.length) {\r\n LoaderManager.addLoadingJob();\r\n AManager.Ajax('Anordnung3DService.asmx', 'ChangeModuleObjectTypes', { idStrings: selectedIds, newType: newType }, (clientObjects: SolarProTool.Client3DObjectHolder) => {\r\n controller.setClientObjects(clientObjects, true);\r\n LoaderManager.finishLoadingJob();\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n LoaderManager.finishLoadingJob();\r\n });\r\n }\r\n }\r\n\r\n viewModel.deselectTool();\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n\r\n }\r\n }\r\n\r\n export class ChangeStaticSelected extends BaseTool {\r\n\r\n onSelect(viewModel: ViewModel, params: { set?: string }) {\r\n\r\n Controller.Current.switchStaticSelected(params && params.set == \"1\");\r\n\r\n viewModel.deselectTool();\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n\r\n }\r\n }\r\n\r\n export class ChangeTileType extends BaseTool {\r\n\r\n onSelect(viewModel: ViewModel) {\r\n\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n\r\n }\r\n\r\n onMouseUp(viewModel: ViewModel) {\r\n if (viewModel.selectedTool === 'changeTileType')\r\n viewModel.deselectTool();\r\n return false;\r\n }\r\n\r\n changeTile = (newType: string) => {\r\n var controller = Controller.Current,\r\n viewModel = controller.viewModel;\r\n\r\n var selectedIds = viewModel.selected.map((o) => {\r\n return o.instanceData.Id;\r\n });\r\n\r\n AManager.AjaxWithLoading('Anordnung3DService.asmx', 'ChangeModuleObjectTypes', { idStrings: selectedIds, newType: newType }, (clientObjects: SolarProTool.Client3DObjectHolder) => {\r\n if (clientObjects)\r\n controller.setClientObjects(clientObjects, true);\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n });\r\n\r\n viewModel.deselectTool();\r\n };\r\n }\r\n\r\n export class InsertSingle extends BaseTool {\r\n previewObject3d: THREE.Object3D = null;\r\n previewBounds = new THREE.Box3();\r\n center = new THREE.Vector3();\r\n localPosition = new THREE.Vector3();\r\n clientObjectPositions: { clientObject: ClientObject, positions: THREE.Vector3[], scales: THREE.Vector3[], colors: THREE.Color[] }[] = null;\r\n scaleInsert: boolean = false;\r\n scaleX: boolean = false;\r\n scaleY: boolean = false;\r\n savedPosition = new THREE.Vector3();\r\n savedCenter = new THREE.Vector3();\r\n step = 0;\r\n //target: string;\r\n //typeId: string;\r\n //orientation: number;\r\n //modCount: number;\r\n //id: number;\r\n initialized: boolean;\r\n canInsert: boolean;\r\n //options: number;\r\n\r\n onSelect(viewModel: ViewModel, params: { multiple?: string }) {\r\n var isMultiple = params && params.multiple == \"1\";\r\n\r\n var cl: { [id: string]: { clientObject: ClientObject, positions: THREE.Vector3[], scales: THREE.Vector3[], colors: THREE.Color[] } } = {},\r\n colorNeutral = new THREE.Color(0);\r\n this.scaleInsert = false;\r\n if (isMultiple) {\r\n\r\n if (!viewModel.selected.length) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n\r\n viewModel.selected.forEach(sel => {\r\n if (!sel._isDisposed && sel.clientObject && sel.clientObject.dataType) {\r\n var co = sel.clientObject;\r\n\r\n if (!cl[co.id])\r\n cl[co.id] = { clientObject: co, positions: [], scales: [], colors: [] };\r\n\r\n cl[co.id].positions.push(sel.position);\r\n cl[co.id].scales.push(sel.scale);\r\n if (sel.instanceData.InstanceColor)\r\n cl[co.id].colors.push(new THREE.Color().setHex(sel.instanceData.InstanceColor).multiplyScalar(2).addScalar(-1));\r\n else\r\n cl[co.id].colors.push(colorNeutral);\r\n }\r\n });\r\n } else {\r\n if (!viewModel.selectedInsertable) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n var co = viewModel.selectedInsertable;\r\n var col = co.dataType.indexOf(\"RailObject\") != -1 ? new THREE.Color(1.25, -0.75, -0.75) : colorNeutral;\r\n cl[co.id] = { clientObject: co, positions: [new THREE.Vector3()], scales: [new THREE.Vector3(1, 1, 1)], colors: [col] };\r\n var scaleInsert = this.scaleInsert = co.canScaleInsertInstances;\r\n if (scaleInsert) {\r\n this.scaleX = co.canBeScaledX;\r\n this.scaleY = co.canBeScaledY;\r\n }\r\n }\r\n\r\n //var clientObject = viewModel.selectedInsertable;\r\n //var controller = Controller.Current;\r\n\r\n this.clientObjectPositions = Object.keys(cl).map(k => cl[k]);\r\n\r\n if (!this.clientObjectPositions.length || this.clientObjectPositions.every(clp => !clp.positions.length)) {\r\n viewModel.deselectTool();\r\n viewModel.selectedInsertable = null;\r\n return;\r\n }\r\n\r\n //this.target = clientObject.dataType;\r\n //this.orientation = clientObject.userData.Orientation;\r\n //this.modCount = clientObject.userData.ModCount;\r\n //this.id = clientObject.id;\r\n //this.options = clientObject.userData ? clientObject.userOptions : 0;\r\n //this.typeId = clientObject.userData.TypeId;\r\n\r\n //if (!clientObject.dataType || !controller.Objects[clientObject.id]) {\r\n // viewModel.deselectTool();\r\n // viewModel.selectedInsertable = null;\r\n // return;\r\n //}\r\n\r\n this.initialized = false;\r\n this.canInsert = false;\r\n this.step = 0;\r\n }\r\n\r\n buildPreview(viewModel: ViewModel) {\r\n var bounds = this.previewBounds,\r\n boundingSphere: THREE.Sphere = new THREE.Sphere(),\r\n clientObjectPositions = this.clientObjectPositions,\r\n previewObject3D = this.previewObject3d = (this.previewObject3d || new THREE.Object3D());\r\n\r\n bounds.makeEmpty();\r\n\r\n //var isMultiple = clientObjectPositions.length > 1 || clientObjectPositions.some(clp => clp.positions.length > 1);\r\n\r\n clientObjectPositions.forEach(clp => {\r\n var clientObject = clp.clientObject,\r\n sharedMeshes = clientObject.SharedMeshes,\r\n positions = clp.positions,\r\n clScales = clp.scales,\r\n clColors = clp.colors,\r\n maxInstancedCount = positions.length,\r\n posBounds = new THREE.Box3(),\r\n geometryBounds = new THREE.Box3();\r\n\r\n if (!positions.length)\r\n return;\r\n\r\n var hasScale = (clientObject.userOptions & Client3DObectOptions.ScaleX) !== 0 || (clientObject.userOptions & Client3DObectOptions.ScaleY) !== 0;\r\n\r\n var offsets = new THREE.InstancedBufferAttribute(new Float32Array(maxInstancedCount * 3), 3, false, 1),\r\n scales = hasScale ? new THREE.InstancedBufferAttribute(new Float32Array(maxInstancedCount * 3), 3, false, 1) : null,\r\n colors = new THREE.InstancedBufferAttribute(new Float32Array(maxInstancedCount * 4), 4, false, 1);\r\n\r\n var maxScale = 1;\r\n var instanceIndex = 0;\r\n\r\n colors.needsUpdate = true;\r\n offsets.needsUpdate = true;\r\n if (scales) {\r\n scales.needsUpdate = true;\r\n\r\n for (var i = maxInstancedCount; i--;) {\r\n var pos = positions[i],\r\n scale = clScales[i],\r\n col = clColors[i];\r\n\r\n maxScale = Math.max(maxScale, scale.x, scale.y);\r\n posBounds.expandByPoint(pos);\r\n offsets.setXYZ(instanceIndex, pos.x, pos.y, pos.z);\r\n scales.setXYZ(instanceIndex, scale.x, scale.y, scale.z);\r\n colors.setXYZW(instanceIndex, col.r, col.g, col.b, 1);\r\n ++instanceIndex;\r\n }\r\n } else {\r\n for (var i = maxInstancedCount; i--;) {\r\n var pos = positions[i],\r\n col = clColors[i];\r\n\r\n posBounds.expandByPoint(pos);\r\n offsets.setXYZ(instanceIndex, pos.x, pos.y, pos.z);\r\n colors.setXYZW(instanceIndex, col.r, col.g, col.b, 1);\r\n ++instanceIndex;\r\n }\r\n }\r\n\r\n for (var j = sharedMeshes.length; j--;) {\r\n var sharedMesh = sharedMeshes[j],\r\n sharedMeshGeometry = sharedMesh.geometry instanceof THREE.Geometry ? (new THREE.BufferGeometry()).fromGeometry(sharedMesh.geometry) : (new THREE.BufferGeometry()).copy(sharedMesh.geometry);\r\n\r\n sharedMeshGeometry.applyMatrix4(sharedMesh.matrix);\r\n\r\n if (sharedMeshGeometry.boundingBox === null)\r\n sharedMeshGeometry.computeBoundingBox();\r\n\r\n if (sharedMeshGeometry.boundingSphere === null)\r\n sharedMeshGeometry.computeBoundingSphere();\r\n\r\n geometryBounds.union(sharedMeshGeometry.boundingBox);\r\n\r\n var buildGeometry = (new THREE.InstancedBufferGeometry()).copy(sharedMeshGeometry as THREE.InstancedBufferGeometry);\r\n buildGeometry.maxInstancedCount = maxInstancedCount;\r\n buildGeometry.setAttribute('offseti', offsets);\r\n buildGeometry.setAttribute('colori', colors);\r\n if (scales)\r\n buildGeometry.setAttribute('scalei', scales);\r\n\r\n var mesh = new THREE.Mesh(buildGeometry, sharedMesh.material);\r\n\r\n if (sharedMesh.renderOrder)\r\n mesh.renderOrder = sharedMesh.renderOrder;\r\n previewObject3D.add(mesh);\r\n }\r\n\r\n if (positions.length > 1) {\r\n posBounds.expandByPoint(geometryBounds.min.clone().multiplyScalar(maxScale).add(posBounds.min));\r\n posBounds.expandByPoint(geometryBounds.max.clone().multiplyScalar(maxScale).add(posBounds.max));\r\n bounds.union(posBounds);\r\n } else {\r\n bounds.expandByPoint(geometryBounds.min.clone().multiplyScalar(maxScale).add(positions[0]));\r\n bounds.expandByPoint(geometryBounds.max.clone().multiplyScalar(maxScale).add(positions[0]));\r\n }\r\n });\r\n\r\n bounds.getBoundingSphere(boundingSphere);\r\n\r\n previewObject3D.children.forEach(child => {\r\n if (child instanceof THREE.Mesh) {\r\n var geometry = child.geometry;\r\n geometry.boundingSphere = boundingSphere;\r\n }\r\n });\r\n\r\n bounds.getCenter(this.center).setZ(0);\r\n\r\n previewObject3D.position.copy(viewModel.roofPosition).sub(this.center);\r\n\r\n previewObject3D.visible = true;\r\n\r\n Controller.Current.viewModel.currentInstance.add(previewObject3D, true);\r\n\r\n this.previewObject3d = previewObject3D;\r\n\r\n this.canInsert = true;\r\n this.initialized = true;\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n previewObject3D = this.previewObject3d;\r\n if (previewObject3D) {\r\n controller.viewModel.currentInstance.remove(previewObject3D, true);\r\n\r\n var children: THREE.Object3D[] = [];\r\n for (var i = 0, j = previewObject3D.children.length; i < j; i++) {\r\n children.push(previewObject3D.children[i]);\r\n }\r\n for (var i = 0, j = children.length; i < j; i++) {\r\n var child = children[i];\r\n previewObject3D.remove(child);\r\n spt.ThreeJs.utils.disposeObject3D(child, true, true, false);\r\n }\r\n previewObject3D.visible = false;\r\n }\r\n this.clientObjectPositions = null;\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n var controller = Controller.Current;\r\n if (!this.initialized)\r\n this.buildPreview(viewModel);\r\n\r\n var previewObject3D = this.previewObject3d;\r\n\r\n if (this.scaleInsert && this.step === 1) {\r\n var rp = viewModel.roofPosition,\r\n sp = this.savedPosition,\r\n c = this.savedCenter.copy(rp).sub(sp).multiplyScalar(0.5),\r\n scaleX = this.scaleX,\r\n scaleY = this.scaleY;\r\n\r\n if (!scaleX)\r\n c.setX(0);\r\n if (!scaleY)\r\n c.setY(0);\r\n\r\n c.add(sp);\r\n\r\n previewObject3D.scale.set(scaleX ? Math.abs(sp.x - rp.x) : 1, scaleY ? Math.abs(sp.y - rp.y) : 1, 1);\r\n previewObject3D.position.copy(c).setZ(10).sub(this.center);\r\n } else {\r\n previewObject3D.scale.set(1, 1, 1);\r\n previewObject3D.position.copy(viewModel.roofPosition).setZ(10).sub(this.center);\r\n }\r\n\r\n if (viewModel.enableSnapping && viewModel.canSnap)\r\n previewObject3D.position.add(controller.linesHelper.GetSnapWithBoxOffset(this.previewBounds, previewObject3D.position, controller.ClickTolerance / controller.orthoCamera.zoom));\r\n return false;\r\n }\r\n\r\n onMouseDown(viewModel: ViewModel): boolean {\r\n if (!this.canInsert)\r\n return false;\r\n\r\n if (this.scaleInsert && this.step === 0) {\r\n this.savedPosition.copy(viewModel.roofPosition);\r\n this.step = 1;\r\n return;\r\n }\r\n return false;\r\n }\r\n\r\n onMouseUp(viewModel: ViewModel) {\r\n var previewObject3D = this.previewObject3d;\r\n\r\n if (!this.canInsert)\r\n return false;\r\n\r\n this.step = 0;\r\n\r\n if (viewModel.selected.length) {\r\n viewModel.deselectAll();\r\n ko.tasks.runEarly();\r\n }\r\n\r\n var params: SolarProTool.InsertClientObjectsParams[] = [],\r\n offset = previewObject3D.position,\r\n scale = previewObject3D.scale,\r\n clientObjectPositions = this.clientObjectPositions;\r\n\r\n clientObjectPositions.forEach(clp => {\r\n var clientObject = clp.clientObject,\r\n param: SolarProTool.InsertClientObjectsParams = {\r\n Positions: clp.positions.map(p => p.clone().add(offset).setZ(0)),\r\n Scales: clp.scales.map(p => p.clone().multiply(scale).setZ(0)),\r\n ModCount: clientObject.userData.ModCount,\r\n Orientation: clientObject.userData.Orientation,\r\n TypeString: clientObject.dataType,\r\n Options: clientObject.userOptions,\r\n TypeId: clientObject.userData.TypeId,\r\n SourceId: clientObject.id\r\n };\r\n params.push(param);\r\n });\r\n\r\n this.canInsert = false;\r\n\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"InsertClientObjects\").Data({ clientObjectsParams: params, ctrlDown: !!viewModel.ctrlDown, disableSnapping: !!Controller.Current.viewModel.snappingDeactivated, compressData: true }).CallBack(result => {\r\n if (result && result.ClientObjectsDatas) {\r\n result.ClientObjectsDatas.forEach(clientObjectsData => {\r\n var genericClientObjectInstanceData = clientObjectsData.ClientObectData,\r\n clientObject = Controller.Current.Objects[clientObjectsData.SourceId];\r\n\r\n //self.handleModifiedChanges(changes, false);\r\n if (clientObject && genericClientObjectInstanceData && genericClientObjectInstanceData.Id && genericClientObjectInstanceData.Id.length) {\r\n IterateClientObectDataArrays(genericClientObjectInstanceData, data => { clientObject.insertClientObjectInstance(data, true); });\r\n Controller.Current.updateManager.onNoError();\r\n }\r\n });\r\n\r\n var changes: IChange[] = (result.Changes) as any;\r\n\r\n if (changes && changes.length)\r\n Controller.Current.updateManager.handleModifiedChanges(changes, false);\r\n }\r\n\r\n this.canInsert = true;\r\n }, () => {\r\n DManager.showErrorMessage(\"Error on sending changes to the server.\");\r\n this.canInsert = true;\r\n });\r\n\r\n return false;\r\n }\r\n\r\n onKeyDown(viewModel: ViewModel) {\r\n if (viewModel.keyPressed(27)) { //esc\r\n viewModel.deselectTool();\r\n viewModel.selectedInsertable = null;\r\n return true;\r\n }\r\n return false;\r\n }\r\n }\r\n\r\n export class PanTool extends BaseTool {\r\n cursor = 'grab';\r\n\r\n onSelect(viewModel: ViewModel) {\r\n var controller = Controller.Current;\r\n if (!controller) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n var controls = controller.controls;\r\n if (!controls) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n controls.convertLeftMouse = controls.STATE.PAN;\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n var controller = Controller.Current;\r\n if (!controller)\r\n return;\r\n var controls = controller.controls;\r\n if (!controls)\r\n return;\r\n controls.convertLeftMouse = controls.STATE.NONE;\r\n }\r\n\r\n onMouseDown(viewModel: ViewModel) {\r\n Controller.Current.viewModel.Cursor = ('grabbing');\r\n return false;\r\n }\r\n\r\n onMouseUp(viewModel: ViewModel) {\r\n Controller.Current.viewModel.Cursor = ('grab');\r\n return false;\r\n }\r\n }\r\n\r\n export class RotateTool extends BaseTool {\r\n onSelect(viewModel: ViewModel) {\r\n var controller = Controller.Current;\r\n if (!controller) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n var controls = controller.controls;\r\n if (!controls) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n controls.convertLeftMouse = controls.STATE.ROTATE;\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n var controller = Controller.Current;\r\n if (!controller)\r\n return;\r\n var controls = controller.controls;\r\n if (!controls)\r\n return;\r\n controls.convertLeftMouse = controls.STATE.NONE;\r\n }\r\n }\r\n\r\n export class ZoomTool extends BaseTool {\r\n onSelect(viewModel: ViewModel) {\r\n var controller = Controller.Current;\r\n if (!controller) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n var controls = controller.controls;\r\n if (!controls) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n controls.convertLeftMouse = controls.STATE.ZOOM;\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n var controller = Controller.Current;\r\n if (!controller)\r\n return;\r\n var controls = controller.controls;\r\n if (!controls)\r\n return;\r\n controls.convertLeftMouse = controls.STATE.NONE;\r\n }\r\n }\r\n\r\n export class ParkingAreaTool extends BaseTool {\r\n cursor = 'crosshair';\r\n private _lastPosition = new THREE.Vector3();\r\n private _step: number = 0;\r\n private _directedArea: spt.ThreeJs.utils.DirectedAreaDefinition = null;\r\n private _directedAreaVerticalLine: DirectedAreaVerticalLine = null;\r\n private _lastSubArea: number = -1;\r\n mode = 0;\r\n static ModeEdit = 0;\r\n static ModeMeasure = 1;\r\n static ModeToggleAreas = 2;\r\n static ModeExcludeIncludeAreas = 3;\r\n\r\n onSelect(viewModel: ViewModel, params: { mode?: string }) {\r\n var controller = Controller.Current,\r\n pointingHelper = controller.pointingHelper,\r\n directedAreaHolder = controller.directedAreaHolder;\r\n\r\n pointingHelper.visible = false;\r\n\r\n this._directedAreaVerticalLine = null;\r\n this._lastSubArea = -1;\r\n\r\n this.mode = params && params.mode ? parseInt(params.mode) : 0;\r\n\r\n this.cursor = this.mode === ParkingAreaTool.ModeMeasure ? 'help' : 'crosshair';\r\n\r\n viewModel.deselectAll();\r\n\r\n directedAreaHolder.deselectAll();\r\n\r\n directedAreaHolder.setHoverAreaObj(null);\r\n\r\n this.reset();\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n pointingHelper = controller.pointingHelper,\r\n directedAreaHolder = controller.directedAreaHolder;\r\n\r\n this._directedAreaVerticalLine = null;\r\n this._lastSubArea = -1;\r\n\r\n pointingHelper.visible = false;\r\n\r\n viewModel.deselectAll();\r\n directedAreaHolder.deselectAll();\r\n\r\n directedAreaHolder.setHoverAreaObj(null);\r\n\r\n this.reset();\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n segmentHighlightHelper = controller.segmentHighlightHelper,\r\n directedAreaHolder = controller.directedAreaHolder,\r\n pointingHelper = controller.pointingHelper,\r\n camera = controller.orthoCamera,\r\n tolerance = (controller.ClickTolerance / camera.zoom) * 0.5,\r\n linesHelper = controller.linesHelper,\r\n rp = this._lastPosition.copy(viewModel.roofPosition);\r\n\r\n controller.viewModel.Cursor = this.cursor;\r\n\r\n directedAreaHolder.setHoverAreaObj(null);\r\n\r\n if (this.mode === ParkingAreaTool.ModeToggleAreas) {\r\n\r\n let mObj = directedAreaHolder.getClosestByPosition(rp, tolerance * 0.5);\r\n if (mObj) {\r\n\r\n var subArea = mObj.area.getSubAreaByIndex(mObj.area.getSubAreaIndexByPoint(rp), false, true);\r\n\r\n if (subArea) {\r\n\r\n var saWidth = subArea[0].distanceTo(subArea[1]);\r\n\r\n controller.viewModel.Cursor = 'pointer';\r\n\r\n segmentHighlightHelper.setStartEnd(subArea[0].add(subArea[1]).multiplyScalar(0.5), subArea[2].add(subArea[3]).multiplyScalar(0.5), true, saWidth, 400);\r\n\r\n directedAreaHolder.setHoverAreaObj(mObj.area);\r\n } else if (segmentHighlightHelper.visible)\r\n segmentHighlightHelper.reset();\r\n } else if (segmentHighlightHelper.visible)\r\n segmentHighlightHelper.reset();\r\n\r\n return false;\r\n }\r\n else if (this.mode === ParkingAreaTool.ModeExcludeIncludeAreas) {\r\n\r\n let mObj = directedAreaHolder.getClosestByPosition(rp, tolerance * 0.5);\r\n if (mObj) {\r\n\r\n var h1 = directedAreaHolder.getHorizontalLengthByPoint(rp, mObj.area);\r\n\r\n controller.viewModel.Cursor = 'pointer';\r\n\r\n if (this._directedAreaVerticalLine) {\r\n var h2 = this._directedAreaVerticalLine;\r\n\r\n if (h2.area.IdString === mObj.area.IdString)\r\n segmentHighlightHelper.setStartEnd(h1.p1.clone().add(h2.p1).multiplyScalar(0.5), h1.p2.clone().add(h2.p2).multiplyScalar(0.5), true, Math.max(400, h1.p1.distanceTo(h2.p1)), 400);\r\n else if (segmentHighlightHelper.visible)\r\n segmentHighlightHelper.reset();\r\n\r\n } else\r\n segmentHighlightHelper.setStartEnd(h1.p1, h1.p2, true, 400);\r\n\r\n directedAreaHolder.setHoverAreaObj(mObj.area);\r\n\r\n } else if (segmentHighlightHelper.visible)\r\n segmentHighlightHelper.reset();\r\n\r\n\r\n\r\n\r\n return false;\r\n }\r\n\r\n var snap = viewModel.shiftDown ? null : linesHelper.GetSnapWithPoint(rp, tolerance);\r\n if (snap) {\r\n rp.add(snap);\r\n pointingHelper.position.copy(rp);\r\n pointingHelper.visible = true;\r\n } else if (pointingHelper.visible)\r\n pointingHelper.visible = false;\r\n\r\n switch (this._step) {\r\n case 0:\r\n {\r\n let mObj = directedAreaHolder.getClosestByPosition(rp, tolerance * 0.5);\r\n if (mObj) {\r\n directedAreaHolder.setHoverAreaObj(mObj.area, mObj.edge, mObj.edgeIdent);\r\n\r\n if (this.mode === ParkingAreaTool.ModeEdit)\r\n controller.viewModel.Cursor = 'pointer';\r\n\r\n segmentHighlightHelper.setStartEnd(mObj.edge[0], mObj.edge[1], true, Math.min(tolerance, Math.min(mObj.area.length, mObj.area.height) * 0.5), 400);\r\n\r\n if (pointingHelper.visible)\r\n pointingHelper.visible = false;\r\n\r\n return false;\r\n } else {\r\n if (segmentHighlightHelper.visible)\r\n segmentHighlightHelper.reset();\r\n }\r\n }\r\n break;\r\n case 1: //set second point\r\n {\r\n if (this._directedArea) {\r\n if (viewModel.shiftDown && linesHelper.hasLines()) {\r\n var dir = rp.clone().sub(this._directedArea.start);\r\n var dirl = dir.length();\r\n if (dirl > 0) {\r\n dir.divideScalar(dirl);\r\n var dl = linesHelper.getByClosestDirection(dir);\r\n if (dl) {\r\n rp.copy(dl.direction);\r\n if (rp.dot(dir) < 0)\r\n rp.negate();\r\n rp.multiplyScalar(dirl).add(this._directedArea.start);\r\n }\r\n }\r\n\r\n //snap afterwards\r\n snap = linesHelper.GetSnapWithPoint(rp, tolerance);\r\n if (snap) {\r\n rp.add(snap);\r\n pointingHelper.position.copy(rp);\r\n pointingHelper.visible = true;\r\n } else if (pointingHelper.visible)\r\n pointingHelper.visible = false;\r\n }\r\n if (this.mode === ParkingAreaTool.ModeEdit && viewModel.stepsWidth > 0) {\r\n var trp = rp.sub(this._directedArea.start);\r\n var curLen = trp.length();\r\n var targetLen = Math.max(1, Math.round(curLen / viewModel.stepsWidth)) * viewModel.stepsWidth;\r\n rp.multiplyScalar(targetLen / curLen).add(this._directedArea.start);\r\n }\r\n this._directedArea.setPositions(null, rp, null);\r\n viewModel.measuredLength = Math.round(this._directedArea.length);\r\n }\r\n }\r\n break;\r\n case 2: //expand top\r\n {\r\n if (this._directedArea) {\r\n this._directedArea.setTop(rp);\r\n if (this.mode === ParkingAreaTool.ModeEdit && viewModel.stepsHeight > 0)\r\n this._directedArea.setHeight(Math.max(1, Math.round(this._directedArea.height / viewModel.stepsHeight)) * viewModel.stepsHeight);\r\n }\r\n }\r\n break;\r\n case 3: //expand left\r\n case 6: //new subarea left\r\n {\r\n if (this.mode === ParkingAreaTool.ModeEdit && viewModel.stepsWidth > 0) {\r\n let trp = this._directedArea.start.clone().sub(this._directedArea.end).normalize();\r\n let curLen = trp.dot(rp.sub(this._directedArea.end));\r\n let targetLen = Math.max(1, Math.round(curLen / viewModel.stepsWidth)) * viewModel.stepsWidth;\r\n rp.copy(trp).multiplyScalar(targetLen).add(this._directedArea.end);\r\n }\r\n if (this._directedArea)\r\n this._directedArea.setLeft(rp, this._step === 6);\r\n }\r\n break;\r\n case 4: //expand right\r\n case 7: //new subarea right\r\n {\r\n if (this.mode === ParkingAreaTool.ModeEdit && viewModel.stepsWidth > 0) {\r\n let trp = this._directedArea.end.clone().sub(this._directedArea.start).normalize();\r\n let curLen = trp.dot(rp.sub(this._directedArea.start));\r\n let targetLen = Math.max(1, Math.round(curLen / viewModel.stepsWidth)) * viewModel.stepsWidth;\r\n rp.copy(trp).multiplyScalar(targetLen).add(this._directedArea.start);\r\n }\r\n if (this._directedArea)\r\n this._directedArea.setRight(rp, this._step === 7);\r\n }\r\n break;\r\n case 5: //expand bottom\r\n {\r\n if (this._directedArea)\r\n this._directedArea.setBottom(rp);\r\n }\r\n break;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n saveDirectedArea(area?: spt.ThreeJs.utils.DirectedAreaDefinition) {\r\n var controller = Controller.Current,\r\n viewModel = controller.viewModel;\r\n\r\n var da = area || this._directedArea;\r\n\r\n if (da) {\r\n\r\n if (da.length <= 10 || da.height <= 10) {\r\n this.reset();\r\n return;\r\n }\r\n\r\n da.applyFlip();\r\n\r\n var entrySetting = viewModel.genericParameters.getCurrentEntrySetting();\r\n if (entrySetting) {\r\n var usrData = da.isDynamic ? entrySetting.getSettingsObject() : da.userData;\r\n\r\n if (da.isDynamic) {\r\n if (viewModel.stepsWidth > 0) {\r\n usrData[\"ParkingAreaCount\"] = [Math.round(100 * da.length / viewModel.stepsWidth) / 100];\r\n usrData[\"ParkingAreaSize\"] = [Math.round(viewModel.stepsWidth)];\r\n }\r\n if (viewModel.stepsHeight > 0)\r\n usrData[\"ParkingAreaRows\"] = [Math.round(da.height / viewModel.stepsHeight)];\r\n }\r\n\r\n var idString = da.IdString;\r\n\r\n da.isDynamic = false;\r\n\r\n var buildingParam: SolarProTool.BuildingParams = {\r\n Id: idString,\r\n GenericSettings: JSON.stringify(usrData),\r\n BuildingClassName: controller.BuildingClassName,\r\n BuildingSettingsClassName: usrData['TypeName'],\r\n AreaDefinition: da.GetSimple()\r\n };\r\n\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DServiceBuildings.asmx\").Call('EditBuilding').Data({ buildingParam: buildingParam }).CallBack((result) => {\r\n if (result) {\r\n if (result.IdString !== idString)\r\n controller.directedAreaHolder.removeById(idString);\r\n controller.directedAreaHolder.addDirectedAreaDefinition(result);\r\n }\r\n });\r\n }\r\n }\r\n\r\n if (!area)\r\n this._directedArea = null;\r\n }\r\n\r\n onMouseDown(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n segmentHighlightHelper = controller.segmentHighlightHelper,\r\n directedAreaHolder = controller.directedAreaHolder,\r\n hoverAreaObj = directedAreaHolder.hoverAreaObj;\r\n\r\n if (LoaderManager.isLoading())\r\n return;\r\n\r\n if (this.mode === ParkingAreaTool.ModeToggleAreas) {\r\n let camera = controller.orthoCamera,\r\n tolerance = (controller.ClickTolerance / camera.zoom) * 0.5,\r\n rp = this._lastPosition.copy(viewModel.roofPosition),\r\n mObj = directedAreaHolder.getClosestByPosition(rp, tolerance * 0.5);\r\n\r\n if (mObj && segmentHighlightHelper.visible) {\r\n\r\n var subAreaIndex = mObj.area.getSubAreaIndexByPoint(rp);\r\n\r\n if (viewModel.shiftDown && this._directedArea && this._directedArea.IdString === mObj.area.IdString && this._lastSubArea >= 0) {\r\n let idx1 = this._lastSubArea, idx2 = subAreaIndex;\r\n\r\n if (idx1 < idx2) {\r\n idx1++;\r\n } else if (idx1 > idx2) {\r\n idx1 = subAreaIndex;\r\n idx2 = this._lastSubArea - 1;\r\n }\r\n\r\n for (var i = idx1; i <= idx2; i++)\r\n mObj.area.addToDisabledSubAreas(i, true);\r\n\r\n } else {\r\n mObj.area.addToDisabledSubAreas(subAreaIndex, true);\r\n }\r\n\r\n this._directedArea = mObj.area;\r\n this._lastSubArea = subAreaIndex;\r\n\r\n mObj.area.rebuild();\r\n\r\n segmentHighlightHelper.reset();\r\n\r\n this.saveDirectedArea(mObj.area);\r\n }\r\n return false;\r\n }\r\n else if (this.mode === ParkingAreaTool.ModeExcludeIncludeAreas) {\r\n let camera = controller.orthoCamera,\r\n tolerance = (controller.ClickTolerance / camera.zoom) * 0.5,\r\n rp = this._lastPosition.copy(viewModel.roofPosition),\r\n mObj = directedAreaHolder.getClosestByPosition(rp, tolerance * 0.5);\r\n\r\n if (mObj) {\r\n\r\n this._directedAreaVerticalLine = directedAreaHolder.getHorizontalLengthByPoint(rp, mObj.area);\r\n\r\n }\r\n\r\n return false;\r\n }\r\n\r\n switch (this._step) {\r\n case 0:\r\n {\r\n if (this.mode === ParkingAreaTool.ModeEdit && viewModel.shiftDown && hoverAreaObj && hoverAreaObj.length > 0 && hoverAreaObj.height > 0) {\r\n\r\n switch (directedAreaHolder.hoverEdgeIdent) {\r\n case spt.ThreeJs.utils.DirectedAreaDefinition.EdgeBottom:\r\n\r\n break;\r\n case spt.ThreeJs.utils.DirectedAreaDefinition.EdgeRight:\r\n this._step = 7;\r\n this._directedArea = hoverAreaObj;\r\n if (hoverAreaObj.subRanges.length <= 1 || hoverAreaObj.subRanges[hoverAreaObj.subRanges.length - 1] > 0)\r\n hoverAreaObj.appendSubRange(0);\r\n break;\r\n case spt.ThreeJs.utils.DirectedAreaDefinition.EdgeTop:\r\n\r\n break;\r\n case spt.ThreeJs.utils.DirectedAreaDefinition.EdgeLeft:\r\n this._step = 6;\r\n this._directedArea = hoverAreaObj;\r\n if (hoverAreaObj.subRanges.length <= 1 || hoverAreaObj.subRanges[0] > 0)\r\n hoverAreaObj.prependSubRange(0);\r\n break;\r\n }\r\n\r\n //var newStep = 2;\r\n\r\n //switch (directedAreaHolder.hoverEdgeIdent) {\r\n // case spt.ThreeJs.utils.DirectedAreaDefinition.EdgeBottom:\r\n // this._directedArea = directedAreaHolder.addDirectedAreaDefinition({\r\n // start: hoverAreaObj.start,\r\n // end: hoverAreaObj.end,\r\n // dimensionPosition: hoverAreaObj.start.clone().sub(hoverAreaObj.offsetVector),\r\n // isDynamic: true,\r\n // withArrow: true,\r\n // flip: true\r\n // });\r\n // break;\r\n // case spt.ThreeJs.utils.DirectedAreaDefinition.EdgeRight:\r\n // newStep = 4;\r\n // this._directedArea = directedAreaHolder.addDirectedAreaDefinition({\r\n // start: hoverAreaObj.end,\r\n // end: hoverAreaObj.end.clone().add(hoverAreaObj.directionVector),\r\n // dimensionPosition: hoverAreaObj.end2,\r\n // isDynamic: true,\r\n // withArrow: true\r\n // });\r\n // break;\r\n // case spt.ThreeJs.utils.DirectedAreaDefinition.EdgeTop:\r\n // this._directedArea = directedAreaHolder.addDirectedAreaDefinition({\r\n // start: hoverAreaObj.start2,\r\n // end: hoverAreaObj.end2,\r\n // dimensionPosition: hoverAreaObj.start2.clone().add(hoverAreaObj.offsetVector),\r\n // isDynamic: true,\r\n // withArrow: true,\r\n // flip: true\r\n // });\r\n // break;\r\n // case spt.ThreeJs.utils.DirectedAreaDefinition.EdgeLeft:\r\n // newStep = 3;\r\n // this._directedArea = directedAreaHolder.addDirectedAreaDefinition({\r\n // start: hoverAreaObj.start.clone().sub(hoverAreaObj.directionVector),\r\n // end: hoverAreaObj.start,\r\n // dimensionPosition: hoverAreaObj.start2,\r\n // isDynamic: true,\r\n // withArrow: true\r\n // });\r\n // break;\r\n //}\r\n\r\n //if (this._directedArea)\r\n // this._step = newStep;\r\n //else\r\n // this.reset();\r\n\r\n if (!this._directedArea)\r\n this.reset();\r\n\r\n directedAreaHolder.setHoverAreaObj(null);\r\n\r\n } else if (this.mode === ParkingAreaTool.ModeEdit && viewModel.ctrlDown && hoverAreaObj && hoverAreaObj.length > 0 && hoverAreaObj.height > 0) {\r\n switch (directedAreaHolder.hoverEdgeIdent) {\r\n case spt.ThreeJs.utils.DirectedAreaDefinition.EdgeBottom:\r\n this._step = 5;\r\n this._directedArea = hoverAreaObj;\r\n break;\r\n case spt.ThreeJs.utils.DirectedAreaDefinition.EdgeRight:\r\n this._step = 4;\r\n this._directedArea = hoverAreaObj;\r\n break;\r\n case spt.ThreeJs.utils.DirectedAreaDefinition.EdgeTop:\r\n this._step = 2;\r\n this._directedArea = hoverAreaObj;\r\n break;\r\n case spt.ThreeJs.utils.DirectedAreaDefinition.EdgeLeft:\r\n this._step = 3;\r\n this._directedArea = hoverAreaObj;\r\n break;\r\n }\r\n } else {\r\n if (this.mode === ParkingAreaTool.ModeMeasure && segmentHighlightHelper.visible) {\r\n viewModel.measuredLength = Math.round(segmentHighlightHelper.start.distanceTo(segmentHighlightHelper.end));\r\n return false;\r\n } else\r\n viewModel.measuredLength = 0;\r\n\r\n if (segmentHighlightHelper.visible)\r\n segmentHighlightHelper.reset();\r\n\r\n directedAreaHolder.deselectAll();\r\n\r\n var p = this._lastPosition;\r\n\r\n this._directedArea = directedAreaHolder.addDirectedAreaDefinition({\r\n start: p,\r\n end: p,\r\n dimensionPosition: p,\r\n isDynamic: true,\r\n withArrow: true,\r\n flip: false,\r\n userData: null\r\n });\r\n\r\n directedAreaHolder.setHoverAreaObj(null);\r\n\r\n this._step = 1;\r\n }\r\n }\r\n break;\r\n case 1:\r\n {\r\n if (this._directedArea && this.mode === ParkingAreaTool.ModeEdit)\r\n this._step = 2;\r\n else\r\n this.reset();\r\n\r\n directedAreaHolder.setHoverAreaObj(null);\r\n }\r\n break;\r\n case 2: //expand top\r\n case 3: //expand left\r\n case 4: //expand right\r\n case 5: //expand bottom\r\n case 6: //new subarea left\r\n case 7: //new subarea right\r\n {\r\n if (this._directedArea) {\r\n this._directedArea.removeEmptySubranges();\r\n this.saveDirectedArea();\r\n }\r\n\r\n directedAreaHolder.setHoverAreaObj(null);\r\n this.reset();\r\n }\r\n break;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n onMouseUp(viewModel: ViewModel): boolean {\r\n var controller = Controller.Current,\r\n directedAreaHolder = controller.directedAreaHolder;\r\n\r\n if (LoaderManager.isLoading())\r\n return;\r\n\r\n if (this.mode === ParkingAreaTool.ModeExcludeIncludeAreas && this._directedAreaVerticalLine) {\r\n\r\n let rp = this._lastPosition.copy(viewModel.roofPosition);\r\n\r\n var h = this._directedAreaVerticalLine;\r\n\r\n this._directedAreaVerticalLine = null;\r\n\r\n if (h.area.length < 400)\r\n return false;\r\n\r\n var h2 = directedAreaHolder.getHorizontalLengthByPoint(rp, h.area);\r\n\r\n var t1 = Math.min(h.t, h2.t);\r\n var t2 = Math.max(h.t, h2.t);\r\n\r\n var l = t2 - t1;\r\n\r\n if (l < 400) {\r\n\r\n let m = (t1 + t2) * 0.5;\r\n t1 = m - 200;\r\n t2 = m + 200;\r\n\r\n }\r\n\r\n if (t1 < 0) {\r\n t2 -= t1;\r\n t1 = 0;\r\n }\r\n\r\n if (t2 > h.area.length) {\r\n var td = t2 - h.area.length;\r\n t2 -= td;\r\n t1 -= td;\r\n }\r\n\r\n if (l > h.area.length) {\r\n t1 = 0;\r\n t2 = h.area.length;\r\n }\r\n\r\n h.area.addInterval(t1, t2, viewModel.shiftDown);\r\n\r\n h.area.rebuild();\r\n\r\n this.saveDirectedArea(h.area);\r\n\r\n }\r\n\r\n return false;\r\n }\r\n\r\n onKeyDown(viewModel: ViewModel) {\r\n if (viewModel.keyPressed(27)) // esc\r\n this.reset();\r\n return false;\r\n }\r\n\r\n reset() {\r\n var controller = Controller.Current,\r\n directedAreaHolder = controller.directedAreaHolder,\r\n da = this._directedArea;\r\n\r\n if (da && this.mode !== ParkingAreaTool.ModeToggleAreas) {\r\n if (da.isDynamic) {\r\n directedAreaHolder.remove(da);\r\n da.dispose();\r\n } else if (da.IdString) {\r\n var id = da.IdString;\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DServiceBuildings.asmx\").Call('GetBuilding').Data({ id: id }).CallBack((result) => {\r\n if (result) {\r\n //reset area\r\n controller.directedAreaHolder.addDirectedAreaDefinition(result);\r\n } else {\r\n //area doesn't exist\r\n var t = controller.directedAreaHolder.getById(id);\r\n if (t) {\r\n controller.directedAreaHolder.remove(t);\r\n t.dispose();\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n this._directedArea = null;\r\n\r\n this._step = 0;\r\n }\r\n\r\n }\r\n\r\n export class RotateObjectTool extends BaseTool {\r\n\r\n pivot: THREE.Vector3 = new THREE.Vector3();\r\n start: THREE.Vector3 = new THREE.Vector3();\r\n end: THREE.Vector3 = new THREE.Vector3();\r\n currentRotationRad: number = 0;\r\n selUi: ISelectableUi[] = [];\r\n\r\n onSelect(viewModel: ViewModel) {\r\n\r\n var controller = Controller.Current;\r\n\r\n this.pivot.set(0, 0, 0);\r\n\r\n this.currentRotationRad = 0;\r\n\r\n this.selUi = viewModel.selectedUi.filter(selUi => {\r\n var selPivot = selUi.getPivot();\r\n if (selPivot) {\r\n this.pivot.add(selPivot);\r\n return true;\r\n }\r\n return false;\r\n });\r\n\r\n if (!viewModel.selectedUi.length || !this.selUi.length) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n\r\n this.pivot.divideScalar(this.selUi.length);\r\n this.start.copy(viewModel.roofPosition);\r\n this.end.copy(viewModel.roofPosition);\r\n\r\n if (this.start.distanceToSquared(this.pivot) < 0.001) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n\r\n controller.segmentsHelper.setLinePoints([this.pivot, this.end]);\r\n\r\n if (!controller.segmentsHelper.visible)\r\n controller.segmentsHelper.visible = true;\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n if (this.currentRotationRad) {\r\n this.selUi.forEach(sui => sui.rotateByPivot(this.pivot, -this.currentRotationRad));\r\n this.currentRotationRad = 0;\r\n }\r\n this.selUi = [];\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n this.end.copy(viewModel.roofPosition);\r\n this.applyRotation();\r\n return false;\r\n }\r\n\r\n onMouseUp(viewModel: ViewModel) {\r\n this.applyRotation();\r\n Controller.Current.directedAreaHolder.onDirectedAreasChanged(this.selUi, false);\r\n this.currentRotationRad = 0;\r\n this.reset();\r\n return false;\r\n }\r\n\r\n onKeyDown(viewModel: ViewModel) {\r\n if (viewModel.keyPressed(27)) // esc\r\n this.reset();\r\n return false;\r\n }\r\n\r\n reset() {\r\n var controller = Controller.Current,\r\n viewModel = controller.viewModel;\r\n\r\n if (this.currentRotationRad && this.selUi.length) {\r\n this.selUi.forEach(sui => sui.rotateByPivot(this.pivot, -this.currentRotationRad));\r\n this.currentRotationRad = 0;\r\n }\r\n\r\n controller.segmentsHelper.setLinePoints(null);\r\n\r\n if (controller.segmentsHelper.visible)\r\n controller.segmentsHelper.visible = false;\r\n\r\n viewModel.deselectTool();\r\n }\r\n\r\n applyRotation() {\r\n var controller = Controller.Current,\r\n viewModel = controller.viewModel,\r\n segmentsHelper = controller.segmentsHelper;\r\n\r\n if (viewModel.selectedTool !== 'rotateObjectTool' || this.pivot.distanceToSquared(this.start) < 0.001 || this.pivot.distanceToSquared(this.end) < 0.001) {\r\n if (segmentsHelper.visible)\r\n segmentsHelper.visible = false;\r\n return;\r\n }\r\n\r\n var ps = this.start.clone().sub(this.pivot);\r\n var pe = this.end.clone().sub(this.pivot);\r\n\r\n var rotRad = Math.atan2(pe.y, pe.x) - Math.atan2(ps.y, ps.x);\r\n\r\n var curRot = rotRad - this.currentRotationRad;\r\n\r\n if (curRot) {\r\n this.selUi.forEach(sui => sui.rotateByPivot(this.pivot, curRot));\r\n\r\n this.currentRotationRad = rotRad;\r\n\r\n if (!segmentsHelper.visible)\r\n segmentsHelper.visible = true;\r\n\r\n segmentsHelper.setLinePoints([this.pivot, this.end]);\r\n }\r\n }\r\n }\r\n\r\n}","module LS.Client3DEditor {\r\n\r\n export enum ConduitToolStep {\r\n default = 0,\r\n drawing = 1\r\n }\r\n\r\n export enum ComponentSetOptionsEnum {\r\n None = 0,// None\r\n SnapToRails = 1,// SnapToRails\r\n SnapToModuleBorders = 2,// SnapToModuleBorders\r\n SnapToElevationBorders = 4// SnapToElevationBorders\r\n }\r\n\r\n export class ConduitTool extends BaseTool {\r\n\r\n private _v1 = new THREE.Vector3();\r\n private _v2 = new THREE.Vector3();\r\n //private _v3 = new THREE.Vector3();\r\n private _q1 = new THREE.Quaternion();\r\n\r\n private static _up = new THREE.Vector3(0, 0, 1);\r\n private static _right = new THREE.Vector3(1, 0, 0);\r\n private _box1 = new THREE.Box3();\r\n //private _box2 = new THREE.Box3();\r\n\r\n private _targetComponent: ConduitComponent = null;\r\n private _octree: spt.ThreeJs.utils.Octree = null;\r\n private _lineMat: THREE.LineBasicMaterial = new THREE.LineBasicMaterial();\r\n\r\n viewModel = new ConduitViewModel();\r\n\r\n //lastComp: IConduitComponentIntersection = null;\r\n _connectionHovered: ConduitConnection = null;\r\n\r\n componentPool: { [id: string]: ConduitComponent[] } = {};\r\n tempComponents: ConduitComponent[] = [];\r\n\r\n componentRoot = new THREE.Object3D();\r\n\r\n get connectionHovered() {\r\n return this._connectionHovered;\r\n }\r\n\r\n set connectionHovered(v: ConduitConnection) {\r\n this._connectionHovered = v;\r\n Controller.Current.conduitObjectHolder.setHoverComponent(v && v.parent);\r\n }\r\n\r\n step: ConduitToolStep = ConduitToolStep.default;\r\n\r\n loadComponents(fn?: () => void) {\r\n\r\n var conduitViewModel = this.viewModel;\r\n\r\n this.clearComponentPool();\r\n\r\n if (!conduitViewModel.componentSets.length) {\r\n\r\n SolarProTool.Ajax(\"Areas/Electric/WebServices/ElectricServices.asmx\").Call(\"GetConduitComponentSets\").Data().CallBack((res) => {\r\n conduitViewModel.componentSets.removeAll();\r\n conduitViewModel.selectedComponentSet = null;\r\n if (res && res.length) {\r\n res.forEach(compSetData => {\r\n conduitViewModel.componentSets.push(new ConduitComponentSet(compSetData));\r\n });\r\n }\r\n if (fn)\r\n fn();\r\n });\r\n\r\n //var compSet = new ConduitComponentSet(spt.Utils.GenerateGuid(), \"Kabelkanal\");\r\n\r\n //var compWidth = 300;\r\n //var compHeight = 50;\r\n //var BevelSize = 15;\r\n //var curvePadding = 250;\r\n\r\n //compSet.addLine(null, 500, compWidth, compHeight, false, BevelSize);\r\n //compSet.addLine(null, 750, compWidth, compHeight, false, BevelSize);\r\n //compSet.addLine(null, 1000, compWidth, compHeight, false, BevelSize);\r\n //compSet.addCurve(null, 90, curvePadding, compWidth, compHeight, true, BevelSize);\r\n //compSet.addCurve(null, 135, curvePadding, compWidth, compHeight, true, BevelSize);\r\n //compSet.addJunction(null, [0, 90, 180], curvePadding, compWidth, compHeight, BevelSize);\r\n //compSet.addJunction(null, [0, 270, 180], curvePadding, compWidth, compHeight, BevelSize);\r\n //compSet.addJunction(null, [0, 90, 270], curvePadding, compWidth, compHeight, BevelSize);\r\n //compSet.addJunction(null, [0, 90, 180, 270], curvePadding, compWidth, compHeight, BevelSize);\r\n\r\n //conduitViewModel.componentSets.push(compSet);\r\n\r\n //compSet = new ConduitComponentSet(spt.Utils.GenerateGuid(), \"Kabelrohr\");\r\n //compSet.optimizeCurves = false;\r\n\r\n //compWidth = 150;\r\n //compHeight = 90;\r\n //BevelSize = 45;\r\n //curvePadding = 10;\r\n\r\n //compSet.addLine(null, 100, compWidth, compHeight, true, BevelSize);\r\n //for (var i = 90; i < 180; i += 5) {\r\n // compSet.addCurve(null, i, curvePadding, compWidth, compHeight, true, BevelSize);\r\n //}\r\n\r\n //conduitViewModel.componentSets.push(compSet);\r\n\r\n }\r\n else if (fn)\r\n fn();\r\n\r\n\r\n }\r\n\r\n reset() {\r\n var controller = Controller.Current,\r\n pointingHelper = controller.pointingHelper,\r\n conduitObjectHolder = controller.conduitObjectHolder;\r\n\r\n this.step = ConduitToolStep.default;\r\n this.connectionHovered = null;\r\n conduitObjectHolder.setHoverObject(null);\r\n pointingHelper.visible = false;\r\n this.hideTempComponents();\r\n this.componentPoolForeach(c => { c.visible = false; });\r\n this._targetComponent = null;\r\n }\r\n\r\n getPooledComponent(setting: SolarProTool.IConduitComponentSetting | SolarProTool.IConduitComponent, index = 0) {\r\n var componentPool = this.componentPool;\r\n\r\n if (!componentPool[setting.ComponentId])\r\n componentPool[setting.ComponentId] = [];\r\n\r\n var pool = componentPool[setting.ComponentId];\r\n\r\n while (pool.length <= index) {\r\n var tempComponent = new ConduitComponent(spt.Utils.GenerateGuid(), setting);\r\n tempComponent.visible = false;\r\n tempComponent.alpha = 0.7;\r\n tempComponent.buildMesh();\r\n tempComponent.updateMaterial();\r\n pool.push(tempComponent);\r\n this.componentRoot.add(tempComponent);\r\n }\r\n\r\n this.tempComponents.push(pool[index]);\r\n\r\n return pool[index];\r\n }\r\n\r\n insertTempComponents() {\r\n var conduitObjectHolder = LS.Client3DEditor.Controller.Current.conduitObjectHolder,\r\n selectedComponentSet = this.viewModel.selectedComponentSet,\r\n targetComponent = this._targetComponent;\r\n\r\n if (selectedComponentSet) {\r\n\r\n if (targetComponent && targetComponent.conduitType === ConduitComponentType.Line) {\r\n this.tempComponents.forEach(tempComp => {\r\n if (!targetComponent._isDisposed && !targetComponent.IsDeleted && tempComp.visible && tempComp.conduitType === ConduitComponentType.Junction)\r\n this.insertJunction(tempComp, targetComponent);\r\n });\r\n }\r\n\r\n this.tempComponents.forEach(tempComp => {\r\n if (tempComp.visible) {\r\n var compSetting = selectedComponentSet.componentSettingsById[tempComp.ComponentId];\r\n if (compSetting) {\r\n var newComp = compSetting.createComponent(tempComp.position, tempComp.quaternion);\r\n if (tempComp.DynamicLength) {\r\n newComp.setLength(tempComp.getLength());\r\n newComp.isStatic = true;\r\n }\r\n conduitObjectHolder.insertComponent(newComp, selectedComponentSet.Id);\r\n }\r\n }\r\n });\r\n }\r\n\r\n conduitObjectHolder.checkGroups();\r\n }\r\n\r\n insertJunction(junctionComponent: ConduitComponent, lineComponent: ConduitComponent) {\r\n if (!junctionComponent || !lineComponent)\r\n return;\r\n\r\n var conduitViewModel = LS.Electric.InvertersModel && LS.Electric.InvertersModel.conduitViewModel;\r\n\r\n if (!conduitViewModel)\r\n return;\r\n\r\n var componentSet = conduitViewModel.ComponentSetById[lineComponent.ConduitObject.ComponentSetID];\r\n\r\n if (!componentSet)\r\n return;\r\n\r\n var lineComps: ConduitComponent[] = [lineComponent],\r\n r = lineComponent.Connections[1].rad,\r\n curLineComp = lineComponent;\r\n\r\n while (curLineComp) {\r\n var con = curLineComp.GetConnectionByAngle(r).connected;\r\n if (con && con.parent.conduitType === ConduitComponentType.Line) {\r\n curLineComp = con.parent;\r\n lineComps.push(curLineComp);\r\n } else\r\n break;\r\n }\r\n\r\n var conEnd = lineComps[lineComps.length - 1].GetConnectionByAngle(r),\r\n posEnd = conEnd.getGlobalPosition(new THREE.Vector3()),\r\n dirEnd = conEnd.getGlobalDirection(new THREE.Vector3()),\r\n conNext = conEnd.connected;\r\n\r\n r = lineComponent.Connections[0].rad;\r\n curLineComp = lineComponent;\r\n\r\n while (curLineComp) {\r\n var con = curLineComp.GetConnectionByAngle(r).connected;\r\n if (con && con.parent.conduitType === ConduitComponentType.Line) {\r\n curLineComp = con.parent;\r\n lineComps.unshift(curLineComp);\r\n } else\r\n break;\r\n }\r\n\r\n var conStart = lineComps[0].GetConnectionByAngle(r),\r\n posStart = conStart.getGlobalPosition(new THREE.Vector3()),\r\n dirStart = conStart.getGlobalDirection(new THREE.Vector3()).negate(),\r\n lineLength = posStart.distanceTo(posEnd),\r\n conPrev = conStart.connected;\r\n\r\n var connectionToStart = junctionComponent.getClosestConnectionTo(posStart),\r\n connectionToEnd = junctionComponent.getClosestConnectionTo(posEnd),\r\n junctionLength = connectionToStart.position.distanceTo(connectionToEnd.position);\r\n\r\n if (connectionToStart === connectionToEnd || junctionLength <= 0 || lineLength < junctionLength)\r\n return;\r\n\r\n lineComps.forEach(lc => lc.removeInstance());\r\n\r\n ko.tasks.runEarly();\r\n\r\n var compIndices = this.getTempCompIndices();\r\n\r\n var automaticComponents = componentSet.calculateComponents(posStart, connectionToStart.getGlobalPosition(), dirStart, true);\r\n var genComps = this.generateAutomaticComponents(automaticComponents, dirStart, posStart, compIndices);\r\n\r\n if (genComps.length)\r\n genComps[genComps.length - 1].Connections[1].alignConnection(connectionToStart);\r\n else if (conPrev)\r\n conPrev.alignConnection(connectionToStart);\r\n\r\n automaticComponents = componentSet.calculateComponents(connectionToEnd.getGlobalPosition(), posEnd, dirEnd, true);\r\n genComps = this.generateAutomaticComponents(automaticComponents, dirEnd, connectionToEnd.getGlobalPosition(), compIndices);\r\n\r\n if (conNext && conNext.parent) {\r\n var finalCon = genComps.length ? genComps[genComps.length - 1].Connections[1] : connectionToEnd,\r\n translate = finalCon.getGlobalPosition(new THREE.Vector3()).sub(conNext.getGlobalPosition(new THREE.Vector3()));\r\n\r\n if (translate.lengthSq() >= 0.01) {\r\n var nextComps = conNext.parent.GetAllConnected();\r\n nextComps.forEach(nc => {\r\n nc.moveBy(translate);\r\n });\r\n }\r\n }\r\n\r\n }\r\n\r\n hideTempComponents() {\r\n this.tempComponents.splice(0, this.tempComponents.length).forEach(c => {\r\n c.visible = false;\r\n });\r\n }\r\n\r\n componentPoolForeach(fn: (c: ConduitComponent) => void) {\r\n var componentPool = this.componentPool;\r\n Object.keys(componentPool).forEach(k => {\r\n componentPool[k].forEach(fn);\r\n });\r\n }\r\n\r\n clearComponentPool() {\r\n this.componentPoolForeach(tempComponent => {\r\n if (tempComponent.parent)\r\n tempComponent.parent.remove(tempComponent);\r\n tempComponent.dispose();\r\n });\r\n\r\n this.componentPool = {};\r\n }\r\n\r\n onSelect(viewModel: ViewModel) {\r\n if (!LS.Electric.InvertersModel) {\r\n viewModel.deselectTool();\r\n return;\r\n }\r\n\r\n if (!LS.Electric.InvertersModel.conduitViewModel)\r\n LS.Electric.InvertersModel.conduitViewModel = this.viewModel;\r\n\r\n LS.Electric.InvertersModel.showConduitViewModel = true;\r\n\r\n viewModel.currentInstance.add(this.componentRoot, true);\r\n viewModel.ShowInverterFlyout = true;\r\n\r\n if (!viewModel.FlyoutVisible)\r\n ToolBox.showInverterFlyout();\r\n\r\n this.reset();\r\n this.loadComponents();\r\n this.onViewLayerChanged(viewModel, viewModel.CurrentViewLayerName);\r\n this.viewModel.selectedComponentSet = null;\r\n\r\n var controller = Controller.Current;\r\n controller.segmentHighlightHelper.setVisible(false);\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n this.viewModel.showCables = false;\r\n //this.viewModel.showPolylines = false;\r\n ko.tasks.runEarly();\r\n\r\n this.reset();\r\n this.clearComponentPool();\r\n\r\n if (LS.Electric && LS.Electric.InvertersModel)\r\n LS.Electric.InvertersModel.showConduitViewModel = false;\r\n\r\n var controller = Controller.Current;\r\n\r\n controller.viewModel.currentInstance.remove(this.componentRoot, true);\r\n controller.segmentHighlightHelper.setVisible(false);\r\n controller.pointingHelper.visible = false;\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n if (LoaderManager.isLoading()) {\r\n return false;\r\n }\r\n\r\n var controller = Controller.Current,\r\n conduitObjectHolder = controller.conduitObjectHolder,\r\n precision = controller.linePrecision,\r\n pointingHelper = controller.pointingHelper,\r\n selectedComponentSet = this.viewModel.selectedComponentSet,\r\n roofPosition = viewModel.roofPosition,\r\n lastRoofPosition = viewModel.startRoofPosition,\r\n mdistSq = viewModel.diffViewPosition.lengthSq(),\r\n tempComponents = this.tempComponents,\r\n cursor = this.cursor,\r\n segmentHighlightHelper = controller.segmentHighlightHelper;\r\n\r\n segmentHighlightHelper.visible = false;\r\n\r\n if(pointingHelper.visible)\r\n pointingHelper.visible = false;\r\n\r\n this._targetComponent = null;\r\n\r\n if (this.viewModel.mode === ConduitViewMode.cut) {\r\n this.hideTempComponents();\r\n\r\n var cmpInter = conduitObjectHolder.closestCenterByRaycaster(controller.localRaycaster, precision),\r\n cmp = cmpInter && cmpInter.o;\r\n\r\n if (cmp && cmp.conduitType === ConduitComponentType.Line && cmp.DynamicLength && cmpInter.p) {\r\n var cmpW = cmp.ComponentWidth * 0.5 + 0.4 * precision;\r\n\r\n segmentHighlightHelper.setStartEnd(this._v1.set(0, -cmpW, 0).applyQuaternion(cmp.quaternion).add(cmpInter.p), this._v2.set(0, cmpW, 0).applyQuaternion(cmp.quaternion).add(cmpInter.p), true, 0.2 * precision, 0.4 * precision);\r\n \r\n cursor = 'pointer';\r\n this._targetComponent = cmp;\r\n }\r\n\r\n controller.viewModel.Cursor = cursor;\r\n return false;\r\n }\r\n\r\n if (this.viewModel.mode === ConduitViewMode.replace) {\r\n this.hideTempComponents();\r\n\r\n conduitObjectHolder.getAllConduitObjects().forEach(co => { co.isHovered = false; });\r\n var cmpInter = conduitObjectHolder.getByRaycaster(controller.localRaycaster, precision),\r\n cmp = cmpInter && cmpInter.o,\r\n cmpObj = cmp && cmp.ConduitObject;\r\n if (cmpObj && selectedComponentSet && selectedComponentSet.ComponentGroup && cmp.ComponentGroup && selectedComponentSet.Id !== cmpObj.ComponentSetID && selectedComponentSet.ComponentGroup === cmp.ComponentGroup) {\r\n cmp.isHovered = true;\r\n cursor = 'pointer';\r\n this._targetComponent = cmp;\r\n }\r\n controller.viewModel.Cursor = cursor;\r\n return false;\r\n }\r\n\r\n controller.viewModel.Cursor = cursor;\r\n\r\n if (this.step === ConduitToolStep.default && viewModel.mouseDown && mdistSq > 100) {\r\n this.step = ConduitToolStep.drawing;\r\n\r\n //var edge = controller.searchEdge(lastRoofPosition);\r\n //if (edge)\r\n // lastRoofPosition.copy(spt.ThreeJs.utils.GetClosestPointToLine(edge.closestStart, edge.closestEnd, lastRoofPosition).p);\r\n }\r\n\r\n var rp = roofPosition as THREE.Vector3;\r\n\r\n if (selectedComponentSet) {\r\n var opt = ((selectedComponentSet.Options) as any) as ComponentSetOptionsEnum;\r\n var compSnap = this.getComponentSnap(opt);\r\n if (compSnap)\r\n rp = new THREE.Vector3(compSnap.x, compSnap.y, roofPosition.z);\r\n else {\r\n var snapPoint = controller.linesHelper.GetSnapWithPoint(rp, precision);\r\n if (snapPoint)\r\n rp = new THREE.Vector3().copy(roofPosition).add(snapPoint);\r\n }\r\n }\r\n\r\n if (this.step === ConduitToolStep.drawing) {\r\n if (selectedComponentSet) {\r\n var connectionHovered = this.connectionHovered;\r\n\r\n var curPos = this._v1.copy(lastRoofPosition),\r\n curDir = this._v2.subVectors(rp, lastRoofPosition).normalize();\r\n\r\n if (connectionHovered) {\r\n connectionHovered.getGlobalPosition(curPos);\r\n connectionHovered.getGlobalDirection(curDir);\r\n } else if (viewModel.shiftDown)\r\n spt.ThreeJs.utils.ToClosestAxis(curDir);\r\n\r\n if (selectedComponentSet.selectedComponentSetting && !selectedComponentSet.selectedComponentSetting.DynamicLength) {\r\n //component selected\r\n var tempComponent = tempComponents.length && tempComponents[0];\r\n //var tempComponent = this.getPooledComponent(selectedComponentSet.selectedComponentSetting);\r\n if (tempComponent && tempComponent.visible && !connectionHovered) {\r\n\r\n var curAngle = spt.ThreeJs.utils.GetCCAngleRad(ConduitTool._right, curDir),\r\n curQuat = this._q1.setFromAxisAngle(ConduitTool._up, curAngle);\r\n\r\n //tempComponent.Connections[0].alignParent();\r\n tempComponent.quaternion.copy(curQuat);\r\n //tempComponent.position.copy(roofPosition);\r\n }\r\n } else {\r\n //automatic mode\r\n this.hideTempComponents();\r\n\r\n var raycaster = controller.localRaycaster,\r\n connectionIntersection = conduitObjectHolder.getEndPositionByRaycaster(raycaster, precision);\r\n\r\n if (connectionIntersection && (connectionIntersection.idx < 0 || !!connectionIntersection.o.Connections[connectionIntersection.idx].connected))\r\n connectionIntersection = null;\r\n\r\n if (connectionIntersection) {\r\n var targetConnection = connectionIntersection.o.Connections[connectionIntersection.idx],\r\n conPos = targetConnection.getGlobalPosition(new THREE.Vector3()),\r\n targetPos = curDir.clone().multiplyScalar(curDir.dot(conPos.clone().sub(curPos))).add(curPos);\r\n if (targetConnection.getGlobalDirection().dot(curDir) < -0.99 && conPos.distanceTo(targetPos) <= precision) {\r\n\r\n rp = conPos;\r\n\r\n pointingHelper.position.copy(connectionIntersection.o.Connections[connectionIntersection.idx].position).applyMatrix4(connectionIntersection.o.matrix);\r\n pointingHelper.visible = true;\r\n }\r\n }\r\n\r\n var automaticComponents = selectedComponentSet.calculateComponents(curPos, rp, curDir, !!selectedComponentSet.selectedComponentSetting);\r\n this.generateAutomaticComponents(automaticComponents, curDir, curPos);\r\n\r\n }\r\n }\r\n }\r\n else if (this.step === ConduitToolStep.default && !viewModel.mouseDown) {\r\n\r\n this.hideTempComponents();\r\n //this.componentPoolForeach(c => { c.visible = false; });\r\n\r\n var raycaster = controller.localRaycaster,\r\n connectionIntersection = conduitObjectHolder.getEndPositionByRaycaster(raycaster, precision),\r\n compIntersection = connectionIntersection;\r\n\r\n if (connectionIntersection && (connectionIntersection.idx < 0 || !!connectionIntersection.o.Connections[connectionIntersection.idx].connected))\r\n connectionIntersection = null;\r\n\r\n if (connectionIntersection) {\r\n pointingHelper.position.copy(connectionIntersection.o.Connections[connectionIntersection.idx].position).applyMatrix4(connectionIntersection.o.matrix);\r\n pointingHelper.visible = true;\r\n }\r\n\r\n var connectionHovered = this.connectionHovered = connectionIntersection && connectionIntersection.o.Connections[connectionIntersection.idx];\r\n\r\n //if (!connectionIntersection && compIntersection && compIntersection.p && compIntersection.o.conduitType === ConduitComponentType.Line && selectedComponentSet && selectedComponentSet.selectedComponentSetting && selectedComponentSet.selectedComponentSetting.DynamicLength) {\r\n // if (compIntersection.idx) {\r\n\r\n // }\r\n // pointingHelper.position.copy(compIntersection.p);\r\n // pointingHelper.visible = true;\r\n //} else \r\n if (selectedComponentSet && selectedComponentSet.selectedComponentSetting && !selectedComponentSet.selectedComponentSetting.DynamicLength) {\r\n var tempComponent = this.getPooledComponent(selectedComponentSet.selectedComponentSetting);\r\n\r\n if (connectionHovered) {\r\n connectionHovered.alignComponent(tempComponent);\r\n tempComponent.visible = true;\r\n } else if (compIntersection && compIntersection.p && compIntersection.o.conduitType === ConduitComponentType.Line) {\r\n if (tempComponent.hasConnections(0, 180)) {\r\n var lineCon = compIntersection.o.GetConnectionByAngle(Math.PI);\r\n lineCon.alignComponent(tempComponent);\r\n //tempComponent.quaternion.set(0, 0, 0, 1);\r\n tempComponent.position.copy(compIntersection.p).setZ(0);\r\n this._targetComponent = compIntersection.o;\r\n tempComponent.visible = true;\r\n }\r\n } else {\r\n //tempComponent.Connections[0].alignParent();\r\n tempComponent.quaternion.set(0, 0, 0, 1);\r\n tempComponent.position.copy(rp);\r\n tempComponent.visible = true;\r\n }\r\n } else if (!connectionIntersection) {\r\n pointingHelper.position.copy(rp);\r\n pointingHelper.visible = true;\r\n\r\n //if (!snapPoint) {\r\n // var edge = controller.searchEdge(rp, selectedComponentSet.ComponentSettings[0].ComponentWidth * 0.5);\r\n // if (edge)\r\n // pointingHelper.position.copy(spt.ThreeJs.utils.GetClosestPointToLine(edge.closestStart, edge.closestEnd, rp).p);\r\n //}\r\n }\r\n\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private generateAutomaticComponents(automaticComponents: { count: number, comp: ConduitComponentSettings, len: number }[], dirFrom: THREE.Vector3, vFrom: THREE.Vector3, comIndices?: { [id: string]: number }) {\r\n var result: ConduitComponent[] = [];\r\n\r\n if (!automaticComponents)\r\n return result;\r\n\r\n var curAngle = spt.ThreeJs.utils.GetCCAngleRad(ConduitTool._right, dirFrom),\r\n curQuat = this._q1.setFromAxisAngle(ConduitTool._up, curAngle);\r\n\r\n var lastCon: ConduitConnection;\r\n\r\n //if (curveComp) {\r\n // var tComp = this.getPooledComponent(curveComp);\r\n // tComp.Connections[0].alignParent();\r\n // tComp.applyQuaternion(curQuat);\r\n // tComp.position.applyQuaternion(curQuat).add(curPos);\r\n // tComp.updateMatrix();\r\n // tComp.visible = true;\r\n\r\n // lastCon = tComp.Connections[1];\r\n //}\r\n\r\n if (!comIndices)\r\n comIndices = {};\r\n\r\n for (var i = 0, l = automaticComponents.length; i < l; i++) {\r\n var ac = automaticComponents[i],\r\n comp = ac.comp,\r\n count = ac.count,\r\n componentId = comp.ComponentId;\r\n if (!comIndices[componentId])\r\n comIndices[componentId] = 0;\r\n for (var j = 0; j < count; j++) {\r\n var tComp = this.getPooledComponent(comp, comIndices[componentId]++);\r\n if (tComp.DynamicLength)\r\n tComp.setLength(ac.len);\r\n if (lastCon) {\r\n lastCon.alignConnection(tComp.Connections[0]);\r\n } else {\r\n tComp.Connections[0].alignParent();\r\n tComp.applyQuaternion(curQuat);\r\n tComp.position.applyQuaternion(curQuat).add(vFrom);\r\n tComp.updateMatrix();\r\n }\r\n lastCon = tComp.Connections[1];\r\n\r\n tComp.visible = true;\r\n\r\n result.push(tComp);\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n private getTempCompIndices(): { [id: string]: number } {\r\n //used for temp component pooling\r\n var comIndices: { [id: string]: number } = {};\r\n\r\n this.tempComponents.forEach(tempComp => {\r\n if (tempComp.visible) {\r\n var componentId = tempComp.ComponentId;\r\n if (!comIndices[componentId])\r\n comIndices[componentId] = 1;\r\n else\r\n comIndices[componentId]++;\r\n }\r\n });\r\n\r\n return comIndices;\r\n }\r\n\r\n onMouseDown(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n pointingHelper = controller.pointingHelper;\r\n\r\n if (pointingHelper.visible) {\r\n var startRoofPosition = viewModel.startRoofPosition;\r\n startRoofPosition.set(pointingHelper.position.x, pointingHelper.position.y, startRoofPosition.z);\r\n viewModel.roofPosition.copy(startRoofPosition);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n onMouseUp(viewModel: ViewModel) {\r\n if (this.viewModel.mode === ConduitViewMode.cut) {\r\n var targetComponent = this._targetComponent,\r\n segmentHighlightHelper = Controller.Current.segmentHighlightHelper;\r\n if (targetComponent && targetComponent.Connections && targetComponent.Connections.length === 2 && segmentHighlightHelper.visible && targetComponent.conduitType === ConduitComponentType.Line && targetComponent.DynamicLength) {\r\n var cutPos = segmentHighlightHelper.start.clone().add(segmentHighlightHelper.end).multiplyScalar(0.5).setZ(0),\r\n compPositions = targetComponent.Connections.map(c => c.getGlobalPosition(new THREE.Vector3())),\r\n srcCmpLength = targetComponent.getLength();\r\n if (srcCmpLength > 0 && compPositions.every(gp => gp.setZ(0).distanceToSquared(cutPos) > 1) && targetComponent.ConduitObject) {\r\n\r\n var tp1 = compPositions[0],\r\n tp2 = cutPos,\r\n tp3 = compPositions[1],\r\n conduitObjectHolder = Controller.Current.conduitObjectHolder,\r\n targetComponentData = targetComponent.exportData(),\r\n compsetId = targetComponent.ConduitObject.ComponentSetID;;\r\n\r\n targetComponent.removeInstance();\r\n ko.tasks.runEarly();\r\n \r\n var newComp1 = new ConduitComponent(spt.Utils.GenerateGuid(), targetComponentData);\r\n newComp1.quaternion.copy(targetComponent.quaternion);\r\n newComp1.position.copy(tp1).add(tp2).multiplyScalar(0.5);\r\n newComp1.setLength(tp1.distanceTo(tp2));\r\n\r\n var newComp2 = new ConduitComponent(spt.Utils.GenerateGuid(), targetComponentData);\r\n newComp2.quaternion.copy(targetComponent.quaternion);\r\n newComp2.position.copy(tp2).add(tp3).multiplyScalar(0.5);\r\n newComp2.setLength(tp2.distanceTo(tp3));\r\n\r\n conduitObjectHolder.insertComponent(newComp1, compsetId);\r\n conduitObjectHolder.insertComponent(newComp2, compsetId);\r\n\r\n viewModel.Cursor = this.cursor;\r\n }\r\n }\r\n\r\n this._targetComponent = null;\r\n }\r\n\r\n if (this.viewModel.mode === ConduitViewMode.replace) {\r\n\r\n var targetComponent = this._targetComponent,\r\n selectedComponentSet = this.viewModel.selectedComponentSet;\r\n\r\n if (targetComponent) {\r\n var compSetting = selectedComponentSet.getEqualComponentSetting(targetComponent);\r\n if (compSetting) {\r\n\r\n var newComp = new ConduitComponent(spt.Utils.GenerateGuid(), compSetting);\r\n newComp.quaternion.copy(targetComponent.quaternion);\r\n newComp.position.copy(targetComponent.position);\r\n\r\n if (newComp.DynamicLength)\r\n newComp.setLength(targetComponent.getLength());\r\n\r\n targetComponent.removeInstance();\r\n ko.tasks.runEarly();\r\n\r\n Controller.Current.conduitObjectHolder.insertComponent(newComp, selectedComponentSet.Id);\r\n }\r\n }\r\n\r\n this._targetComponent = null;\r\n }\r\n\r\n Controller.Current.segmentHighlightHelper.setVisible(false);\r\n\r\n this.insertTempComponents();\r\n this.hideTempComponents();\r\n\r\n this.connectionHovered = null;\r\n\r\n //if (this.step === ConduitToolStep.drawing) {\r\n\r\n\r\n //} else if (this.step === ConduitToolStep.default) {\r\n\r\n // if (selectedComponentSet && selectedComponentSet.selectedComponentSetting) {\r\n // if (this.compHovered) {\r\n // selectedComponentSet.selectedComponentSetting.createComponent(this.compHovered);\r\n // this.compHovered = null;\r\n // } else {\r\n // selectedComponentSet.selectedComponentSetting.createComponent(viewModel.startRoofPosition, new THREE.Quaternion());\r\n // }\r\n // }\r\n //}\r\n\r\n this.step = ConduitToolStep.default;\r\n\r\n return false;\r\n }\r\n\r\n onKeyDown(viewModel: ViewModel) {\r\n if (LoaderManager.isLoading())\r\n return false;\r\n\r\n if (viewModel.keyPressed(27)) // esc\r\n this.reset();\r\n\r\n return false;\r\n }\r\n\r\n onViewLayerChanged(viewModel: ViewModel, viewLayerName: string) {\r\n this.viewModel.CurrentViewLayerName = viewLayerName || null;\r\n this.viewModel.showCables = false;\r\n this.viewModel.showPolylines = false;\r\n this.viewModel.selectedComponentSet = null;\r\n }\r\n\r\n getComponentSnap(opt: ComponentSetOptionsEnum): THREE.Vector3 {\r\n if (opt === ComponentSetOptionsEnum.None)\r\n return null;\r\n\r\n var octree = this._octree;\r\n\r\n if (octree == null) {\r\n //initialize octree\r\n octree = this._octree = new spt.ThreeJs.utils.Octree({\r\n //scene: scene,\r\n undeferred: false,\r\n depthMax: Infinity,\r\n objectsThreshold: 8,\r\n overlapPct: 0.15\r\n });\r\n\r\n var clientObjects = Controller.Current.Objects;\r\n for (var id in clientObjects) {\r\n var clientObject = clientObjects[id];\r\n if (clientObject.dataType.indexOf(\"RailObject\") !== -1) {\r\n clientObject.ClientObjectInstances.forEach(ci => {\r\n this.addMeshToOctree(ci, ComponentSetOptionsEnum.SnapToRails);\r\n });\r\n } else if (clientObject.dataType.indexOf(\"ModuleObject\") !== -1) {\r\n clientObject.ClientObjectInstances.forEach(ci => {\r\n this.addMeshToOctree(ci, ComponentSetOptionsEnum.SnapToModuleBorders);\r\n });\r\n } else if (clientObject.userData.NumModules) {\r\n //Aerodynelevation\r\n clientObject.ClientObjectInstances.forEach(ci => {\r\n this.addMeshToOctree(ci, ComponentSetOptionsEnum.SnapToElevationBorders);\r\n });\r\n }\r\n }\r\n\r\n octree.update();\r\n }\r\n\r\n var controller = Controller.Current,\r\n //pointingHelper = controller.pointingHelper,\r\n tolerance = controller.linePrecision,\r\n //toleranceSq = tolerance * tolerance,\r\n raycaster = controller.localRaycaster;\r\n\r\n var ray = raycaster.ray;\r\n var objs = octree.search(ray.origin, raycaster.far, true, ray.direction).map(m => m.object).filter(o => o.userData[\"option\"] === opt);\r\n if (!objs.length)\r\n return null;\r\n\r\n var intersections = raycaster.intersectObjects(objs, false);\r\n if (intersections && intersections.length) {\r\n var minDist = Number.MAX_VALUE;\r\n var minP: THREE.Vector3 = null;\r\n\r\n //var intersecLines = intersections.map((it) => { return it.object as THREE.Line; });\r\n\r\n var p43 = this._v1;\r\n\r\n for (var i = intersections.length; i--;) {\r\n var cur = intersections[i],\r\n curP = cur.point,\r\n d = ray.distanceSqToPoint(curP);\r\n\r\n if (d < minDist) {\r\n minDist = d;\r\n minP = p43.copy(curP);\r\n }\r\n }\r\n\r\n return minP ? minP.clone() : null;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n addMeshToOctree(mesh: THREE.Mesh, opt: ComponentSetOptionsEnum) {\r\n var box = this._box1.copy(mesh.geometry.boundingBox).translate(mesh.position);\r\n if (mesh.parent)\r\n box.applyMatrix4(mesh.parent.matrixWorld);\r\n var center = box.getCenter(this._v1);\r\n\r\n switch (opt) {\r\n case ComponentSetOptionsEnum.SnapToRails:\r\n var horizontal = Math.abs(box.min.x - box.max.x) > Math.abs(box.min.y - box.max.y);\r\n if (horizontal)\r\n this.addLineToOctree(new THREE.Vector3(box.min.x, center.y, center.z), new THREE.Vector3(box.max.x, center.y, center.z), opt);\r\n else\r\n this.addLineToOctree(new THREE.Vector3(center.x, box.min.y, center.z), new THREE.Vector3(center.x, box.max.y, center.z), opt);\r\n break;\r\n default:\r\n this.addLineToOctree(new THREE.Vector3(box.min.x, box.min.y, center.z), new THREE.Vector3(box.max.x, box.min.y, center.z), opt);\r\n this.addLineToOctree(new THREE.Vector3(box.max.x, box.min.y, center.z), new THREE.Vector3(box.max.x, box.max.y, center.z), opt);\r\n this.addLineToOctree(new THREE.Vector3(box.max.x, box.max.y, center.z), new THREE.Vector3(box.min.x, box.max.y, center.z), opt);\r\n this.addLineToOctree(new THREE.Vector3(box.min.x, box.max.y, center.z), new THREE.Vector3(box.min.x, box.min.y, center.z), opt);\r\n break;\r\n }\r\n }\r\n\r\n addLineToOctree(p1: THREE.Vector3, p2: THREE.Vector3, opt: ComponentSetOptionsEnum) {\r\n if (!this._octree)\r\n return;\r\n var geo = new THREE.Geometry();\r\n geo.vertices.push(p1, p2);\r\n geo.computeBoundingSphere();\r\n\r\n geo.boundingSphere.radius += 200;\r\n\r\n var line = new THREE.Line(geo, this._lineMat);\r\n line.userData[\"option\"] = opt;\r\n this._octree.add(line);\r\n }\r\n }\r\n\r\n export enum ConduitViewMode {\r\n draw,\r\n replace,\r\n cut\r\n }\r\n\r\n export class ConduitViewModel {\r\n\r\n componentSets: ConduitComponentSet[] = [];\r\n readonly selectableComponentSets: ConduitComponentSet[];\r\n selectedComponentSet: ConduitComponentSet = null;\r\n showPolylines: boolean = false;\r\n showCables: boolean = false;\r\n mode: ConduitViewMode = ConduitViewMode.draw;\r\n CurrentViewLayerName: string = \"Stringing\";\r\n replaceMode: boolean;\r\n drawMode: boolean;\r\n cutMode: boolean;\r\n\r\n readonly ComponentSetById: { [id: string]: ConduitComponentSet };\r\n\r\n constructor() {\r\n ko.track(this);\r\n\r\n ko.defineProperty(this, \"drawMode\",\r\n {\r\n get: () => this.mode === ConduitViewMode.draw,\r\n set: (v) => { this.mode = ConduitViewMode.draw; }\r\n });\r\n\r\n ko.defineProperty(this, \"replaceMode\",\r\n {\r\n get: () => this.mode === ConduitViewMode.replace,\r\n set: (v) => { this.mode = ConduitViewMode.replace; }\r\n });\r\n\r\n ko.defineProperty(this, \"cutMode\",\r\n {\r\n get: () => this.mode === ConduitViewMode.cut,\r\n set: (v) => { this.mode = ConduitViewMode.cut; }\r\n });\r\n\r\n ko.defineProperty(this, \"selectableComponentSets\", () => {\r\n return this.componentSets.filter(cs => !this.CurrentViewLayerName || !cs.ViewLayer || cs.ViewLayer === this.CurrentViewLayerName);\r\n });\r\n\r\n ko.defineProperty(this, \"ComponentSetById\", () => {\r\n var s: { [id: string]: ConduitComponentSet } = {};\r\n this.componentSets.forEach(c => {\r\n s[c.Id] = c;\r\n });\r\n return s;\r\n });\r\n\r\n ko.getObservable(this, \"showPolylines\").subscribe((v) => {\r\n LS.Client3DEditor.Controller.Current.conduitObjectHolder.showPolylines = !!v;\r\n });\r\n\r\n ko.getObservable(this, \"showCables\").subscribe((v) => {\r\n LS.Client3DEditor.Controller.Current.conduitObjectHolder.showCables = !!v;\r\n });\r\n\r\n ko.getObservable(this, \"mode\").subscribe((v) => {\r\n LS.Client3DEditor.Controller.Current.conduitObjectHolder.getAllConduitObjects().forEach(co => { co.isHovered = false; });\r\n if (LS.Client3DEditor.Controller.Current.viewModel.selectedTool === \"conduitTool\")\r\n LS.Client3DEditor.Controller.Current.viewModel.tools.conduitTool.hideTempComponents();\r\n });\r\n }\r\n\r\n selectSettingClick(componentSet: ConduitComponentSet, setting?: ConduitComponentSettings) {\r\n this.mode = ConduitViewMode.draw;\r\n componentSet.selectedComponentSetting = setting || null;\r\n }\r\n }\r\n\r\n export class ConduitComponentSet {\r\n\r\n Id: string = null;\r\n Name: string = \"\";\r\n Options: SolarProTool.ConduitComponentSetOptionsEnum = 0;\r\n ComponentSettings: ConduitComponentSettings[] = [];\r\n selectedComponentSetting: ConduitComponentSettings = null;\r\n steppingCalculator: LineSteppingCalculator;\r\n OptimizeCurves: boolean = true;\r\n LengthStep: number = 0;\r\n readonly Color: string;\r\n readonly componentSettingsById: { [id: string]: ConduitComponentSettings };\r\n\r\n private _v1 = new THREE.Vector3();\r\n private _v2 = new THREE.Vector3();\r\n //private _v3 = new THREE.Vector3();\r\n //private static _up = new THREE.Vector3(0, 0, 1);\r\n readonly ComponentGroup: string;\r\n readonly ViewLayer: string;\r\n\r\n readonly DynamicLengthComponent: ConduitComponentSettings;\r\n readonly lineComponentSettings: ConduitComponentSettings[];\r\n readonly curveComponentSettings: ConduitComponentSettings[];\r\n readonly DynamicLength: boolean;\r\n\r\n getSteppingCalculator() {\r\n if (this.steppingCalculator)\r\n return this.steppingCalculator;\r\n\r\n var lineComps = this.lineComponentSettings,\r\n curveComps = this.curveComponentSettings;\r\n\r\n if (lineComps.length) {\r\n var steppingCalculator = this.steppingCalculator = new LineSteppingCalculator(10, 1024);\r\n steppingCalculator.lineSteppings = lineComps;\r\n if (curveComps.length)\r\n steppingCalculator.curveSteppings = curveComps;\r\n return steppingCalculator;\r\n }\r\n return null;\r\n }\r\n\r\n calculateComponents(vFrom: THREE.Vector3, vTo: THREE.Vector3, dirFrom: THREE.Vector3, noCurves?: boolean) {\r\n var result: { count: number, comp: ConduitComponentSettings, len: number }[] = [];\r\n var steppingCalculator = this.getSteppingCalculator();\r\n if (!steppingCalculator)\r\n return result;\r\n\r\n var lineSteppings = steppingCalculator.lineSteppings,\r\n minLen = lineSteppings[0].lineLength,\r\n lengthStep = this.LengthStep;\r\n\r\n if (dirFrom && !noCurves) {\r\n if (this.OptimizeCurves) {\r\n //get combinations\r\n var cc = steppingCalculator.getCurveStepping(vFrom, vTo, dirFrom);\r\n\r\n if (cc) {\r\n //add lines\r\n if (cc.lenFrom > minLen) {\r\n if (this.DynamicLength) {\r\n var ccLen = cc.lenFrom;\r\n if (lengthStep > 0)\r\n ccLen = Math.round(ccLen / lengthStep) * lengthStep;\r\n result.push({ count: 1, comp: this.DynamicLengthComponent, len: ccLen });\r\n } else {\r\n var steppings = steppingCalculator.calculateLength(cc.lenFrom);\r\n if (steppings.length) {\r\n for (var i = 0, l = steppings.length; i < l; i++) {\r\n var count = steppings[i];\r\n if (count > 0)\r\n result.push({ count: count, comp: lineSteppings[i] as ConduitComponentSettings, len: cc.lenFrom });\r\n }\r\n }\r\n }\r\n }\r\n\r\n //add curve\r\n result.push({ count: 1, comp: cc.curveStepping as ConduitComponentSettings, len: 0 });\r\n\r\n //add lines\r\n if (cc.lenTo > minLen) {\r\n if (this.DynamicLength) {\r\n var ccLen = cc.lenTo;\r\n if (lengthStep > 0)\r\n ccLen = Math.round(ccLen / lengthStep) * lengthStep;\r\n result.push({ count: 1, comp: this.DynamicLengthComponent, len: ccLen });\r\n } else {\r\n var steppings = steppingCalculator.calculateLength(cc.lenTo);\r\n if (steppings.length) {\r\n for (var i = 0, l = steppings.length; i < l; i++) {\r\n var count = steppings[i];\r\n if (count > 0)\r\n result.push({ count: count, comp: lineSteppings[i] as ConduitComponentSettings, len: cc.lenTo });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n var curve = steppingCalculator.getCurveTo(vFrom, vTo, dirFrom) as ConduitComponentSettings;\r\n\r\n if (curve) {\r\n //add curve at the start\r\n result.push({ count: 1, comp: curve, len: 0 });\r\n\r\n var tDirFrom = spt.ThreeJs.utils.RotateCC(this._v1.copy(dirFrom).negate(), curve.curveDegree * Math.PI / 180);\r\n\r\n var tvFrom = this._v2.copy(dirFrom).multiplyScalar(curve.curvePaddingStart).add(vFrom);\r\n\r\n //add lines\r\n var dLen = Math.max(0, tDirFrom.dot(this._v2.subVectors(vTo, tvFrom)) - curve.curvePaddingEnd);\r\n\r\n if (dLen >= minLen * 0.5) {\r\n if (this.DynamicLength) {\r\n if (lengthStep > 0)\r\n dLen = Math.round(dLen / lengthStep) * lengthStep;\r\n result.push({ count: 1, comp: this.DynamicLengthComponent, len: dLen });\r\n } else {\r\n var steppings = steppingCalculator.calculateLength(dLen);\r\n if (steppings.length) {\r\n for (var i = 0, l = steppings.length; i < l; i++) {\r\n var count = steppings[i];\r\n if (count > 0)\r\n result.push({ count: count, comp: lineSteppings[i] as ConduitComponentSettings, len: dLen });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!result.length && (!dirFrom || this._v1.subVectors(vTo, vFrom).dot(dirFrom) > 0)) {\r\n var dLen = vFrom.distanceTo(vTo);\r\n\r\n if (dLen >= minLen * 0.5) {\r\n if (lengthStep > 0)\r\n dLen = Math.round(dLen / lengthStep) * lengthStep;\r\n if (this.DynamicLength) {\r\n result.push({ count: 1, comp: this.DynamicLengthComponent, len: dLen });\r\n } else {\r\n var steppings = steppingCalculator.calculateLength(dLen);\r\n if (steppings.length) {\r\n for (var i = 0, l = steppings.length; i < l; i++) {\r\n var count = steppings[i];\r\n if (count > 0)\r\n result.push({ count: count, comp: lineSteppings[i] as ConduitComponentSettings, len: dLen });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n constructor(opts?: SolarProTool.IConduitComponentSet) {\r\n if (opts) {\r\n Object.keys(opts).forEach(k => {\r\n if (k !== \"componentSettingsById\" && k !== \"ComponentSettings\" && k !== \"selectedComponentSetting\" && k !== \"steppingCalculator\" && !k.startsWith(\"_\"))\r\n this[k] = opts[k];\r\n });\r\n\r\n if (opts.ComponentSettings && opts.ComponentSettings.length) {\r\n\r\n var minImgBounds = 0;\r\n\r\n opts.ComponentSettings.forEach(compSetting => {\r\n minImgBounds = Math.max(minImgBounds, ArrayHelper.Max(compSetting.Connections, c => Math.max(Math.abs(c.X), Math.abs(c.Y), Math.abs(c.Z))));\r\n });\r\n\r\n opts.ComponentSettings.forEach(compSetting => {\r\n this.ComponentSettings.push(new ConduitComponentSettings(compSetting, minImgBounds));\r\n });\r\n }\r\n }\r\n\r\n ko.track(this, [\"ComponentSettings\", \"selectedComponentSetting\"]);\r\n\r\n ko.defineProperty(this, \"componentSettingsById\", () => {\r\n var s: { [id: string]: ConduitComponentSettings } = {};\r\n this.ComponentSettings.forEach(c => {\r\n s[c.ComponentId] = c;\r\n });\r\n return s;\r\n });\r\n\r\n ko.defineProperty(this, \"lineComponentSettings\", () => {\r\n var lines = this.ComponentSettings.filter(c => c.lineLength > 0);\r\n lines.sort((a, b) => a.lineLength - b.lineLength);\r\n return lines;\r\n });\r\n\r\n ko.defineProperty(this, \"curveComponentSettings\", () => {\r\n var curves = this.ComponentSettings.filter(c => c.curveDegree > 0);\r\n curves.sort((a, b) => a.curveDegree - b.curveDegree);\r\n return curves;\r\n });\r\n\r\n ko.defineProperty(this, \"DynamicLength\", () => {\r\n return this.ComponentSettings.some(c => c.DynamicLength);\r\n });\r\n\r\n ko.defineProperty(this, \"DynamicLengthComponent\", () => {\r\n return this.DynamicLength ? ArrayHelper.firstOrNull(this.ComponentSettings, c => c.DynamicLength) : null;\r\n });\r\n\r\n ko.defineProperty(this, \"Color\", () => {\r\n return '#' + new THREE.Color(this.ComponentSettings.length ? this.ComponentSettings[0].Color : 0x706f6f).getHexString();\r\n });\r\n\r\n ko.defineProperty(this, \"ComponentGroup\", () => {\r\n return this.ComponentSettings.length ? this.ComponentSettings[0].ComponentGroup : null;\r\n });\r\n\r\n ko.defineProperty(this, \"ViewLayer\", () => {\r\n return this.ComponentSettings.length ? this.ComponentSettings[0].ViewLayer : null;\r\n });\r\n }\r\n\r\n isSelected(setting?: ConduitComponentSettings) {\r\n return this.selectedComponentSetting === (setting || null);\r\n }\r\n\r\n addLine(name: string, length: number, width: number, height: number, dynamicLength: boolean = false, bevelSize: number = 14, idString?: string, compId?: string) {\r\n if (length <= 1)\r\n length = 1;\r\n var lh = length * 0.5;\r\n var comp = new ConduitComponentSettings({\r\n Connections: [\r\n new ConduitConnection().setFromRotationDegreeDistance(0, lh),\r\n new ConduitConnection().setFromRotationDegreeDistance(180, lh)\r\n ] as SolarProTool.IConduitConnection[],\r\n ComponentWidth: width || 300,\r\n ComponentHeight: height || 80,\r\n Name: name || (\"line comp \" + length),\r\n DynamicLength: dynamicLength,\r\n BevelSize: bevelSize,\r\n SmoothNormals: false,\r\n MaterialColor: 0x646e72,\r\n MaterialEmissive: 0,\r\n MaterialMetalness: 0,\r\n MaterialRoughness: 1,\r\n ComponentId: compId || spt.Utils.GenerateGuid(),\r\n Color: 0x646e72\r\n });\r\n\r\n this.ComponentSettings.push(comp);\r\n\r\n return this;\r\n }\r\n\r\n addCurve(name: string, degree: number, padding: number, width: number, height: number, createMirror: boolean = true, bevelSize: number = 14, IdString?: string, compId?: string) {\r\n degree = spt.ThreeJs.utils.DegreeToPositive(degree);\r\n if (degree === 180 || degree === 0)\r\n return this.addLine(name, padding * 2, width, height, false, bevelSize, IdString, compId);\r\n\r\n degree = Math.round(degree);\r\n padding = Math.round(Math.max(padding, ConduitComponentSettings.calcMinPadding(width, degree)));\r\n\r\n var comp = new ConduitComponentSettings({\r\n Connections: [\r\n new ConduitConnection().setFromRotationDegreeDistance(0, padding),\r\n new ConduitConnection().setFromRotationDegreeDistance(degree, padding)\r\n ] as SolarProTool.IConduitConnection[],\r\n ComponentWidth: width || 300,\r\n ComponentHeight: height || 80,\r\n Name: name || (\"curve comp \" + degree),\r\n DynamicLength: false,\r\n BevelSize: bevelSize,\r\n SmoothNormals: false,\r\n MaterialColor: 0x646e72,\r\n MaterialEmissive: 0,\r\n MaterialMetalness: 0,\r\n MaterialRoughness: 1,\r\n ComponentId: compId || spt.Utils.GenerateGuid(),\r\n Color: 0x646e72\r\n });\r\n\r\n this.ComponentSettings.push(comp);\r\n\r\n if (createMirror) {\r\n degree = 360 - degree;\r\n\r\n var comp = new ConduitComponentSettings({\r\n Connections: [\r\n new ConduitConnection().setFromRotationDegreeDistance(0, padding),\r\n new ConduitConnection().setFromRotationDegreeDistance(degree, padding)\r\n ] as SolarProTool.IConduitConnection[],\r\n ComponentWidth: width || 300,\r\n ComponentHeight: height || 80,\r\n Name: name || (\"curve comp \" + degree),\r\n DynamicLength: false,\r\n BevelSize: bevelSize,\r\n SmoothNormals: false,\r\n MaterialColor: 0x646e72,\r\n MaterialEmissive: 0,\r\n MaterialMetalness: 0,\r\n MaterialRoughness: 1,\r\n ComponentId: compId || spt.Utils.GenerateGuid(),\r\n Color: 0x646e72\r\n });\r\n\r\n this.ComponentSettings.push(comp);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n addJunction(name: string, degrees: number[], padding: number, width: number, height: number, bevelSize: number = 14, IdString?: string, compId?: string) {\r\n\r\n if (!degrees) {\r\n degrees = [0];\r\n }\r\n\r\n if (!degrees.some(deg => deg === 0))\r\n degrees.unshift(0);\r\n\r\n degrees.sort((a, b) => a - b);\r\n\r\n var conns = degrees.map(degree => new ConduitConnection().setFromRotationDegreeDistance(spt.ThreeJs.utils.DegreeToPositive(degree), padding));\r\n\r\n var comp = new ConduitComponentSettings({\r\n Connections: conns,\r\n ComponentWidth: width || 300,\r\n ComponentHeight: height || 80,\r\n Name: name || (`junction comp ${degrees.length} [${degrees.join()}]`),\r\n DynamicLength: false,\r\n BevelSize: bevelSize,\r\n SmoothNormals: false,\r\n MaterialColor: 0x646e72,\r\n MaterialEmissive: 0,\r\n MaterialMetalness: 0,\r\n MaterialRoughness: 1,\r\n ComponentId: compId || spt.Utils.GenerateGuid(),\r\n Color: 0x646e72\r\n });\r\n\r\n this.ComponentSettings.push(comp);\r\n }\r\n\r\n getEqualComponentSetting(component: ConduitComponent) {\r\n var componentSettings = this.ComponentSettings;\r\n for (var i = componentSettings.length; i--;) {\r\n var compSetting = componentSettings[i];\r\n if (compSetting.canReplaceComponent(component))\r\n return compSetting;\r\n }\r\n return null;\r\n }\r\n }\r\n\r\n export class ConduitComponentSettings implements SolarProTool.IConduitComponentSetting, ILineStepping, ICurveStepping {\r\n\r\n static CanvasDrawer: CanvasDrawing.Drawer;\r\n\r\n Color = 0x646e72;\r\n ComponentWidth = 300;\r\n ComponentHeight = 80;\r\n BevelSize = 14;\r\n SmoothNormals = false;\r\n MaterialColor = 0x646e72;\r\n MaterialEmissive = 0;\r\n MaterialMetalness = 0;\r\n MaterialRoughness = 1;\r\n ComponentId: string = null;\r\n Connections: ConduitConnection[] = [];\r\n Name: string = \"\";\r\n DisplayName: string = \"\";\r\n DynamicLength: boolean = false;\r\n ComponentGroup: string = null;\r\n ViewLayer: string = null;\r\n\r\n static calcMinPadding(ComponentWidth: number, degree: number) {\r\n return Math.tan(Math.abs(180 - spt.ThreeJs.utils.DegreeToPositive(degree)) / 180 * Math.PI * 0.5) * ComponentWidth * 0.5;\r\n }\r\n\r\n readonly lineLength: number;\r\n readonly curveDegree: number;\r\n readonly curvePaddingStart: number;\r\n readonly curvePaddingEnd: number;\r\n readonly imgSrc: string;\r\n minImgBounds: number = 0;\r\n\r\n constructor(opts?: SolarProTool.IConduitComponentSetting, minImgBounds = 0) {\r\n if (opts) {\r\n Object.keys(opts).forEach(k => {\r\n if (k !== \"Connections\" && !k.startsWith(\"_\") && this[k] !== undefined)\r\n this[k] = opts[k];\r\n });\r\n\r\n if (opts.Connections && opts.Connections.length) {\r\n opts.Connections.forEach(con => {\r\n this.Connections.push(new ConduitConnection(con));\r\n });\r\n }\r\n }\r\n\r\n if (!this.ComponentId)\r\n this.ComponentId = spt.Utils.GenerateGuid();\r\n\r\n ko.track(this, [\"Connections\"]);\r\n\r\n ko.defineProperty(this, \"lineLength\", () => {\r\n var Connections = this.Connections;\r\n if (Connections.length === 2 && Connections[0].RotationDegree === 0 && Math.abs(Connections[1].RotationDegree - 180) < 1)\r\n return Math.abs(Connections[0].position.x - Connections[1].position.x);\r\n return 0;\r\n });\r\n\r\n ko.defineProperty(this, \"curveDegree\", () => {\r\n var Connections = this.Connections;\r\n if (Connections.length === 2 && Connections[0].RotationDegree === 0 && Math.abs(Connections[1].RotationDegree - 180) >= 1)\r\n return Connections[1].RotationDegree;\r\n return 0;\r\n });\r\n\r\n ko.defineProperty(this, \"curvePaddingStart\", () => {\r\n var Connections = this.Connections;\r\n if (this.curveDegree > 0)\r\n return Connections[0].position.length();\r\n return 0;\r\n });\r\n\r\n ko.defineProperty(this, \"curvePaddingEnd\", () => {\r\n var Connections = this.Connections;\r\n if (this.curveDegree > 0)\r\n return Connections[1].position.length();\r\n return 0;\r\n });\r\n\r\n this.minImgBounds = minImgBounds;\r\n\r\n if (!ConduitComponentSettings.CanvasDrawer) {\r\n ConduitComponentSettings.CanvasDrawer = CanvasDrawing.Drawer.GetInstance(30, 30);\r\n }\r\n\r\n ko.defineProperty(this, \"imgSrc\", () => {\r\n this.draw(ConduitComponentSettings.CanvasDrawer);\r\n return ConduitComponentSettings.CanvasDrawer.toDataURL();\r\n });\r\n }\r\n\r\n createComponent(p: THREE.Vector3, q: THREE.Quaternion) {\r\n var component = new ConduitComponent(spt.Utils.GenerateGuid(), this);\r\n component.position.copy(p);\r\n component.quaternion.copy(q);\r\n return component;\r\n }\r\n\r\n draw(drawer: CanvasDrawing.Drawer) {\r\n var style = new CanvasDrawing.Style(new MapDrawing.Color().setHex(this.Color)),\r\n width = this.ComponentWidth,\r\n shapes: CanvasDrawing.IShape[] = [],\r\n center = new MapDrawing.Point2D(0, 0),\r\n circle = new CanvasDrawing.ShapeCircle(center, width * 0.5, style),\r\n bw = Math.max(width, this.minImgBounds),\r\n bds = MapDrawing.Bounds2D.FromCenterSize(center, bw, bw),\r\n minLen = circle.radius + 10;\r\n\r\n this.Connections.forEach(c => {\r\n var p = new MapDrawing.Point2D(c.position.x, c.position.y);\r\n var d = p.sub(center);\r\n var len = d.GetLength();\r\n if (len < minLen)\r\n p = center.add(d.mul(minLen / len));\r\n\r\n var l = new CanvasDrawing.ShapeLine(center, p, width, style);\r\n shapes.push(l);\r\n bds.updateFromBounds(l.bounds);\r\n });\r\n\r\n if (circle)\r\n shapes.push(circle);\r\n\r\n bds.expandByScalar(10);\r\n drawer.viewport.bounds = bds;\r\n drawer.model.children = shapes;\r\n drawer.draw();\r\n }\r\n\r\n canReplace(connections: SolarProTool.IConduitConnection[]) {\r\n var cons = this.Connections;\r\n\r\n if (!cons || !connections || !cons.length || !connections.length || cons.length !== connections.length)\r\n return false;\r\n\r\n if (this.DynamicLength)\r\n return cons.every((c, i) => Math.abs(c.RotationDegree - connections[i].RotationDegree) < 0.001);\r\n\r\n return cons.every((c, i) => c.isEqualTo(connections[i]));\r\n }\r\n\r\n canReplaceComponent(component: ConduitComponent) {\r\n return component && this.DynamicLength === component.DynamicLength && this.canReplace(component.Connections);\r\n }\r\n }\r\n\r\n export enum ConduitComponentType {\r\n Any = 0,\r\n Line = 1,\r\n Curve = 2,\r\n Junction = 3\r\n }\r\n\r\n export class ConduitConnection implements SolarProTool.IConduitConnection {\r\n\r\n readonly position = new THREE.Vector3();\r\n readonly direction = new THREE.Vector3(1, 0, 0);\r\n private _v1 = new THREE.Vector3();\r\n private _q1 = new THREE.Quaternion();\r\n\r\n get X() {\r\n return this.position.x;\r\n }\r\n\r\n set X(val: number) {\r\n this.position.x = val;\r\n }\r\n\r\n get Y() {\r\n return this.position.y;\r\n }\r\n\r\n set Y(val: number) {\r\n this.position.y = val;\r\n }\r\n\r\n get Z() {\r\n return this.position.z;\r\n }\r\n\r\n set Z(val: number) {\r\n this.position.z = val;\r\n }\r\n\r\n //rotation in degree (counterclockwise). 0 points to the left.\r\n RotationDegree: number;\r\n\r\n //rotation in radian (counterclockwise). 0 points to the left.\r\n rad: number;\r\n\r\n readonly quaternion = new THREE.Quaternion();\r\n\r\n connected: ConduitConnection = null;\r\n\r\n parent: ConduitComponent = null;\r\n\r\n getGlobalPosition(target?: THREE.Vector3) {\r\n return (target || this._v1).copy(this.position).setZ(0).applyMatrix4(this.parent.matrix);\r\n }\r\n\r\n getGlobalQuaternion(target?: THREE.Quaternion) {\r\n return (target || this._q1).multiplyQuaternions(this.parent.quaternion, this.quaternion);\r\n }\r\n\r\n getGlobalDirection(target?: THREE.Vector3) {\r\n return (target || this._v1).copy(this.direction).applyQuaternion(this.parent.quaternion);\r\n }\r\n\r\n applyTo(component: ConduitComponent) {\r\n this.getGlobalPosition(component.position);\r\n this.getGlobalQuaternion(component.quaternion);\r\n }\r\n\r\n alignParent() {\r\n var parent = this.parent;\r\n parent.quaternion.setFromAxisAngle(ConduitComponent.upVector, -this.rad);\r\n parent.position.copy(this.position).setZ(0).applyQuaternion(parent.quaternion).negate();\r\n }\r\n\r\n alignObject(o: THREE.Object3D) {\r\n this.getGlobalPosition(o.position);\r\n this.getGlobalQuaternion(o.quaternion);\r\n\r\n o.updateMatrix();\r\n }\r\n\r\n alignComponent(c: ConduitComponent) {\r\n var con = c.getNextEmptyConnection(0);\r\n if (con)\r\n this.alignConnection(con);\r\n }\r\n\r\n alignConnection(con: ConduitConnection) {\r\n var connectedComponent = con.parent,\r\n q = this.getGlobalQuaternion();\r\n\r\n con.alignParent();\r\n\r\n connectedComponent.applyQuaternion(q);\r\n connectedComponent.position.applyQuaternion(q).add(this.getGlobalPosition());\r\n\r\n connectedComponent.updateMatrix();\r\n }\r\n\r\n angleTo(other: ConduitConnection) {\r\n return this.direction.angleTo(other.direction);\r\n }\r\n\r\n canConnect(other: ConduitConnection, toleranceSq = 1) {\r\n return (!this.connected && !other.connected && this.getGlobalDirection().dot(other.getGlobalDirection()) < -0.99 && this.getGlobalPosition().distanceToSquared(other.getGlobalPosition()) < toleranceSq);\r\n }\r\n\r\n tryConnect(other: ConduitConnection, toleranceSq?: number) {\r\n if (this.canConnect(other, toleranceSq)) {\r\n this.connect(other);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n tryAlign(other: ConduitConnection, toleranceSq?: number) {\r\n if (this.canConnect(other, toleranceSq)) {\r\n this.alignConnection(other);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n connect(con: ConduitConnection, moveOther?: boolean) {\r\n\r\n if (moveOther)\r\n this.alignConnection(con);\r\n\r\n this.connected = con;\r\n con.connected = this;\r\n }\r\n\r\n disconnect() {\r\n if (this.connected) {\r\n this.connected.connected = null;\r\n this.connected = null;\r\n }\r\n }\r\n\r\n setFromRotationDegreeDistance(rotationDegree: number, distance: number, z?: number) {\r\n this.RotationDegree = rotationDegree || 0;\r\n this.rad = rotationDegree * Math.PI / 180;\r\n spt.ThreeJs.utils.RotateCC(this.position.set(-distance, 0, z || 0), this.rad);\r\n spt.ThreeJs.utils.RotateCC(this.direction.set(-1, 0, 0), this.rad);\r\n this.quaternion.setFromAxisAngle(ConduitComponent.upVector, this.rad + Math.PI);\r\n return this;\r\n }\r\n\r\n setPosition(pos: THREE.Vector3) {\r\n this.position.set(pos.x, pos.y, this.position.z);\r\n return this;\r\n }\r\n\r\n translate(v: THREE.Vector3) {\r\n this.position.set(this.position.x + v.x, this.position.y + v.y, this.position.z);\r\n return this;\r\n }\r\n\r\n clone() {\r\n return new ConduitConnection(this);\r\n }\r\n\r\n getObjectHolder(): ConduitObjectHolder {\r\n return LS.Client3DEditor.Controller.Current.conduitObjectHolder;\r\n }\r\n\r\n isEqualTo(other: SolarProTool.IConduitConnection) {\r\n return Math.abs(this.X - other.X) < 0.001 &&\r\n Math.abs(this.Y - other.Y) < 0.001 &&\r\n Math.abs(this.Z - other.Z) < 0.001 &&\r\n Math.abs(this.RotationDegree - other.RotationDegree) < 0.001;\r\n }\r\n\r\n constructor(opts?: SolarProTool.IConduitConnection) {\r\n if (opts) {\r\n this.position.set(opts.X, opts.Y, opts.Z);\r\n this.RotationDegree = opts.RotationDegree || 0;\r\n } else\r\n this.RotationDegree = 0;\r\n\r\n this.rad = this.RotationDegree * Math.PI / 180;\r\n this.quaternion.setFromAxisAngle(ConduitComponent.upVector, this.rad + Math.PI);\r\n this.direction.applyQuaternion(this.quaternion);\r\n }\r\n\r\n exportData(): SolarProTool.IConduitConnection {\r\n return {\r\n X: this.X,\r\n Y: this.Y,\r\n Z: this.Z,\r\n RotationDegree: this.RotationDegree\r\n };\r\n }\r\n }\r\n\r\n export class ConduitComponent extends THREE.Object3D implements SolarProTool.IConduitComponent, IGenericObjectInstance {\r\n\r\n IsActive: boolean = true;\r\n IsDeleted: boolean = false;\r\n ClientOptions: SolarProTool.Client3DObectOptions = 0;\r\n DrawOptions: SolarProTool.DrawOptionsEnum = 0;\r\n ErrorCode: SolarProTool.ErrorCodeEnum = 0;\r\n InstanceColor: number = 0;\r\n IsInErrorState: boolean = false;\r\n Width: number = 0;\r\n Height: number = 0;\r\n IconInsertIndex: number = 0;\r\n\r\n Color = 0x6f6f6f;\r\n alpha = 1;\r\n ComponentWidth = 300;\r\n ComponentHeight = 80;\r\n BevelSize = 14;\r\n SmoothNormals = false;\r\n MaterialColor = 0x646e72;\r\n MaterialEmissive = 0;\r\n MaterialMetalness = 0;\r\n MaterialRoughness = 1;\r\n IdString: string = null;\r\n ComponentId: string = null;\r\n _needsUpdate: boolean = true;\r\n ComponentGroup: string = null;\r\n ViewLayer: string = null;\r\n\r\n private _editablePolygon: EditablePolygon2D;\r\n private _showPolylines: boolean = false;\r\n\r\n get showPolylines() {\r\n return this._showPolylines;\r\n }\r\n\r\n set showPolylines(v: boolean) {\r\n if (this._showPolylines !== v) {\r\n this._showPolylines = v;\r\n this.updatePolylines();\r\n }\r\n }\r\n\r\n ConduitObjectId: string = null;\r\n Name: string = \"\";\r\n DisplayName: string = \"\";\r\n\r\n get X() {\r\n return this.position.x;\r\n }\r\n\r\n set X(val: number) {\r\n this.position.x = val;\r\n }\r\n\r\n get Y() {\r\n return this.position.y;\r\n }\r\n\r\n set Y(val: number) {\r\n this.position.y = val;\r\n }\r\n\r\n get Z() {\r\n return this.position.z;\r\n }\r\n\r\n set Z(val: number) {\r\n this.position.z = val;\r\n }\r\n\r\n SizeX: number = 1;\r\n SizeY: number = 1;\r\n\r\n get RotationDegree() {\r\n return this.rotation.z / Math.PI * 180;\r\n }\r\n\r\n set RotationDegree(v: number) {\r\n this.rotation.z = +v / 180 * Math.PI;\r\n }\r\n\r\n get ConduitObject() {\r\n return this.ConduitObjectId ? this.getObjectHolder().conduitObjects[this.ConduitObjectId] : null;\r\n }\r\n\r\n set ConduitObject(co: ConduitObject) {\r\n this.ConduitObjectId = co ? co.IdString : null;\r\n }\r\n\r\n _isDisposed: boolean = false;\r\n _isSelected: boolean = false;\r\n _isHovered: boolean = false;\r\n _isHidden: boolean = false;\r\n DynamicLength: boolean = false;\r\n isBuild: boolean = false;\r\n isStatic: boolean = false;\r\n\r\n get _mesh(): THREE.Mesh {\r\n return this.children.length && this.children[0] as THREE.Mesh;\r\n }\r\n\r\n get isSelected() {\r\n return this._isSelected;\r\n }\r\n\r\n set isSelected(v: boolean) {\r\n if (this._isSelected !== v) {\r\n this._isSelected = v;\r\n this.OnChanged();\r\n }\r\n }\r\n\r\n get isHovered() {\r\n return this._isHovered;\r\n }\r\n\r\n set isHovered(v: boolean) {\r\n if (this._isHovered !== v) {\r\n this._isHovered = v;\r\n this.OnChanged();\r\n }\r\n }\r\n\r\n get isHidden() {\r\n return this._isHidden;\r\n }\r\n\r\n set isHidden(v: boolean) {\r\n if (this._isHidden !== v) {\r\n this._isHidden = v;\r\n this.OnChanged();\r\n }\r\n }\r\n\r\n setLength(l: number) {\r\n if (this.conduitType === ConduitComponentType.Line && l > 0) {\r\n var Connections = this.Connections,\r\n lh = l * 0.5;\r\n Connections[0].position.x = -lh;\r\n Connections[1].position.x = lh;\r\n\r\n this.updateConnectionPositions();\r\n\r\n if (this.showPolylines && this._editablePolygon) {\r\n var poly = this._editablePolygon.poly;\r\n poly.array[0].copy(Connections[0].position);\r\n poly.array[1].copy(Connections[1].position);\r\n ko.tasks.runEarly();\r\n this._editablePolygon.onGeometryChanged();\r\n this._editablePolygon.update();\r\n }\r\n\r\n var geo = this._mesh && this._mesh.geometry;\r\n if (geo) {\r\n geo.boundingSphere.radius = lh;\r\n geo.boundingSphere.getBoundingBox(geo.boundingBox);\r\n }\r\n }\r\n }\r\n\r\n getLength() {\r\n if (this.conduitType === ConduitComponentType.Line) {\r\n var Connections = this.Connections;\r\n return Math.abs(Connections[1].position.x - Connections[0].position.x);\r\n }\r\n return 0;\r\n }\r\n\r\n public static upVector = new THREE.Vector3(0, 0, 1);\r\n public static rightVector = new THREE.Vector3(1, 0, 0);\r\n public static leftVector = new THREE.Vector3(-1, 0, 0);\r\n public conduitType: ConduitComponentType = ConduitComponentType.Any;\r\n\r\n private calcConduitType() {\r\n var len = this.Connections.length;\r\n this.conduitType = len === 2 && this.Connections[0].RotationDegree === 0 ? (this.Connections[1].RotationDegree === 180 ? ConduitComponentType.Line : ConduitComponentType.Curve) : (len > 2 ? ConduitComponentType.Junction : ConduitComponentType.Any);\r\n }\r\n\r\n //Connections. RotationDegree angle -> connected object\r\n readonly Connections: ConduitConnection[] = [];\r\n\r\n getClosestConnectionTo(pos: THREE.Vector3): ConduitConnection {\r\n if (this._isDisposed || !this.visible)\r\n return null;\r\n\r\n var dist = Number.MAX_VALUE,\r\n result: ConduitConnection = null;\r\n this.Connections.forEach(con => {\r\n var d = con.getGlobalPosition().distanceToSquared(pos);\r\n if (d < dist) {\r\n dist = d;\r\n result = con;\r\n }\r\n });\r\n\r\n return result;\r\n }\r\n\r\n hasConnections(...degrees: number[]) {\r\n return degrees.every(degree => this.Connections.some(con => Math.abs(con.RotationDegree - degree) < 0.01));\r\n }\r\n\r\n hasOpenConnections() {\r\n return this.Connections.some(con => !con.connected);\r\n }\r\n\r\n getNextEmptyConnection(targetRotationDegree: number) {\r\n var Connections = this.Connections,\r\n c: ConduitConnection = null;\r\n\r\n for (var i = Connections.length; i--;) {\r\n var con = Connections[i];\r\n if (!con.connected) {\r\n if (con.RotationDegree === targetRotationDegree)\r\n return con;\r\n else if (!c || Math.abs(c.RotationDegree - targetRotationDegree) > Math.abs(con.RotationDegree - targetRotationDegree))\r\n c = con;\r\n }\r\n }\r\n\r\n return c;\r\n }\r\n\r\n addConnection(connection: SolarProTool.IConduitConnection) {\r\n var con = new ConduitConnection(connection);\r\n this.Connections.push(con);\r\n con.parent = this;\r\n\r\n if (this.ConduitObject)\r\n this.ConduitObject.OnComponentGeometryChanged();\r\n\r\n this.calcConduitType();\r\n }\r\n\r\n //local positions\r\n getConnectionPositions() {\r\n return this.Connections.map(c => c.position);\r\n }\r\n \r\n disconnect(comp: ConduitComponent) {\r\n return this.Connections.some(con => {\r\n if (con.connected && con.connected.parent === comp) {\r\n con.disconnect();\r\n return true;\r\n }\r\n return false;\r\n });\r\n }\r\n\r\n disconnectAll() {\r\n this.Connections.forEach(c => {\r\n c.disconnect();\r\n });\r\n }\r\n\r\n constructor(id?: string, setting?: SolarProTool.IConduitComponentSetting | SolarProTool.IConduitComponent) {\r\n super();\r\n this.IdString = id || spt.Utils.GenerateGuid();\r\n this.setSettings(setting);\r\n }\r\n\r\n setSettings(setting: SolarProTool.IConduitComponentSetting | SolarProTool.IConduitComponent) {\r\n if (!setting)\r\n return this;\r\n\r\n Object.keys(setting).forEach(k => {\r\n if (k !== \"Connections\" && k !== \"IdString\") {\r\n this[k] = setting[k];\r\n }\r\n });\r\n\r\n if (setting.Connections && setting.Connections.length) {\r\n if (this.Connections.length > 1) {\r\n this.disconnectAll();\r\n this.Connections.splice(0, this.Connections.length);\r\n }\r\n\r\n setting.Connections.forEach(co => {\r\n this.addConnection(co);\r\n });\r\n }\r\n\r\n this.updateMatrix();\r\n\r\n return this;\r\n }\r\n\r\n cloneMe(id?: string): ConduitComponent {\r\n return new ConduitComponent(id || this.IdString, this.exportData());\r\n }\r\n\r\n updateMaterial() {\r\n var mesh = this._mesh;\r\n if (!mesh)\r\n return;\r\n\r\n var material = mesh.material as THREE.MeshStandardMaterial;\r\n\r\n material.color.setHex(this.MaterialColor);\r\n\r\n if (this.isSelected || this.isHovered) {\r\n if (this.isSelected && this.isHovered)\r\n material.color.offsetHSL(0, +0.3, +0.4);\r\n else\r\n material.color.offsetHSL(0, +0.15, +0.2);\r\n }\r\n\r\n material.opacity = this.alpha;\r\n material.transparent = material.opacity < 1;\r\n\r\n material.needsUpdate = true;\r\n }\r\n\r\n lines: THREE.Line3[] = [];\r\n points: THREE.Vector3[] = [];\r\n\r\n private _inverseMat = new THREE.Matrix4();\r\n private _v1 = new THREE.Vector3();\r\n private _v2 = new THREE.Vector3();\r\n private _v3 = new THREE.Vector3();\r\n private _box1 = new THREE.Box3();\r\n private _viewBounds = new THREE.Box3();\r\n private _viewSize = new THREE.Vector3();\r\n public static QEPS = Math.PI / 180;\r\n\r\n applyMatrix4(matrix: THREE.Matrix4) {\r\n super.applyMatrix4(matrix);\r\n this._inverseMat.getInverse(this.matrix);\r\n }\r\n\r\n updateMatrix() {\r\n super.updateMatrix();\r\n this._inverseMat.getInverse(this.matrix);\r\n }\r\n\r\n intersecsBox(searchBox: THREE.Box3): boolean {\r\n var bounds = this.getBounds(this._box1);\r\n if (!this._isDisposed && !bounds.isEmpty() && bounds.intersectsBox(searchBox)) {\r\n var sb = this._box1.copy(searchBox).applyMatrix4(this._inverseMat);\r\n return this.lines.some(seg => spt.ThreeJs.utils.LineIntersecsBox(seg.start, seg.end, sb));\r\n }\r\n return false;\r\n }\r\n\r\n getClosestPoint(pt: THREE.Vector3, thresholdSq: number): IObjectIntersection {\r\n if (this._isDisposed || !this.visible)\r\n return null;\r\n\r\n var p = this._v1.copy(pt).applyMatrix4(this._inverseMat),\r\n points = this.getConnectionPositions(),\r\n pointsCount = points.length,\r\n lines = this.lines,\r\n linesCount = lines.length,\r\n result = null as IObjectIntersection,\r\n closestDistance: number = Number.MAX_VALUE;\r\n\r\n if (pointsCount > 0) {\r\n for (var i = pointsCount; i--;) {\r\n var tp = points[i],\r\n dsq = tp.distanceToSquared(p);\r\n if (dsq <= thresholdSq && dsq < closestDistance) {\r\n closestDistance = dsq;\r\n result = {\r\n o: this,\r\n p: tp,\r\n distSq: dsq,\r\n idx: i\r\n };\r\n }\r\n }\r\n }\r\n\r\n if (!result && linesCount > 0) {\r\n for (var i = linesCount; i--;) {\r\n var line = lines[i];\r\n\r\n var cp = spt.ThreeJs.utils.GetClosestPointToLine(line.start, line.end, p),\r\n dsq = cp.p.distanceToSquared(p);\r\n if (dsq <= thresholdSq && dsq < closestDistance) {\r\n closestDistance = dsq;\r\n result = {\r\n o: this,\r\n p: null, //cp.p,\r\n distSq: dsq,\r\n idx: -1\r\n };\r\n }\r\n }\r\n }\r\n\r\n if (result && result.p)\r\n result.p = result.p.clone().applyMatrix4(this.matrix);\r\n\r\n return result;\r\n }\r\n\r\n private _raycaster = new THREE.Raycaster();\r\n private _meshMatrixWorld = new THREE.Matrix4();\r\n\r\n getClosestEndPositionToRay(r: THREE.Ray, threshold: number) {\r\n if (this._isDisposed || !this.visible)\r\n return null;\r\n\r\n var ray = this._raycaster.ray.copy(r).applyMatrix4(this._inverseMat),\r\n bounds = this._box1.copy(this._mesh.geometry.boundingBox).expandByScalar(threshold + 1);\r\n\r\n if (!ray.intersectsBox(bounds))\r\n return null;\r\n\r\n var thresholdSq = threshold * threshold,\r\n connections = this.Connections,\r\n connectionsCount = connections.length,\r\n result = null as IObjectIntersection,\r\n closestDistance: number = Number.MAX_VALUE,\r\n p0 = this._v1.set(0, 0, 0),\r\n p1 = this._v2,\r\n p2 = this._v3;\r\n\r\n if (connectionsCount > 0) {\r\n for (var i = connectionsCount; i--;) {\r\n var con = connections[i],\r\n dsq: number,\r\n dsqLine = ray.distanceSqToSegment(p0.setZ(con.position.z), con.position, undefined, p1);\r\n if (!con.connected && (dsq = ray.distanceSqToPoint(con.position)) <= thresholdSq && dsq < closestDistance) {\r\n closestDistance = dsq;\r\n result = {\r\n o: this,\r\n p: p2.copy(p1),\r\n distSq: dsqLine,\r\n idx: i\r\n };\r\n } else if (dsqLine <= thresholdSq && dsqLine < closestDistance) {\r\n closestDistance = dsqLine;\r\n result = {\r\n o: this,\r\n p: p2.copy(p1),\r\n distSq: dsqLine,\r\n idx: -1\r\n };\r\n }\r\n }\r\n\r\n //for (var i = pointsCount; i--;) {\r\n // var tp = points[i],\r\n // dsq = ray.distanceSqToSegment(p0, tp, undefined, p1);\r\n // if (dsq <= thresholdSq && dsq < closestDistance) {\r\n // closestDistance = dsq;\r\n // result = {\r\n // o: this,\r\n // p: p2.copy(p1),\r\n // distSq: dsq,\r\n // idx: -1\r\n // };\r\n // }\r\n //}\r\n }\r\n\r\n if (result && result.p)\r\n result.p = result.p.clone().applyMatrix4(this.matrix);\r\n\r\n return result;\r\n }\r\n\r\n getClosestPointToRay(r: THREE.Ray, threshold: number): IObjectIntersection {\r\n if (this._isDisposed || !this.visible)\r\n return null;\r\n\r\n var mesh = this._mesh,\r\n ray = this._raycaster.ray.copy(r).applyMatrix4(this._inverseMat),\r\n bounds = this._box1.copy(mesh.geometry.boundingBox).expandByScalar(threshold + 1);\r\n\r\n if (!ray.intersectsBox(bounds))\r\n return null;\r\n\r\n var thresholdSq = threshold * threshold,\r\n result = null as IObjectIntersection,\r\n //closestDistance: number = Number.MAX_VALUE,\r\n raycaster = this._raycaster,\r\n meshMatrixWorld = this._meshMatrixWorld.copy(mesh.matrixWorld);\r\n\r\n raycaster.ray.copy(r);\r\n\r\n mesh.matrixWorld.copy(this.matrix);\r\n\r\n var meshInters = raycaster.intersectObject(mesh);\r\n if (meshInters && meshInters.length) {\r\n var inter = meshInters[0],\r\n dsq = raycaster.ray.distanceSqToPoint(inter.point);\r\n if (dsq <= thresholdSq/* && dsq < closestDistance*/) {\r\n //closestDistance = dsq;\r\n result = {\r\n o: this,\r\n p: inter.point.clone(),\r\n distSq: dsq,\r\n idx: -1\r\n };\r\n }\r\n }\r\n\r\n //if (!result && linesCount > 0) {\r\n // var p1 = this._v2,\r\n // p2 = this._v3;\r\n // for (var i = linesCount; i--;) {\r\n // var line = lines[i];\r\n\r\n // var dsq = ray.distanceSqToSegment(line.start, line.end, undefined, p1);\r\n // if (dsq <= thresholdSq && dsq < closestDistance) {\r\n // closestDistance = dsq;\r\n // result = {\r\n // o: this,\r\n // p: p2.copy(p1),\r\n // distSq: dsq,\r\n // idx: -1\r\n // };\r\n // }\r\n // }\r\n //}\r\n\r\n //if (result && result.p)\r\n // result.p = result.p.clone().applyMatrix4(this.matrix);\r\n\r\n mesh.matrixWorld.copy(meshMatrixWorld);\r\n\r\n return result;\r\n }\r\n\r\n getClosestCenterToRay(r: THREE.Ray, threshold: number): IObjectIntersection {\r\n if (this._isDisposed || !this.visible)\r\n return null;\r\n\r\n var ray = this._raycaster.ray.copy(r).applyMatrix4(this._inverseMat),\r\n bounds = this._box1.copy(this._mesh.geometry.boundingBox).expandByScalar(threshold + 1);\r\n\r\n if (!ray.intersectsBox(bounds))\r\n return null;\r\n\r\n var thresholdSq = threshold * threshold,\r\n Connections = this.Connections,\r\n ConnectionsCount = Connections.length,\r\n result = null as IObjectIntersection,\r\n closestDistance: number = Number.MAX_VALUE,\r\n center = this._v1.set(0, 0, 0),\r\n pt1 = this._v2,\r\n pt2 = this._v3;\r\n\r\n for (var i = ConnectionsCount; i--;) {\r\n var con = Connections[i];\r\n\r\n var dsq = ray.distanceSqToSegment(con.position, center.setZ(con.position.z), null, pt1);\r\n if (dsq <= thresholdSq && dsq < closestDistance) {\r\n closestDistance = dsq;\r\n result = {\r\n o: this,\r\n p: pt2.copy(pt1),\r\n distSq: dsq,\r\n idx: i\r\n };\r\n }\r\n }\r\n\r\n if (result && result.p)\r\n result.p = result.p.clone().applyMatrix4(this.matrix);\r\n\r\n return result;\r\n }\r\n\r\n getClosestByRay2D(rayOrigin: THREE.Vector3, rayDirection: THREE.Vector3) {\r\n if (this._isDisposed || !this.visible)\r\n return null;\r\n\r\n var origin = this._v1.copy(rayOrigin).applyMatrix4(this._inverseMat),\r\n direction = this._v2.copy(rayDirection).add(rayOrigin).applyMatrix4(this._inverseMat).sub(origin).normalize(),\r\n lines = this.lines,\r\n linesCount = lines.length,\r\n result = null as IObjectIntersection,\r\n closestDistance: number = Number.MAX_VALUE,\r\n p1 = this._v3;\r\n\r\n for (var i = linesCount; i--;) {\r\n var line = lines[i];\r\n\r\n var p = spt.ThreeJs.utils.ray2DSegmentIntersection(origin, direction, line.start, line.end);\r\n if (!p)\r\n continue;\r\n\r\n var cp = spt.ThreeJs.utils.GetClosestPointToLine(line.start, line.end, p1.set(p.x, p.y, 0)),\r\n dsq = cp.p.distanceToSquared(origin);\r\n if (dsq < closestDistance) {\r\n closestDistance = dsq;\r\n result = {\r\n o: this,\r\n p: cp.p.clone().applyMatrix4(this.matrix),\r\n distSq: dsq,\r\n idx: i\r\n };\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n get childComponents() {\r\n return this.Connections.filter((kv, i) => i > 0).map(kv => kv[1]);\r\n }\r\n\r\n getBounds(target?: THREE.Box3) {\r\n if (this.isBuild)\r\n return (target || this._box1).copy(this._mesh.geometry.boundingBox).applyMatrix4(this.matrix);\r\n return this._box1.makeEmpty();\r\n }\r\n\r\n buildMesh() {\r\n if (this._isDisposed || this.isBuild)\r\n return this;\r\n\r\n var Connections = this.Connections,\r\n center = new THREE.Vector3(0, 0, Connections.length ? Connections.reduce((v, con) => v + con.position.z, 0) / Connections.length : 0),\r\n verts: THREE.Vector3[] = [],\r\n norms: THREE.Vector3[] = [],\r\n indices: number[] = [],\r\n indexOffset = 0,\r\n h = this.ComponentHeight,\r\n w = this.ComponentWidth,\r\n smoothNormals = this.SmoothNormals,\r\n wh = w * 0.5,\r\n hh = h * 0.5,\r\n bs = this.BevelSize,\r\n ba = Math.max(0, Math.min(w / (Math.sqrt(2) + 2), h / (Math.sqrt(2) + 2), Math.sqrt(bs * bs * 0.5))),\r\n bevelEnabled = ba > 0,\r\n color = this.MaterialColor,\r\n emissive = this.MaterialEmissive,\r\n metalness = this.MaterialMetalness,\r\n roughness = this.MaterialRoughness,\r\n suOff = ba * 0.25; //offset upper point in case of smooth normals\r\n\r\n var lines: THREE.Line3[] = [],\r\n points: THREE.Vector3[] = [],\r\n dirUp = new THREE.Vector3(0, 0, 1);\r\n\r\n function genVerts(p: THREE.Vector3, dirX: THREE.Vector3, dirY: THREE.Vector3, addUpperPoint: boolean, reverseFaces: boolean, addVerts: boolean) {\r\n var dx: number,\r\n dy: number,\r\n n = dirX.clone().cross(dirY).normalize(),\r\n pts: THREE.Vector3[] = addVerts ? verts : [],\r\n pCount = 0;\r\n if (reverseFaces)\r\n n.negate();\r\n if (bevelEnabled) {\r\n dx = -wh + ba; dy = -hh;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n dx = wh - ba;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n dx = wh; dy = -hh + ba;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n dy = hh - ba;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n dx = wh - ba; dy = hh;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n if (addUpperPoint) {\r\n dx = 0;\r\n dy = hh + suOff;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n pCount++;\r\n }\r\n dx = -wh + ba; dy = hh;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n dx = -wh; dy = hh - ba;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n dy = -hh + ba;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n\r\n pCount += 8;\r\n }\r\n else {\r\n dx = -wh; dy = -hh;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n dx = wh;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n dy = hh;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n if (addUpperPoint) {\r\n dx = 0;\r\n dy = hh + ba * 0.25;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n pCount++;\r\n }\r\n dx = -wh; dy = hh;\r\n pts.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n\r\n pCount += 4;\r\n }\r\n\r\n if (addVerts) {\r\n for (var iv = 0; iv < pCount; iv++) {\r\n norms.push(n);\r\n }\r\n\r\n if (reverseFaces) {\r\n for (var iv = 2; iv < pCount; iv++) {\r\n indices.push(\r\n indexOffset, indexOffset + iv, indexOffset + iv - 1\r\n );\r\n }\r\n } else {\r\n for (var iv = 2; iv < pCount; iv++) {\r\n indices.push(\r\n indexOffset, indexOffset + iv - 1, indexOffset + iv\r\n );\r\n }\r\n }\r\n\r\n indexOffset += pCount;\r\n }\r\n\r\n //add edges and corners\r\n dx = -wh; dy = -hh;\r\n points.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n dx = wh; dy = -hh;\r\n points.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n dx = wh; dy = hh;\r\n points.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n dx = -wh; dy = hh;\r\n points.push(new THREE.Vector3(p.x + dirX.x * dx + dirY.x * dy, p.y + dirX.y * dx + dirY.y * dy, p.z + dirX.z * dx + dirY.z * dy));\r\n\r\n var pidx = points.length - 4;\r\n\r\n lines.push(new THREE.Line3(points[pidx + 0], points[pidx + 1]));\r\n lines.push(new THREE.Line3(points[pidx + 2], points[pidx + 3]));\r\n\r\n return addVerts ? pts.slice(-pCount) : pts;\r\n }\r\n\r\n function addLine(vFrom: THREE.Vector3, vTo: THREE.Vector3, addStartFaces: boolean, addEndFaces: boolean) {\r\n\r\n var diff = new THREE.Vector3(vTo.x - vFrom.x, vTo.y - vFrom.y, 0);\r\n\r\n if (diff.lengthSq() <= 0)\r\n return;\r\n\r\n var dir = diff.clone().normalize(),\r\n dirRight = new THREE.Vector3(dir.y, -dir.x, 0);\r\n\r\n var sVerts = genVerts(vFrom, dirRight, dirUp, smoothNormals, false, addStartFaces); // add start face vertices\r\n var eVerts = genVerts(vTo, dirRight, dirUp, smoothNormals, true, addEndFaces); // add end face vertices\r\n\r\n var edgeCount = sVerts.length;\r\n\r\n if (smoothNormals) {\r\n //add (edgeCount - 1) * 2 vertices\r\n for (var i1 = 0; i1 < edgeCount; i1++) {\r\n verts.push(\r\n sVerts[i1],\r\n eVerts[i1]);\r\n\r\n var nv = sVerts[i1].clone().sub(vFrom).normalize();\r\n\r\n norms.push(\r\n nv,\r\n nv);\r\n\r\n if (i1 === 0) {\r\n var ec2 = edgeCount * 2;\r\n indices.push(\r\n indexOffset + ec2 - 2, indexOffset + ec2 - 1, indexOffset + 0,\r\n indexOffset + 0, indexOffset + ec2 - 1, indexOffset + 1\r\n );\r\n }\r\n else if (i1 !== 1) {\r\n indices.push(\r\n indexOffset - 2, indexOffset - 1, indexOffset + 0,\r\n indexOffset + 0, indexOffset - 1, indexOffset + 1\r\n );\r\n }\r\n\r\n indexOffset += 2;\r\n }\r\n }\r\n else {\r\n var i1 = edgeCount - 1;\r\n //add (edgeCount - 1) * 4 vertices\r\n for (var i2 = 0; i2 < edgeCount; i2++) {\r\n\r\n //skip bottom faces\r\n if (i2 !== 1) {\r\n verts.push(\r\n sVerts[i1],\r\n eVerts[i1],\r\n eVerts[i2],\r\n sVerts[i2]);\r\n\r\n var nv = spt.ThreeJs.utils.getNormal(sVerts[i1], eVerts[i1], sVerts[i2]);\r\n\r\n norms.push(\r\n nv,\r\n nv,\r\n nv,\r\n nv);\r\n\r\n indices.push(\r\n indexOffset + 0, indexOffset + 1, indexOffset + 2,\r\n indexOffset + 0, indexOffset + 2, indexOffset + 3\r\n );\r\n indexOffset += 4;\r\n }\r\n\r\n i1 = i2;\r\n }\r\n }\r\n\r\n //add edges\r\n var pidx = points.length - 8;\r\n\r\n for (var i = 0; i < 4; i++) {\r\n lines.push(new THREE.Line3(points[pidx + i], points[pidx + i + 4]));\r\n }\r\n }\r\n\r\n if (Connections.length > 1 && Connections.some(c => c.RotationDegree === 0) && Connections.some(c => c.RotationDegree === 180)) {\r\n var idx1 = Connections.findIndex(c => c.RotationDegree === 0),\r\n idx2 = Connections.findIndex(c => c.RotationDegree === 180);\r\n addLine(Connections[idx1].position, Connections[idx2].position, true, true);\r\n if (Connections.length > 2) {\r\n Connections.forEach((c, i) => {\r\n if (i !== idx1 && i !== idx2)\r\n addLine(c.position, center, true, false);\r\n });\r\n }\r\n }\r\n else {\r\n Connections.forEach(c => {\r\n addLine(c.position, center, true, false);\r\n });\r\n }\r\n\r\n //add circle edge for curves\r\n if (this.conduitType === ConduitComponentType.Curve) {\r\n var deg = Connections[1].RotationDegree,\r\n pts = deg < 180 ?\r\n spt.ThreeJs.utils.GetCirclePoints(wh, 30, (deg - 90) * THREE.MathUtils.DEG2RAD, Math.PI * 0.5) :\r\n spt.ThreeJs.utils.GetCirclePoints(wh, 30, -Math.PI * 0.5, (deg - 270) * THREE.MathUtils.DEG2RAD),\r\n pLen = pts.length;\r\n\r\n //radius and height\r\n var rr = bevelEnabled\r\n ? [\r\n [(wh - ba) / wh, -hh],\r\n [1, -hh + ba],\r\n [1, hh - ba],\r\n [(wh - ba) / wh, hh]\r\n ]\r\n : [\r\n [1, -hh],\r\n [1, hh]\r\n ],\r\n rf1: number,\r\n rz1: number,\r\n rf2: number,\r\n rz2: number;\r\n\r\n\r\n //add sides of circle\r\n if (smoothNormals) {\r\n\r\n for (var k = 0, rrl = rr.length; k < rrl; k++) {\r\n rf1 = rr[k][0];\r\n rz1 = rr[k][1];\r\n\r\n for (var j = 0; j < pLen; j++) {\r\n var p1 = pts[j],\r\n v = new THREE.Vector3(p1.x * rf1 + dirUp.x * rz1, p1.y * rf1 + dirUp.y * rz1, p1.z * rf1 + dirUp.z * rz1);\r\n\r\n verts.push(v);\r\n\r\n norms.push(\r\n v.clone().sub(center).normalize());\r\n }\r\n\r\n if (k > 0) {\r\n for (var j = 1; j < pLen; j++) {\r\n\r\n var idx1 = indexOffset + j - 1 - pLen,\r\n idx2 = indexOffset + j - pLen,\r\n idx3 = indexOffset + j,\r\n idx4 = indexOffset + j - 1;\r\n\r\n indices.push(\r\n idx1, idx2, idx3,\r\n idx1, idx3, idx4\r\n );\r\n }\r\n }\r\n\r\n indexOffset += pLen;\r\n }\r\n\r\n //add top\r\n verts.push(new THREE.Vector3(center.x + dirUp.x * rz1, center.y + dirUp.y * rz1, center.z + dirUp.z * rz1 + suOff));\r\n norms.push(new THREE.Vector3(0, 0, 1));\r\n\r\n for (var j = 1; j < pLen; j++) {\r\n indices.push(\r\n indexOffset + 0, indexOffset - j - 1, indexOffset - j\r\n );\r\n }\r\n\r\n indexOffset += 1;\r\n\r\n }\r\n else {\r\n for (var k = 1, rrl = rr.length; k < rrl; k++) {\r\n rf1 = rr[k - 1][0];\r\n rz1 = rr[k - 1][1];\r\n rf2 = rr[k][0];\r\n rz2 = rr[k][1];\r\n\r\n for (var j = 1; j < pLen; j++) {\r\n var p1 = pts[j - 1],\r\n p2 = pts[j];\r\n verts.push(new THREE.Vector3(p1.x * rf1 + dirUp.x * rz1, p1.y * rf1 + dirUp.y * rz1, p1.z * rf1 + dirUp.z * rz1));\r\n verts.push(new THREE.Vector3(p2.x * rf1 + dirUp.x * rz1, p2.y * rf1 + dirUp.y * rz1, p2.z * rf1 + dirUp.z * rz1));\r\n verts.push(new THREE.Vector3(p1.x * rf2 + dirUp.x * rz2, p1.y * rf2 + dirUp.y * rz2, p1.z * rf2 + dirUp.z * rz2));\r\n verts.push(new THREE.Vector3(p2.x * rf2 + dirUp.x * rz2, p2.y * rf2 + dirUp.y * rz2, p2.z * rf2 + dirUp.z * rz2));\r\n\r\n var nv = spt.ThreeJs.utils.getNormal(verts[indexOffset + 0], verts[indexOffset + 1], verts[indexOffset + 2]);\r\n\r\n norms.push(\r\n nv,\r\n nv,\r\n nv,\r\n nv);\r\n\r\n indices.push(\r\n indexOffset + 0, indexOffset + 1, indexOffset + 2,\r\n indexOffset + 2, indexOffset + 1, indexOffset + 3\r\n );\r\n\r\n indexOffset += 4;\r\n }\r\n }\r\n\r\n //add top\r\n for (var j = 1; j < pLen; j++) {\r\n var p1 = pts[j - 1],\r\n p2 = pts[j];\r\n\r\n verts.push(new THREE.Vector3(p1.x * rf2 + dirUp.x * rz2, p1.y * rf2 + dirUp.y * rz2, p1.z * rf2 + dirUp.z * rz2));\r\n verts.push(new THREE.Vector3(p2.x * rf2 + dirUp.x * rz2, p2.y * rf2 + dirUp.y * rz2, p2.z * rf2 + dirUp.z * rz2));\r\n verts.push(new THREE.Vector3(center.x + dirUp.x * rz2, center.y + dirUp.y * rz2, center.z + dirUp.z * rz2));\r\n\r\n indices.push(\r\n indexOffset + 0, indexOffset + 1, indexOffset + 2\r\n );\r\n\r\n var nv = spt.ThreeJs.utils.getNormal(verts[indexOffset + 0], verts[indexOffset + 1], verts[indexOffset + 2]);\r\n\r\n norms.push(\r\n nv,\r\n nv,\r\n nv);\r\n\r\n indexOffset += 3;\r\n }\r\n }\r\n\r\n }\r\n\r\n if (!indices.length)\r\n return this;\r\n\r\n var geo = new THREE.BufferGeometry();\r\n\r\n var positions = new Float32Array(verts.length * 3);\r\n geo.setAttribute('position', new THREE.BufferAttribute(positions, 3).copyVector3sArray(verts));\r\n\r\n var normals = new Float32Array(norms.length * 3);\r\n geo.setAttribute('normal', new THREE.BufferAttribute(normals, 3).copyVector3sArray(norms));\r\n\r\n geo.setIndex(indices);\r\n\r\n //return THREE.BufferGeometryUtils.mergeBufferGeometries([]).translate(center.x, center.y, center.z);\r\n\r\n //var geo = new THREE.ExtrudeBufferGeometry(shapes, extrudeSettings).translate(center.x, center.y, center.z);\r\n\r\n if (!geo.boundingBox)\r\n geo.boundingBox = new THREE.Box3();\r\n\r\n if (!geo.boundingSphere)\r\n geo.boundingSphere = new THREE.Sphere();\r\n\r\n geo.boundingBox.setFromPoints(points);\r\n geo.boundingBox.getBoundingSphere(geo.boundingSphere);\r\n\r\n //this.geometry = geo;\r\n this.lines = lines;\r\n this.points = points;\r\n this.isBuild = true;\r\n\r\n if (this.DynamicLength && !this.isStatic) {\r\n //add bones\r\n var rootBone = new THREE.Bone();\r\n var bones: THREE.Bone[] = [rootBone];\r\n this.Connections.forEach(c => {\r\n var bone = new THREE.Bone();\r\n bone.position.copy(c.position);\r\n bone.quaternion.copy(c.quaternion);\r\n bones.push(bone);\r\n rootBone.add(bone);\r\n });\r\n\r\n var skeleton = new THREE.Skeleton(bones);\r\n\r\n var mesh = new THREE.SkinnedMesh(geo, new THREE.MeshStandardMaterial({ metalness: metalness, roughness: roughness, skinning: true, color: color, emissive: emissive }));\r\n\r\n mesh.add(rootBone);\r\n mesh.bind(skeleton);\r\n\r\n //add skinning\r\n var position = geo.attributes.position as THREE.BufferAttribute;\r\n\r\n var vertex = new THREE.Vector3();\r\n\r\n var skinIndices = [];\r\n var skinWeights = [];\r\n\r\n for (var i = 0; i < position.count; i++) {\r\n\r\n vertex.fromBufferAttribute(position, i);\r\n\r\n //var y = ( vertex.y + sizing.halfHeight );\r\n\r\n //var skinIndex = Math.floor( y / sizing.segmentHeight );\r\n //var skinWeight = ( y % sizing.segmentHeight ) / sizing.segmentHeight;\r\n\r\n //skinIndices.push( skinIndex, skinIndex + 1, 0, 0 );\r\n //skinWeights.push( 1 - skinWeight, skinWeight, 0, 0 );\r\n\r\n var skinIndex = ArrayHelper.indexByMin(bones, b => b.position.distanceToSquared(vertex));\r\n\r\n skinIndices.push(skinIndex, 0, 0, 0);\r\n skinWeights.push(1, 0, 0, 0);\r\n\r\n }\r\n\r\n geo.setAttribute('skinIndex', new THREE.Uint16BufferAttribute(skinIndices, 4));\r\n geo.setAttribute('skinWeight', new THREE.Float32BufferAttribute(skinWeights, 4));\r\n\r\n this.add(mesh);\r\n } else {\r\n this.add(new THREE.Mesh(geo, new THREE.MeshStandardMaterial({ metalness: metalness, roughness: roughness, color: color, emissive: emissive })));\r\n }\r\n\r\n this._showPolylines = this.getObjectHolder().showPolylines;\r\n\r\n this.updatePolylines();\r\n\r\n return this;\r\n }\r\n\r\n updatePolylines() {\r\n if (!this.isBuild)\r\n return;\r\n\r\n var showPolylines = this.showPolylines,\r\n editablePolygon = this._editablePolygon;\r\n\r\n if (!showPolylines) {\r\n if (editablePolygon) {\r\n this.remove(editablePolygon);\r\n editablePolygon.dispose();\r\n this._editablePolygon = null;\r\n }\r\n return;\r\n } else if (editablePolygon)\r\n return;\r\n\r\n var localPolygon = new ObservablePolygon();\r\n\r\n var origin = new THREE.Vector3(0, 0, 0);\r\n\r\n var Connections = this.Connections;\r\n\r\n if (Connections.length > 1 && Connections.some(c => c.RotationDegree === 0) && Connections.some(c => c.RotationDegree === 180)) {\r\n var idx1 = Connections.findIndex(c => c.RotationDegree === 0),\r\n idx2 = Connections.findIndex(c => c.RotationDegree === 180);\r\n\r\n localPolygon.push(Connections[idx1].position);\r\n localPolygon.push(Connections[idx2].position);\r\n\r\n if (Connections.length > 2) {\r\n localPolygon.push(origin);\r\n\r\n Connections.forEach((c, i) => {\r\n if (i !== idx1 && i !== idx2) {\r\n localPolygon.push(c.position);\r\n localPolygon.push(origin.setZ(c.position.z));\r\n }\r\n });\r\n }\r\n }\r\n else {\r\n Connections.forEach(c => {\r\n localPolygon.push(c.position);\r\n localPolygon.push(origin);\r\n });\r\n }\r\n\r\n editablePolygon = this._editablePolygon = new EditablePolygon2D(localPolygon, null, null,\r\n {\r\n surfaceColor: 0,\r\n surfaceOpacity: 0,\r\n lineColor: this.MaterialColor,\r\n linewidth: 5\r\n });\r\n\r\n editablePolygon.editable = true;\r\n editablePolygon.clickable = false;\r\n editablePolygon.draggable = false;\r\n editablePolygon.closed = false;\r\n editablePolygon.editOptions = EditablePolygon2D.ShowEdges;\r\n\r\n this.add(editablePolygon);\r\n }\r\n\r\n updateConnectionPositions() {\r\n if (!this.isBuild || !this.DynamicLength || this.isStatic)\r\n return;\r\n\r\n var mesh = this._mesh as THREE.SkinnedMesh,\r\n skeleton = mesh.skeleton,\r\n bones = skeleton.bones;\r\n\r\n this.Connections.forEach((c, i) => {\r\n var bone = bones[i + 1];\r\n bone.position.copy(c.position);\r\n bone.quaternion.copy(c.quaternion);\r\n });\r\n }\r\n\r\n dispose(): void {\r\n if (!this._isDisposed) {\r\n this._isDisposed = true;\r\n spt.ThreeJs.utils.disposeObject3D(this, true, true, false);\r\n }\r\n }\r\n\r\n intersecsTestVolume(testVolume: spt.ThreeJs.utils.TestVolume, linePrecision: number): boolean {\r\n if (!this.isBuild || !this.visible)\r\n return false;\r\n\r\n var matrixWorld = this.matrixWorld,\r\n worldBounds = this._box1.copy(this._mesh.geometry.boundingBox).applyMatrix4(matrixWorld).expandByScalar(linePrecision);\r\n\r\n if (!testVolume.testBoxForSeparationAxis(worldBounds)) {\r\n\r\n var lines = this.lines,\r\n p1 = this._v1,\r\n p2 = this._v2;\r\n\r\n for (var i = lines.length; i--;) {\r\n var line = lines[i];\r\n p1.copy(line.start).applyMatrix4(matrixWorld);\r\n p2.copy(line.end).applyMatrix4(matrixWorld);\r\n if (!testVolume.testEdgeForSeparationAxis([p1, p2]))\r\n return true;\r\n }\r\n\r\n //var instanceMesh = this.instanceMesh;\r\n //if (!testVolume.testBufferGeometryForSeparationAxis(instanceMesh.geometry as THREE.BufferGeometry, instanceMesh.matrixWorld))\r\n // return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n GetConnectionByAngle(rad: number): ConduitConnection {\r\n var dir = spt.ThreeJs.utils.RotateCC(this._v1.set(-1, 0, 0), rad),\r\n d = -1,\r\n con: ConduitConnection = null,\r\n conns = this.Connections,\r\n len = conns.length;\r\n\r\n for (var i = len; i--;) {\r\n var c = conns[i],\r\n cd = c.direction.dot(dir);\r\n if (cd > d) {\r\n d = cd;\r\n con = c;\r\n }\r\n }\r\n\r\n return con;\r\n }\r\n\r\n GetAllConnected(): ConduitComponent[] {\r\n var result: ConduitComponent[] = [this],\r\n workset: ConduitConnection[] = this.Connections.slice();\r\n\r\n while (workset.length > 0) {\r\n var con = workset.splice(0, 1)[0];\r\n if (con.connected) {\r\n var comp = con.connected.parent,\r\n cIdx = result.indexOf(comp);\r\n if (cIdx === -1) {\r\n result.push(comp);\r\n workset.push.apply(workset, comp.Connections);\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n tryConnect(other: ConduitComponent, toleranceSq?: number) {\r\n return this.Connections.some(con1 => other.Connections.some(con2 => con1.tryConnect(con2, toleranceSq)));\r\n }\r\n\r\n tryAlign(other: ConduitComponent, toleranceSq?: number) {\r\n return this.Connections.some(con1 => other.Connections.some(con2 => con1.tryAlign(con2, toleranceSq)));\r\n }\r\n\r\n getConnectionDistance(other: ConduitComponent, toleranceSq?: number) {\r\n var dist = Number.MAX_VALUE;\r\n\r\n this.Connections.forEach(con1 => {\r\n if (!con1.connected) {\r\n other.Connections.forEach(con2 => {\r\n if (con2.canConnect(con1, toleranceSq)) {\r\n var d = con1.getGlobalPosition().distanceToSquared(con2.getGlobalPosition());\r\n if (d < dist)\r\n dist = d;\r\n }\r\n\r\n });\r\n }\r\n });\r\n\r\n return dist;\r\n }\r\n\r\n getObjectHolder(): ConduitObjectHolder {\r\n return LS.Client3DEditor.Controller.Current.conduitObjectHolder;\r\n }\r\n\r\n update(): void {\r\n if (this._isDisposed || !this._needsUpdate)\r\n return;\r\n\r\n this._needsUpdate = false;\r\n\r\n if (this.isHidden) {\r\n this.visible = false;\r\n return;\r\n } else if (!this.visible)\r\n this.visible = true;\r\n\r\n if (!this.isBuild)\r\n this.buildMesh();\r\n\r\n this._viewBounds.copy(this._mesh.geometry.boundingBox).applyMatrix4(this.matrix);\r\n this._viewBounds.getSize(this._viewSize);\r\n\r\n this.updateMaterial();\r\n\r\n }\r\n\r\n exportData(): SolarProTool.IConduitComponent {\r\n\r\n var pos = this.position;\r\n //if (this.parent)\r\n // pos = pos.clone().applyMatrix4(this.parent.matrix);\r\n\r\n return {\r\n IdString: this.IdString || spt.Utils.GuidEmpty(),\r\n RotationDegree: this.rotation.z / Math.PI * 180,\r\n ComponentId: this.ComponentId || spt.Utils.GuidEmpty(),\r\n X: pos.x,\r\n Y: pos.y,\r\n Z: pos.z,\r\n SizeX: 1,\r\n SizeY: 1,\r\n Color: this.Color, // System.Int32\r\n ComponentWidth: this.ComponentWidth, // System.Double\r\n ComponentHeight: this.ComponentHeight, // System.Double\r\n BevelSize: this.BevelSize, // System.Double\r\n SmoothNormals: this.SmoothNormals,\r\n MaterialColor: this.MaterialColor,\r\n MaterialEmissive: this.MaterialEmissive,\r\n MaterialMetalness: this.MaterialMetalness,\r\n MaterialRoughness: this.MaterialRoughness,\r\n Connections: this.Connections.map(c => c.exportData()),\r\n Name: this.Name, // System.String\r\n DisplayName: this.DisplayName,\r\n DynamicLength: this.DynamicLength, // System.Boolean\r\n IsActive: true, // System.Boolean\r\n IsDeleted: false, // System.Boolean\r\n ClientOptions: 0, // enum SPTSettingInterface.Client3DObectOptions\r\n DrawOptions: 0, // enum SPTSettingInterface.DrawOptionsEnum\r\n ErrorCode: 0, // enum SPTEnums.ErrorCodeEnum\r\n InstanceColor: 0, // System.Int32\r\n IsInErrorState: false, // System.Boolean\r\n Width: 0, // System.Double\r\n Height: 0, // System.Double\r\n IconInsertIndex: 0, // System.Int32\r\n ComponentGroup: this.ComponentGroup,\r\n ViewLayer: this.ViewLayer\r\n };\r\n }\r\n\r\n moveBy(v: THREE.Vector3) {\r\n this.ConduitObject.moveBy(v);\r\n }\r\n\r\n applyTranslation(v: THREE.Vector3) {\r\n this.position.add(v);\r\n this.updateMatrix();\r\n }\r\n\r\n removeInstance(skipUpdate?: boolean) {\r\n this.getObjectHolder().removeObject(this, skipUpdate);\r\n }\r\n\r\n GetPositionProperty(k: string): number {\r\n if (this.isBuild)\r\n return this._viewBounds.min[k];\r\n return this.position[k];\r\n }\r\n\r\n GetSizeProperty(k: string): number {\r\n if (this.isBuild)\r\n return this._viewSize[k];\r\n return 0;\r\n }\r\n\r\n OnChanged(viewModel?: ViewModel) {\r\n if (viewModel && viewModel.isDragging)\r\n this.ConduitObject.applyDrag();\r\n this._needsUpdate = true;\r\n if (this.ConduitObject)\r\n this.ConduitObject.OnComponentChanged();\r\n }\r\n\r\n applyObjectPosition() {\r\n this.ConduitObject.applyObjectPosition();\r\n }\r\n\r\n duplicate(count?: number, distance?: number, direction?: THREE.Vector3): void {\r\n return;\r\n }\r\n\r\n rotateByPivot(pivot: THREE.Vector3, angleRad: number) {\r\n return;\r\n }\r\n\r\n getClosestEntryPoint(point: THREE.Vector3, target: THREE.Vector3): THREE.Vector3 {\r\n\r\n if (this.conduitType === ConduitComponentType.Line)\r\n return spt.ThreeJs.utils.GetClosestPointOnLine(this.Connections[0].getGlobalPosition(), this.Connections[1].getGlobalPosition(), point, target);\r\n\r\n var pt = this._v1.copy(point).applyMatrix4(this._inverseMat),\r\n center = this._v2.set(0, 0, 0),\r\n tp = this._v3,\r\n len = Number.MAX_VALUE,\r\n conns = this.Connections;\r\n\r\n for (var i = conns.length; i--;) {\r\n var conPos = conns[i].position;\r\n spt.ThreeJs.utils.GetClosestPointOnLine(center.setZ(conPos.z), conPos, pt, tp);\r\n var l = tp.distanceToSquared(pt);\r\n if (l < len) {\r\n len = l;\r\n target.copy(tp);\r\n }\r\n }\r\n\r\n return target.applyMatrix4(this.matrix);\r\n\r\n }\r\n\r\n getPivot(): THREE.Vector3 {\r\n return new THREE.Vector3();\r\n }\r\n\r\n getPoints(): THREE.Vector3[] {\r\n return [];\r\n //return this.points;\r\n }\r\n\r\n getLines(): THREE.Line3[] {\r\n return [];\r\n //return this.lines;\r\n }\r\n\r\n save() {\r\n this.getObjectHolder().saveConduitObject(this.ConduitObject);\r\n }\r\n }\r\n\r\n export class ConduitObject extends THREE.Object3D implements SolarProTool.IConduitObject {\r\n IsActive: boolean = true;\r\n IsDeleted: boolean = false;\r\n ClientOptions: SolarProTool.Client3DObectOptions = 0;\r\n DrawOptions: SolarProTool.DrawOptionsEnum = 0;\r\n ErrorCode: SolarProTool.ErrorCodeEnum = 0;\r\n InstanceColor: number = 0;\r\n IsInErrorState: boolean = false;\r\n Width: number = 0;\r\n Height: number = 0;\r\n IconInsertIndex: number = 0;\r\n _isDisposed: boolean = false;\r\n _needsUpdate: boolean = true;\r\n _positionChanged = 0;\r\n _v1 = new THREE.Vector3();\r\n _vt = new THREE.Vector3();\r\n private _box1 = new THREE.Box3();\r\n _updateMove: boolean = false;\r\n _updateDrag: boolean = false;\r\n\r\n private _subscriptions: KnockoutSubscription[] = [];\r\n\r\n get X() {\r\n return this.position.x;\r\n }\r\n\r\n set X(val: number) {\r\n this.position.x = val;\r\n }\r\n\r\n get Y() {\r\n return this.position.y;\r\n }\r\n\r\n set Y(val: number) {\r\n this.position.y = val;\r\n }\r\n\r\n get Z() {\r\n return this.position.z;\r\n }\r\n\r\n set Z(val: number) {\r\n this.position.z = val;\r\n }\r\n\r\n SizeX: number = 1;\r\n SizeY: number = 1;\r\n\r\n Components: ConduitComponent[] = [];\r\n ComponentSetID: string;\r\n\r\n getComponentSet(viewModel: ConduitViewModel): ConduitComponentSet {\r\n return viewModel.ComponentSetById[this.ComponentSetID];\r\n }\r\n\r\n componentBounds: THREE.Box3;\r\n\r\n readonly ComponentGroup: string;\r\n readonly ViewLayer: string;\r\n\r\n get isSelected() {\r\n return this.Components.some(c => c.isSelected);\r\n }\r\n\r\n set isSelected(v: boolean) {\r\n this.Components.forEach(c => {\r\n c.isSelected = v;\r\n });\r\n }\r\n\r\n get isHovered() {\r\n return this.Components.some(c => c.isHovered);\r\n }\r\n\r\n set isHovered(v: boolean) {\r\n if (!v) {\r\n this.Components.forEach(c => {\r\n c.isHovered = false;\r\n });\r\n }\r\n }\r\n\r\n get isHidden() {\r\n return this.Components.some(c => c.isHidden);\r\n }\r\n\r\n set isHidden(v: boolean) {\r\n this.Components.forEach(c => {\r\n c.isHidden = v;\r\n });\r\n }\r\n\r\n private _idString: string = null;\r\n\r\n get IdString() {\r\n return this._idString;\r\n }\r\n\r\n set IdString(v: string) {\r\n if (this._isDisposed || !v)\r\n return;\r\n if (this._idString !== v) {\r\n var instances = this.getObjectHolder().conduitObjects,\r\n oldId = this._idString;\r\n if (oldId && instances[oldId]) {\r\n delete instances[oldId];\r\n this._idString = null;\r\n }\r\n if (v) {\r\n var existing = instances[v];\r\n if (existing && existing !== this)\r\n existing.dispose();\r\n this._idString = v;\r\n instances[v] = this;\r\n }\r\n }\r\n }\r\n\r\n pointOffset = new THREE.Vector3();\r\n\r\n constructor(id?: string, compSetId?: string, data?: SolarProTool.IConduitObject) {\r\n super();\r\n this.IdString = id || spt.Utils.GenerateGuid();\r\n this.ComponentSetID = compSetId || spt.Utils.GenerateGuid();\r\n\r\n ko.track(this, [\"Components\"]);\r\n\r\n var subscriptions = this._subscriptions;\r\n\r\n subscriptions.push(ko.getObservable(this, \"Components\").subscribe((changes: { value: ConduitComponent, status: string }[]) => {\r\n //var subscriptions = this._subscriptions;\r\n changes.forEach((change) => {\r\n var v = change.value;\r\n if (v) {\r\n switch (change.status) {\r\n case \"deleted\":\r\n v.ConduitObject = null;\r\n this.remove(v);\r\n break;\r\n case \"added\":\r\n v.ConduitObject = this;\r\n if (!v.isBuild)\r\n v.buildMesh();\r\n //v.updateMatrix();\r\n this.add(v);\r\n break;\r\n }\r\n }\r\n\r\n });\r\n }, null, \"arrayChange\"));\r\n\r\n var bounds = new THREE.Box3(),\r\n bd = new THREE.Box3();\r\n\r\n ko.defineProperty(this, \"componentBounds\", () => {\r\n bounds.makeEmpty();\r\n this.Components.forEach(c => {\r\n if (!c.isBuild)\r\n c.buildMesh();\r\n\r\n var b = c.getBounds(bd);\r\n bounds.expandByPoint(b.min).expandByPoint(b.max);\r\n });\r\n return bounds;\r\n });\r\n\r\n this.getObjectHolder().conduitObjects[id] = this;\r\n\r\n if (data)\r\n this.setData(data);\r\n\r\n ko.defineProperty(this, \"ComponentGroup\", () => {\r\n return this.Components.length ? this.Components[0].ComponentGroup : null;\r\n });\r\n\r\n ko.defineProperty(this, \"ViewLayer\", () => {\r\n return this.Components.length ? this.Components[0].ViewLayer : null;\r\n });\r\n }\r\n\r\n getPointOffset(): THREE.Vector3 {\r\n return this.pointOffset;\r\n }\r\n\r\n getObjectHolder(): ConduitObjectHolder {\r\n return LS.Client3DEditor.Controller.Current.conduitObjectHolder;\r\n }\r\n\r\n intersecsBox(searchBox: THREE.Box3): boolean {\r\n var bounds = this.getBounds();\r\n if (!this._isDisposed && this.visible && bounds && !bounds.isEmpty() && bounds.intersectsBox(searchBox) && this.Components.some(c => c.intersecsBox(searchBox))) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n getClosestPoint(p: THREE.Vector3, thresholdSq: number): IObjectIntersection {\r\n var searchBox = this._box1.makeEmpty().expandByPoint(p).expandByScalar(Math.sqrt(thresholdSq) + 1),\r\n bounds = this.getBounds();\r\n\r\n if (!this._isDisposed && this.visible && bounds && !bounds.isEmpty() && bounds.intersectsBox(searchBox)) {\r\n var res = this.Components.reduce((closest, comp) => {\r\n var o = comp.getClosestPoint(p, thresholdSq);\r\n return o && (!closest || closest.distSq > o.distSq) ? o : closest;\r\n }, null as IObjectIntersection);\r\n\r\n return res;\r\n\r\n //return res ? {\r\n // o: this,\r\n // p: res.p,\r\n // distSq: res.distSq,\r\n // l: res.l,\r\n // idx: res.idx,\r\n // component: res.o\r\n //} : null;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n getClosestEndPositionToRay(ray: THREE.Ray, thresholdSq: number): IObjectIntersection {\r\n var threshold = Math.sqrt(thresholdSq),\r\n bounds = this._box1.copy(this.getBounds()).expandByScalar(threshold + 1);\r\n\r\n if (!ray.intersectsBox(bounds))\r\n return null;\r\n\r\n var res = this.Components.reduce((closest, comp) => {\r\n var o = comp.getClosestEndPositionToRay(ray, threshold);\r\n return o && (!closest || closest.distSq > o.distSq) ? o : closest;\r\n }, null as IObjectIntersection);\r\n\r\n return res;\r\n }\r\n\r\n getClosestPointToRay(ray: THREE.Ray, thresholdSq: number): IObjectIntersection {\r\n var threshold = Math.sqrt(thresholdSq),\r\n bounds = this._box1.copy(this.getBounds()).expandByScalar(threshold + 1);\r\n\r\n if (!ray.intersectsBox(bounds))\r\n return null;\r\n\r\n var res = this.Components.reduce((closest, comp) => {\r\n var o = comp.getClosestPointToRay(ray, threshold);\r\n return o && (!closest || closest.distSq > o.distSq) ? o : closest;\r\n }, null as IObjectIntersection);\r\n\r\n return res;\r\n }\r\n\r\n getClosestCenterToRay(ray: THREE.Ray, threshold: number): IObjectIntersection {\r\n var bounds = this._box1.copy(this.getBounds()).expandByScalar(threshold + 1);\r\n if (!ray.intersectsBox(bounds))\r\n return null;\r\n\r\n var res = this.Components.reduce((closest, comp) => {\r\n var o = comp.getClosestCenterToRay(ray, threshold);\r\n return o && (!closest || closest.distSq > o.distSq) ? o : closest;\r\n }, null as IObjectIntersection);\r\n\r\n return res;\r\n\r\n //return res ? {\r\n // o: this,\r\n // p: res.p,\r\n // distSq: res.distSq,\r\n // l: res.l,\r\n // idx: res.idx,\r\n // component: res.o\r\n //} : null;\r\n }\r\n\r\n getClosestByRay2D(origin: THREE.Vector3, direction: THREE.Vector3) {\r\n var bounds = this._box1.copy(this.getBounds()).expandByScalar(/*Math.sqrt(thresholdSq) + */1);\r\n if (!spt.ThreeJs.utils.ray2DintersecsBox2D(origin, direction, bounds.min, bounds.max))\r\n return null;\r\n\r\n return this.Components.reduce((closest, comp) => {\r\n var o = comp.getClosestByRay2D(origin, direction);\r\n return o && (!closest || closest.distSq > o.distSq) ? o : closest;\r\n }, null as IObjectIntersection);\r\n }\r\n\r\n OnComponentChanged(): void {\r\n this._needsUpdate = true;\r\n //ko.getObservable(this, \"Components\").valueHasMutated();\r\n }\r\n\r\n OnComponentGeometryChanged(): void {\r\n ko.getObservable(this, \"Components\").valueHasMutated();\r\n }\r\n\r\n applyDrag() {\r\n this._updateDrag = true;\r\n }\r\n\r\n tryGetSnapPosition(component: ConduitComponent, viewModel: ViewModel) {\r\n //try to snap this position so that the comp is align with another open connection\r\n var conduitObjects = this.getObjectHolder().getAllConduitObjects().filter(co => co !== this && co.position.lengthSq() <= 0);\r\n\r\n if (!component.Connections.some(con => !con.connected) || !conduitObjects.length)\r\n return null;\r\n\r\n var translation = this.position,\r\n sourceConnections = component.Connections.filter(cc => !cc.connected),\r\n precision = Controller.Current.linePrecision,\r\n thresholdSq = precision * precision,\r\n compBounds = this._box1.makeEmpty(),// comp.getBounds().expandByScalar(Math.max(10, precision)),\r\n foundConnectionSelf: ConduitConnection = null,\r\n foundConnectionOther: ConduitConnection = null,\r\n dist = Number.MAX_VALUE;\r\n\r\n sourceConnections.forEach(sc => compBounds.expandByPoint(sc.getGlobalPosition().add(translation)));\r\n\r\n compBounds.expandByScalar(Math.max(10, precision));\r\n\r\n for (var i = conduitObjects.length; i--;) {\r\n var co = conduitObjects[i],\r\n comps = co.getComponentByBounds(compBounds);\r\n\r\n for (var j = comps.length; j--;) {\r\n var cm = comps[j];\r\n\r\n sourceConnections.forEach(sc => {\r\n cm.Connections.forEach(con2 => {\r\n if (!con2.connected && sc.getGlobalDirection().dot(con2.getGlobalDirection()) < -0.99 && sc.getGlobalPosition().add(translation).distanceToSquared(con2.getGlobalPosition()) < thresholdSq) {\r\n var d = sc.getGlobalPosition().add(translation).distanceToSquared(con2.getGlobalPosition());\r\n if (d < dist) {\r\n dist = d;\r\n foundConnectionSelf = sc;\r\n foundConnectionOther = con2;\r\n }\r\n }\r\n });\r\n });\r\n }\r\n }\r\n\r\n if (foundConnectionOther != null) {\r\n var tr = foundConnectionOther.getGlobalPosition().sub(foundConnectionSelf.getGlobalPosition().add(translation));\r\n if (tr.lengthSq() > 0) {\r\n //this.position.add(tr);\r\n return tr;\r\n }\r\n }\r\n\r\n return null;\r\n //connections.some(con => con.canConnect())\r\n }\r\n\r\n moveBy(v: THREE.Vector3) {\r\n //buffer translation for one frame\r\n this._vt.copy(v);\r\n this._updateMove = true;\r\n }\r\n\r\n applyObjectPosition() {\r\n if (this.position.lengthSq() > 0) {\r\n var v = this.position.clone();\r\n this.position.set(0, 0, 0);\r\n\r\n this.Components.forEach(c => {\r\n c.applyTranslation(v);\r\n c._needsUpdate = true;\r\n c.update();\r\n });\r\n this.OnComponentGeometryChanged();\r\n this.save();\r\n this.getObjectHolder().checkForConnectedGroups();\r\n\r\n }\r\n }\r\n\r\n update(): void {\r\n if (this._isDisposed)\r\n return;\r\n\r\n if (this._updateDrag) {\r\n this._updateDrag = false;\r\n\r\n var curComps = this.Components,\r\n viewModel = Controller.Current.viewModel,\r\n dist = Number.MAX_VALUE,\r\n snapTranslation = this._v1.set(0, 0, 0);\r\n\r\n this.position.copy(viewModel.diffSnapPosition);\r\n\r\n //try to snap to other components while dragging\r\n for (var i = curComps.length; i--;) {\r\n var curComp = curComps[i];\r\n //if (!curComp.isSelected)\r\n // continue;\r\n var tr = this.tryGetSnapPosition(curComp, viewModel);\r\n if (tr) {\r\n var d = tr.lengthSq();\r\n if (d < dist) {\r\n dist = d;\r\n snapTranslation.copy(tr);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n\r\n this.position.add(snapTranslation);\r\n }\r\n\r\n if (this._updateMove) {\r\n this._updateMove = false;\r\n var v = this._vt;\r\n this.position.add(v);\r\n v.set(0, 0, 0);\r\n\r\n if (this._positionChanged)\r\n clearTimeout(this._positionChanged);\r\n\r\n this._positionChanged = setTimeout(() => {\r\n this._positionChanged = 0;\r\n this.getObjectHolder().applyObjectPositions();\r\n }, 500) as any;\r\n }\r\n\r\n if (!this._needsUpdate)\r\n return;\r\n\r\n this._needsUpdate = false;\r\n\r\n this.Components.forEach(c => c.update());\r\n\r\n }\r\n\r\n getById(id: string): ConduitComponent {\r\n if (!id)\r\n return null;\r\n var mObjs = this.children;\r\n for (var i = mObjs.length; i--;) {\r\n var mObj = mObjs[i] as ConduitComponent;\r\n if (mObj.IdString === id)\r\n return mObj;\r\n }\r\n return null;\r\n }\r\n\r\n dispose(): void {\r\n if (!this._isDisposed) {\r\n this._isDisposed = true;\r\n this._subscriptions.splice(0, this._subscriptions.length).forEach(sub => {\r\n sub.dispose();\r\n });\r\n this.Components.splice(0, this.Components.length).forEach(c => c.dispose());\r\n //this.clear();\r\n spt.ThreeJs.utils.disposeObject3D(this, true, true, false);\r\n var instances = this.getObjectHolder().conduitObjects;\r\n if (this._idString && instances[this._idString])\r\n delete instances[this._idString];\r\n }\r\n }\r\n\r\n getBounds(): THREE.Box3 {\r\n return this.componentBounds;\r\n }\r\n\r\n getComponentByBounds(searchBounds: THREE.Box3) {\r\n return this.Components.filter(comp => comp.getBounds().intersectsBox(searchBounds));\r\n }\r\n\r\n intersecsTestVolume(testVolume: spt.ThreeJs.utils.TestVolume, linePrecision: number): boolean {\r\n\r\n var matrixWorld = this.matrixWorld,\r\n worldBounds = this._box1.copy(this.getBounds()).applyMatrix4(matrixWorld).expandByScalar(linePrecision);\r\n\r\n if (!testVolume.testBoxForSeparationAxis(worldBounds))\r\n return this.Components.some(c => c.intersecsTestVolume(testVolume, linePrecision));\r\n\r\n return false;\r\n }\r\n\r\n getComponentsByTestVolume(testVolume: spt.ThreeJs.utils.TestVolume, linePrecision: number): ConduitComponent[] {\r\n\r\n var matrixWorld = this.matrixWorld,\r\n worldBounds = this._box1.copy(this.getBounds()).applyMatrix4(matrixWorld).expandByScalar(linePrecision);\r\n\r\n if (!testVolume.testBoxForSeparationAxis(worldBounds))\r\n return this.Components.filter(c => c.intersecsTestVolume(testVolume, linePrecision));\r\n\r\n return [];\r\n }\r\n\r\n tryConnect(component: ConduitComponent, toleranceSq?: number) {\r\n //if (component.ConduitObject)\r\n // return false;\r\n\r\n var comps = this.getComponentByBounds(component.getBounds().expandByScalar(10));\r\n for (var i = comps.length; i--;) {\r\n var comp = comps[i];\r\n if (comp.tryConnect(component, toleranceSq)) {\r\n this.Components.push(component);\r\n this.updateConnections(component);\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n tryConnectObject(otherObject: ConduitObject, toleranceSq?: number) {\r\n if (!otherObject || this === otherObject || (otherObject.ComponentSetID && (this.ComponentSetID !== otherObject.ComponentSetID)))\r\n return false;\r\n\r\n var otherComps = otherObject.Components;\r\n\r\n for (var i = otherComps.length; i--;) {\r\n var otherComp = otherComps[i],\r\n comps = this.getComponentByBounds(otherComp.getBounds().expandByScalar(10));\r\n for (var j = comps.length; j--;) {\r\n var comp = comps[j];\r\n if (comp.tryConnect(otherComp, toleranceSq)) {\r\n\r\n otherComps = otherObject.Components.slice();\r\n otherObject.Components.removeAll();\r\n ko.tasks.runEarly();\r\n otherComps.forEach(c => { this.Components.push(c); });\r\n otherObject.save();\r\n this.save();\r\n\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n updateConnections(component: ConduitComponent) {\r\n var components = this.getComponentByBounds(component.getBounds().expandByScalar(10));\r\n for (var i = 0, l = components.length; i < l; i++) {\r\n var comp = components[i];\r\n if (comp !== component && (component.tryConnect(comp) || comp.tryConnect(component)))\r\n continue;\r\n }\r\n }\r\n\r\n updateAllConnections() {\r\n this.Components.forEach(c => c.buildMesh());\r\n this.Components.forEach(this.updateConnections.bind(this));\r\n }\r\n\r\n getClosestEntryPoint(point: THREE.Vector3, target: THREE.Vector3): ConduitComponent {\r\n var len = Number.MAX_VALUE,\r\n tp = this._v1,\r\n comps = this.Components,\r\n res: ConduitComponent = null;\r\n\r\n for (var i = comps.length; i--;) {\r\n var comp = comps[i];\r\n comp.getClosestEntryPoint(point, tp);\r\n var l = tp.distanceToSquared(point);\r\n if (l < len) {\r\n len = l;\r\n target.copy(tp);\r\n res = comp;\r\n }\r\n }\r\n\r\n return res;\r\n }\r\n\r\n getRoute(compFrom: ConduitComponent, compTo: ConduitComponent, start: THREE.Vector3, end: THREE.Vector3) {\r\n var comps = this.searchRoute(compFrom, compTo);\r\n\r\n var route = [start];\r\n\r\n for (var i = comps.length; i--;) {\r\n var comp = comps[i];\r\n route.push(comp.position);\r\n }\r\n\r\n route.push(end);\r\n\r\n return route;\r\n }\r\n\r\n private searchRoute(startComp: ConduitComponent, endComp: ConduitComponent) {\r\n\r\n var start = new ComponentNode(startComp);\r\n\r\n if (startComp === endComp)\r\n return [] as ConduitComponent[];\r\n\r\n var end = new ComponentNode(endComp);\r\n\r\n var wm = new ComponentNodeMap();//new WeakMap();\r\n\r\n wm.set(startComp, start);\r\n wm.set(endComp, end);\r\n\r\n start.MinDistToStart = 0;\r\n\r\n start.DistanceToEnd = startComp.position.distanceTo(endComp.position);\r\n\r\n var hashSet = [start];\r\n\r\n do {\r\n hashSet.sort((a, b) => b.DistanceToEnd - a.DistanceToEnd);\r\n var node = hashSet.pop();\r\n\r\n if (node === end) {\r\n node.Visited = true;\r\n break;\r\n }\r\n var connections = node.Current.Connections;\r\n\r\n for (var i = connections.length; i--;) {\r\n var edge = connections[i];\r\n if (!edge.connected)\r\n continue;\r\n var nextComp = edge.connected.parent;\r\n var nextNode = wm.get(nextComp);\r\n if (!nextNode) {\r\n nextNode = new ComponentNode(nextComp);\r\n wm.set(nextComp, nextNode);\r\n }\r\n var edgeDist = node.Current.position.distanceTo(nextComp.position);\r\n var nextNodeCost = node.MinDistToStart + edgeDist;\r\n if (nextNode.MinDistToStart > nextNodeCost) {\r\n nextNode.MinDistToStart = nextNodeCost;\r\n nextNode.NearestToStart = node;\r\n if (!nextNode.Visited && hashSet.indexOf(nextNode) === -1) {\r\n nextNode.DistanceToEnd = nextComp.position.distanceTo(endComp.position);\r\n hashSet.push(nextNode);\r\n }\r\n }\r\n }\r\n\r\n node.Visited = true;\r\n } while (hashSet.length);\r\n\r\n if (!end.Visited)\r\n return [] as ConduitComponent[];\r\n\r\n var path = [end],\r\n nd = end;\r\n\r\n while (nd.NearestToStart) {\r\n nd = nd.NearestToStart;\r\n path.push(nd);\r\n }\r\n\r\n //path.reverse();\r\n\r\n return path.map(n => n.Current);\r\n }\r\n\r\n setData(data: SolarProTool.IConduitObject) {\r\n if (!data)\r\n return this;\r\n\r\n this.IdString = data.IdString;\r\n this.ComponentSetID = data.ComponentSetID;\r\n\r\n Object.keys(data).forEach(k => {\r\n if (k !== \"Components\" && !k.startsWith(\"_\"))\r\n this[k] = data[k];\r\n });\r\n\r\n if (data.Components && data.Components.length) {\r\n if (this.Components.length) {\r\n var comps = this.Components.slice();\r\n comps.forEach(comp => comp.removeInstance(true));\r\n }\r\n data.Components.forEach(comp => {\r\n var component = new ConduitComponent(comp.IdString, comp);\r\n this.Components.push(component);\r\n });\r\n }\r\n\r\n this._needsUpdate = true;\r\n\r\n return this;\r\n }\r\n\r\n exportData(noComponents?: boolean): SolarProTool.IConduitObject {\r\n this.updateMatrix();\r\n\r\n return {\r\n IdString: this.IdString || spt.Utils.GuidEmpty(),\r\n ComponentSetID: this.ComponentSetID || spt.Utils.GuidEmpty(),\r\n Components: !noComponents && !this._isDisposed && this.Components ? this.Components.map(c => c.exportData()) : null,\r\n IsActive: !this._isDisposed, // System.Boolean\r\n IsDeleted: !!this._isDisposed, // System.Boolean\r\n ClientOptions: 0, // enum SPTSettingInterface.Client3DObectOptions\r\n DrawOptions: 0, // enum SPTSettingInterface.DrawOptionsEnum\r\n ErrorCode: 0, // enum SPTEnums.ErrorCodeEnum\r\n InstanceColor: 0, // System.Int32\r\n IsInErrorState: false, // System.Boolean\r\n X: 0, // System.Double\r\n Y: 0, // System.Double\r\n Z: 0, // System.Double\r\n SizeX: 0, // System.Double\r\n SizeY: 0, // System.Double\r\n Width: 0, // System.Double\r\n Height: 0, // System.Double\r\n IconInsertIndex: 0 // System.Int32\r\n };\r\n }\r\n\r\n _revData: SolarProTool.IConduitObject;\r\n\r\n save() {\r\n this.getObjectHolder().saveConduitObject(this);\r\n }\r\n }\r\n\r\n class ComponentNode {\r\n\r\n constructor(current: ConduitComponent) {\r\n this.Current = current;\r\n }\r\n\r\n MinDistToStart = Number.MAX_VALUE;\r\n Current: ConduitComponent;\r\n NearestToStart: ComponentNode = null;\r\n Visited = false;\r\n DistanceToEnd = 0;\r\n }\r\n\r\n class ComponentNodeMap {\r\n private map: { [id: string]: ComponentNode } = {};\r\n\r\n set(co: ConduitComponent, n: ComponentNode) {\r\n this.map[co.id] = n;\r\n }\r\n\r\n get(co: ConduitComponent) {\r\n return this.map[co.id];\r\n }\r\n }\r\n\r\n export class ConduitObjectHolder extends GenericObjectHolder {\r\n\r\n conduitObjects: { [id: string]: ConduitObject } = {};\r\n private _saveObjects: Set = new Set();\r\n private _checkGroups = false;\r\n\r\n private _showPolylines: boolean = false;\r\n\r\n get showPolylines() {\r\n return this._showPolylines;\r\n }\r\n\r\n set showPolylines(v: boolean) {\r\n this._showPolylines = v;\r\n\r\n var conduitObjects = this.getAllConduitObjects();\r\n for (var i = conduitObjects.length; i--;) {\r\n var comps = conduitObjects[i].Components;\r\n for (var j = comps.length; j--;) {\r\n var comp = comps[j];\r\n comp.showPolylines = v;\r\n }\r\n }\r\n\r\n Controller.Current.viewModel.tools.conduitTool.componentPoolForeach(comp => {\r\n comp.showPolylines = v;\r\n });\r\n }\r\n\r\n private _showCables: boolean = false;\r\n\r\n get showCables() {\r\n return this._showCables;\r\n }\r\n\r\n set showCables(v: boolean) {\r\n this._showCables = v;\r\n\r\n this.updateCables();\r\n }\r\n\r\n private _v1 = new THREE.Vector3();\r\n private _v2 = new THREE.Vector3();\r\n private _v3 = new THREE.Vector3();\r\n private _v4 = new THREE.Vector3();\r\n\r\n hoverObject: ConduitComponent = null;\r\n\r\n setHoverObject(o: IObjectIntersection) {\r\n this.setHoverComponent(o && o.o);\r\n }\r\n\r\n setHoverComponent(c: ConduitComponent) {\r\n if (this.hoverObject) {\r\n this.hoverObject.isHovered = false;\r\n this.hoverObject = null;\r\n }\r\n if (c) {\r\n c.isHovered = true;\r\n this.hoverObject = c;\r\n }\r\n }\r\n\r\n insertComponent(component: ConduitComponent, compSetId: string) {\r\n if (!component || !compSetId)\r\n return;\r\n if (!component.isBuild)\r\n component.buildMesh();\r\n\r\n component.updateMatrix();\r\n\r\n if (component.ConduitObject) {\r\n component.disconnectAll();\r\n component.ConduitObject.Components.remove(component);\r\n ko.tasks.runEarly();\r\n }\r\n\r\n var conduitObjects = this.getAllConduitObjects();\r\n\r\n for (var i = conduitObjects.length; i--;) {\r\n var co = conduitObjects[i];\r\n if (co.ComponentSetID === compSetId && co.tryConnect(component)) {\r\n co.save();\r\n return;\r\n }\r\n }\r\n\r\n var conduitObject = this.addNewConduitObject(spt.Utils.GenerateGuid(), compSetId);\r\n conduitObject.Components.push(component);\r\n conduitObject.save();\r\n }\r\n\r\n addNewConduitObject(id: string, compSetId?: string, data?: SolarProTool.IConduitObject): ConduitObject {\r\n var so = new ConduitObject(id, compSetId, data);\r\n this.add(so);\r\n return so;\r\n }\r\n\r\n getShortestCableConnection(from: THREE.Vector3, to: THREE.Vector3) {\r\n var result: THREE.Vector3[] = null;\r\n\r\n var conduitObjects = this.getAllConduitObjects(),\r\n s = this._v1,\r\n e = this._v2,\r\n compStart: ConduitComponent = null,\r\n compEnd: ConduitComponent = null,\r\n start = this._v3.copy(from),\r\n end = this._v4.copy(to),\r\n len = Math.abs(to.x - from.x) + Math.abs(to.y - from.y) + 1000;\r\n\r\n for (var i = conduitObjects.length; i--;) {\r\n var co = conduitObjects[i];\r\n\r\n var comp1 = co.getClosestEntryPoint(from, s);\r\n var comp2 = co.getClosestEntryPoint(to, e);\r\n\r\n var sLen = Math.abs(s.x - from.x) + Math.abs(s.y - from.y);\r\n var eLen = Math.abs(e.x - to.x) + Math.abs(e.y - to.y);\r\n\r\n var l = sLen + eLen;\r\n if (l < len) {\r\n len = l;\r\n compStart = comp1;\r\n compEnd = comp2;\r\n start.copy(s);\r\n end.copy(e);\r\n }\r\n }\r\n\r\n if (compStart)\r\n result = compStart.ConduitObject.getRoute(compStart, compEnd, start, end);\r\n\r\n if (!result)\r\n result = [start, end];\r\n\r\n if (result[0].distanceToSquared(from) > 0)\r\n result.unshift(from);\r\n\r\n if (result[result.length - 1].distanceToSquared(to) > 0)\r\n result.push(to);\r\n\r\n return result;\r\n }\r\n\r\n updateCables() {\r\n //LS.Electric.InvertersModel\r\n var controller = Controller.Current,\r\n viewModel = controller.viewModel;\r\n\r\n var lineSegmentsHelper = controller.lineSegmentsHelper;\r\n\r\n if (lineSegmentsHelper.hasSegments())\r\n lineSegmentsHelper.clear();\r\n\r\n if (!this.showCables)\r\n return;\r\n\r\n var stringObjects = controller.stringObjectHolder.getAllStringObjects(),\r\n stringingTool = viewModel.tools.stringingTool;\r\n\r\n for (var i = stringObjects.length; i--;) {\r\n var stringObject = stringObjects[i],\r\n mso = stringObject.getModulesStringObject(),\r\n diffpoint = stringObject.getDiffusionPointObject();\r\n\r\n if (!diffpoint || !mso || !stringObject.Joints.length)\r\n continue;\r\n\r\n var dp = stringingTool.getPositionFromClientObjectInstance(diffpoint),\r\n color = stringObject.stringColor1,\r\n joint = stringObject.Joints[0],\r\n jp = joint.position,\r\n f2 = stringObject.Joints.length <= 1 ? 100 : 200,\r\n f1 = f2 / 2,\r\n xOff = (Math.abs(jp.y) * 0.05) % f2 - f1,\r\n yOff = (Math.abs(jp.x) * 0.05) % f2 - f1,\r\n zOff = (xOff + yOff + f2) * 0.5,\r\n jz = jp.z + f1 + zOff,\r\n path = this.getShortestCableConnection(dp, jp);\r\n\r\n lineSegmentsHelper.addPolyline(path.map(p => new THREE.Vector3(p.x + xOff, p.y + yOff, jz)), color, true);\r\n\r\n if (stringObject.Joints.length > 2) {\r\n joint = stringObject.Joints[stringObject.Joints.length - 1];\r\n\r\n path = this.getShortestCableConnection(dp, joint.position);\r\n\r\n lineSegmentsHelper.addPolyline(path.map(p => new THREE.Vector3(p.x + xOff, p.y + yOff, jz)), color, true);\r\n }\r\n }\r\n\r\n }\r\n\r\n getAllConduitObjects() {\r\n return this.children as ConduitObject[];\r\n }\r\n\r\n getClosestByPosition(p: THREE.Vector3, tolerance: number): IObjectIntersection {\r\n var sos = this.getByBox(new THREE.Box3().expandByPoint(p).expandByScalar(tolerance)),\r\n minDist = Number.MAX_VALUE,\r\n thresholdSq = tolerance * tolerance,\r\n result = null as IObjectIntersection;\r\n\r\n sos.forEach(so => {\r\n var cp = so.getClosestPoint(p, thresholdSq);\r\n if (cp && cp.distSq < thresholdSq && cp.distSq < minDist) {\r\n minDist = cp.distSq;\r\n result = cp;\r\n }\r\n\r\n });\r\n\r\n return result;\r\n }\r\n\r\n getByBox(searchBox: THREE.Box3): ConduitComponent[] {\r\n var result: ConduitComponent[] = [],\r\n cos = this.getAllConduitObjects();\r\n if (cos.length) {\r\n cos.filter((mObj: ConduitObject) => mObj.intersecsBox(searchBox)).forEach((mObj: ConduitObject) => {\r\n result.push.apply(result, mObj.getComponentByBounds(searchBox));\r\n });\r\n }\r\n return result;\r\n }\r\n\r\n getEndPositionByRaycaster(raycaster: THREE.Raycaster, tolerance?: number): IObjectIntersection {\r\n var ray = raycaster.ray;\r\n\r\n var thresholdSq = Math.pow(tolerance || raycaster.params.Line.threshold, 2);\r\n\r\n var sos = this.getAllConduitObjects();\r\n\r\n var result = null as IObjectIntersection;\r\n var minDist = Number.MAX_VALUE;\r\n\r\n for (var i = sos.length; i--;) {\r\n var so = sos[i] as ConduitObject;\r\n\r\n var cp = so.getClosestEndPositionToRay(ray, thresholdSq);\r\n if (cp && cp.distSq < thresholdSq && cp.distSq < minDist) {\r\n minDist = cp.distSq;\r\n result = cp;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n getByRaycaster(raycaster: THREE.Raycaster, tolerance?: number): IObjectIntersection {\r\n var ray = raycaster.ray;\r\n\r\n var thresholdSq = Math.pow(tolerance || raycaster.params.Line.threshold, 2);\r\n\r\n var sos = this.getAllConduitObjects();\r\n\r\n var result = null as IObjectIntersection;\r\n var minDist = Number.MAX_VALUE;\r\n\r\n for (var i = sos.length; i--;) {\r\n var so = sos[i] as ConduitObject;\r\n\r\n var cp = so.getClosestPointToRay(ray, thresholdSq);\r\n if (cp && cp.distSq < thresholdSq && cp.distSq < minDist) {\r\n minDist = cp.distSq;\r\n result = cp;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n getByTestVolume(testVolume: spt.ThreeJs.utils.TestVolume): ConduitComponent[] {\r\n var controller = Controller.Current,\r\n linePrecision = controller.linePrecision,\r\n result: ConduitComponent[] = [],\r\n cos = this.getAllConduitObjects();\r\n\r\n if (cos.length) {\r\n cos.forEach((mObj: ConduitObject) => {\r\n result.push.apply(result, mObj.getComponentsByTestVolume(testVolume, linePrecision));\r\n });\r\n }\r\n return result;\r\n }\r\n\r\n getComponentByRaycaster(raycaster: THREE.Raycaster, tolerance?: number): ConduitComponent {\r\n var o = this.getByRaycaster(raycaster, tolerance) as IObjectIntersection;\r\n return o && o.o;\r\n }\r\n\r\n closestCenterByRaycaster(raycaster: THREE.Raycaster, tolerance?: number): IObjectIntersection {\r\n var ray = raycaster.ray;\r\n\r\n var threshold = tolerance || raycaster.params.Line.threshold;\r\n var thresholdSq = threshold * threshold;\r\n\r\n var sos = this.getAllConduitObjects();\r\n\r\n var result = null as IObjectIntersection;\r\n var minDist = Number.MAX_VALUE;\r\n\r\n for (var i = sos.length; i--;) {\r\n var so = sos[i];\r\n\r\n var cp = so.getClosestCenterToRay(ray, threshold);\r\n if (cp && cp.distSq < thresholdSq && cp.distSq < minDist) {\r\n minDist = cp.distSq;\r\n result = cp;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n closestCenterByRay2D(origin: THREE.Vector3, direction: THREE.Vector3): IObjectIntersection {\r\n var sos = this.getAllConduitObjects();\r\n\r\n var result = null as IObjectIntersection;\r\n var minDist = Number.MAX_VALUE;\r\n\r\n for (var i = sos.length; i--;) {\r\n var so = sos[i];\r\n\r\n var cp = so.getClosestByRay2D(origin, direction);\r\n if (cp && cp.distSq < minDist) {\r\n minDist = cp.distSq;\r\n result = cp;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n applyObjectPositions() {\r\n var cos = this.getAllConduitObjects();\r\n\r\n for (var i = cos.length; i--;) {\r\n var co = cos[i];\r\n if (co.position.lengthSq() > 0) {\r\n co.applyObjectPosition();\r\n }\r\n }\r\n\r\n Controller.Current.viewModel.selectionUiNeedsUpdate = true;\r\n }\r\n\r\n setConduitObjects(conduitObjects: SolarProTool.IConduitObject[]) {\r\n this.clear();\r\n\r\n if (!conduitObjects || !conduitObjects.length)\r\n return;\r\n\r\n conduitObjects.forEach(data => {\r\n var co = this.addNewConduitObject(data.IdString, data.ComponentSetID, data);\r\n co.updateAllConnections();\r\n });\r\n\r\n //update conduit rev datas\r\n this.getAllConduitObjects().forEach(co => {\r\n co._revData = co.exportData();\r\n });\r\n }\r\n \r\n checkGroups() {\r\n this._checkGroups = true;\r\n }\r\n\r\n updateObjects() {\r\n if (this._checkGroups) {\r\n this._checkGroups = false;\r\n this.checkForSeperatedGroups();\r\n this.checkForConnectedGroups();\r\n }\r\n super.updateObjects();\r\n this.updateSaveConduitObjects();\r\n }\r\n\r\n groupConnectedComponents(components: ConduitComponent[]) {\r\n\r\n var result: ConduitComponent[][] = [];\r\n\r\n if (!components.length)\r\n return result;\r\n\r\n var workset: ConduitConnection[] = components[0].Connections.slice(),\r\n rSet: ConduitComponent[] = [components[0]],\r\n comps = components.slice(1);\r\n\r\n result.push(rSet);\r\n\r\n while (comps.length > 0) {\r\n\r\n while (workset.length > 0 && comps.length) {\r\n var con = workset.splice(0, 1)[0];\r\n if (con.connected) {\r\n var comp = con.connected.parent,\r\n cIdx = comps.indexOf(comp);\r\n if (cIdx >= 0) {\r\n rSet.push(comps[cIdx]);\r\n workset.push.apply(workset, comps.splice(cIdx, 1)[0].Connections);\r\n }\r\n }\r\n }\r\n if (comps.length > 0) {\r\n rSet = [comps[0]];\r\n result.push(rSet);\r\n workset = comps.splice(0, 1)[0].Connections.slice();\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n removeObject(so: ConduitComponent, skipUpdate?: boolean) {\r\n if (!so)\r\n return;\r\n so.disconnectAll();\r\n\r\n var conduitObject = so.ConduitObject;\r\n\r\n if (conduitObject) {\r\n conduitObject.Components.remove(so);\r\n\r\n this.checkGroups();\r\n\r\n if (!skipUpdate)\r\n conduitObject.save();\r\n }\r\n\r\n so.dispose();\r\n }\r\n\r\n checkForSeperatedGroups() {\r\n var viewModel = Controller.Current.viewModel.tools.conduitTool.viewModel;\r\n\r\n //seperate groups if needed\r\n this.getAllConduitObjects().slice().forEach(conduitObject => {\r\n if (conduitObject.Components.length > 1) {\r\n var compGroups = this.groupConnectedComponents(conduitObject.Components);\r\n if (compGroups.length > 1) {\r\n var compSetId = conduitObject.ComponentSetID,\r\n separatedComps: ConduitComponent[] = [];\r\n\r\n for (var i = 1, l = compGroups.length; i < l; i++) {\r\n compGroups[i].forEach(comp => {\r\n comp.disconnectAll();\r\n conduitObject.Components.remove(comp);\r\n separatedComps.push(comp);\r\n });\r\n }\r\n\r\n ko.tasks.runEarly();\r\n\r\n separatedComps.forEach(c => {\r\n this.insertComponent(c, compSetId);\r\n });\r\n }\r\n }\r\n });\r\n }\r\n\r\n checkForConnectedGroups() {\r\n //join groups if possible\r\n var conduitObjects = this.getAllConduitObjects(),\r\n len = conduitObjects.length;\r\n\r\n for (var i = 0; i < len; i++) {\r\n var co1 = conduitObjects[i];\r\n for (var j = i + 1; j < len; j++) {\r\n var co2 = conduitObjects[j];\r\n\r\n if (co1.tryConnectObject(co2)) {\r\n this.checkForConnectedGroups();\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n\r\n removeConduitObject(o: ConduitObject) {\r\n if (!o)\r\n return;\r\n this.remove(o);\r\n o.dispose();\r\n this.saveConduitObject(o);\r\n }\r\n\r\n saveConduitObject(co: ConduitObject) {\r\n if (!co)\r\n return;\r\n if (!co.Components.length && !co._isDisposed) {\r\n this.removeConduitObject(co);\r\n return;\r\n }\r\n this._saveObjects.add(co);\r\n }\r\n\r\n updateCheckpoint(objs: ConduitObject[]) {\r\n var ids = objs.map(o => o.IdString),\r\n oldDatas = objs.map(o => {\r\n var rd = o._revData;\r\n if (!rd) {\r\n rd = o.exportData(true);\r\n rd.IsDeleted = true;\r\n rd.IsActive = false;\r\n }\r\n return rd;\r\n }),\r\n newDatas = objs.map(o => { return o._revData = o.exportData(); });\r\n \r\n Controller.Current.updateManager.dynamicUpdate(() => {\r\n var conduitObjectHolder = Controller.Current.conduitObjectHolder;\r\n\r\n for (var i = ids.length; i--;) {\r\n var id = ids[i],\r\n d = newDatas[i],\r\n co = conduitObjectHolder.conduitObjects[id] as ConduitObject;\r\n if (!co) {\r\n if (!d.IsDeleted) {\r\n co = conduitObjectHolder.addNewConduitObject(d.IdString, d.ComponentSetID, d);\r\n co.updateAllConnections();\r\n co._revData = d;\r\n }\r\n } else {\r\n if (d.IsDeleted) {\r\n conduitObjectHolder.remove(co);\r\n co.dispose();\r\n } else {\r\n co.setData(d);\r\n co.updateAllConnections();\r\n co._revData = d;\r\n }\r\n }\r\n }\r\n conduitObjectHolder._saveObjects.clear();\r\n conduitObjectHolder.SaveConduitObjects(newDatas);\r\n }, () => {\r\n var conduitObjectHolder = Controller.Current.conduitObjectHolder;\r\n\r\n for (var i = ids.length; i--;) {\r\n var id = ids[i],\r\n d = oldDatas[i],\r\n co = conduitObjectHolder.conduitObjects[id] as ConduitObject;\r\n if (!co) {\r\n if (!d.IsDeleted) {\r\n co = conduitObjectHolder.addNewConduitObject(d.IdString, d.ComponentSetID, d);\r\n co.updateAllConnections();\r\n co._revData = d;\r\n }\r\n } else {\r\n if (d.IsDeleted) {\r\n conduitObjectHolder.remove(co);\r\n co.dispose();\r\n } else {\r\n co.setData(d);\r\n co.updateAllConnections();\r\n co._revData = d;\r\n }\r\n }\r\n }\r\n conduitObjectHolder._saveObjects.clear();\r\n conduitObjectHolder.SaveConduitObjects(oldDatas);\r\n });\r\n }\r\n\r\n private updateSaveConduitObjects() {\r\n if (!this._saveObjects.size)\r\n return;\r\n var saved = this._saveObjects,\r\n objs: ConduitObject[] = [];\r\n saved.forEach(co => {\r\n objs.push(co);\r\n });\r\n saved.clear();\r\n\r\n this.updateCheckpoint(objs);\r\n this.SaveConduitObjects(objs.map(co => co._revData));\r\n }\r\n\r\n SaveConduitObjects(objs: SolarProTool.IConduitObject[]) {\r\n if (!objs || !objs.length)\r\n return;\r\n\r\n SolarProTool.Ajax(\"Areas/Electric/WebServices/ElectricServices.asmx\").Call(\"SetConduitObjects\").Data({ conduitObjects: objs }).CallBack((result) => {\r\n if (!result)\r\n console.error(\"Error on calling SetConduitObjects.\");\r\n });\r\n }\r\n }\r\n}","module LS.Client3DEditor {\r\n export enum InterferenceToolMode {\r\n draw,\r\n rect,\r\n circle,\r\n triangle,\r\n line\r\n }\r\n\r\n export class InterferenceTool extends BaseTool {\r\n\r\n mode: InterferenceToolMode = InterferenceToolMode.draw;\r\n step = 0;\r\n\r\n object: THREE.Object3D;\r\n\r\n editPoly: EditablePolygon2D = null;\r\n editHandle: EditableHandle = null;\r\n\r\n //currentBaseParentId: string = null;\r\n //startBaseParentId: string = null;\r\n\r\n //private _bd = new THREE.Box3();\r\n private _v1 = new THREE.Vector3();\r\n private _v2 = new THREE.Vector3();\r\n //private _v3 = new THREE.Vector3();\r\n //private _mat = new THREE.Matrix4();\r\n //private _ray = new THREE.Ray();\r\n\r\n onSelect(viewModel: ViewModel, params: { mode?: string }) {\r\n //var controller = Controller.Current,\r\n // interferenceObjects = viewModel.interferenceObjects;\r\n\r\n viewModel.deselectAll();\r\n\r\n this.mode = params && params.mode ? InterferenceToolMode[params.mode] : InterferenceToolMode.draw;\r\n\r\n //this.startBaseParentId = this.currentBaseParentId = viewModel.currentInstance.Id;\r\n\r\n this.reset();\r\n\r\n viewModel.currentInstance.add(this.object, true);\r\n }\r\n\r\n reset() {\r\n var editPoly = this.editPoly,\r\n editHandle = this.editHandle;\r\n\r\n this.step = 0;\r\n\r\n if (!editPoly) {\r\n var o = this.object = new THREE.Object3D();\r\n editPoly = this.editPoly = new EditablePolygon2D(new ObservablePolygon());\r\n o.add(editPoly);\r\n\r\n editHandle = this.editHandle = new EditableHandle(new ObservableVector3());\r\n o.add(editHandle);\r\n }\r\n\r\n editPoly.poly.removeAll();\r\n editPoly.clickable = false;\r\n editPoly.editable = true;\r\n\r\n editHandle.clickable = false;\r\n editHandle.draggable = false;\r\n editHandle.editable = false;\r\n editHandle.hovered = false;\r\n\r\n switch (this.mode) {\r\n case InterferenceToolMode.draw:\r\n case InterferenceToolMode.line:\r\n {\r\n editPoly.poly.push(0, 0, 0);\r\n editPoly.editOptions = EditablePolygon2D.ShowEdges;\r\n editPoly.closed = false;\r\n }\r\n break;\r\n case InterferenceToolMode.circle:\r\n case InterferenceToolMode.rect:\r\n case InterferenceToolMode.triangle:\r\n {\r\n editPoly.editOptions = EditablePolygon2D.ShowEdges | EditablePolygon2D.ShowSurface;\r\n editPoly.closed = true;\r\n }\r\n break;\r\n }\r\n\r\n //Controller.Current.viewModel.currentInstance = Controller.Current.getInstanceContext(this.startBaseParentId);\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n\r\n //this.startBaseParentId = this.currentBaseParentId = null;\r\n this.step = 0;\r\n\r\n var editPoly = this.editPoly,\r\n editHandle = this.editHandle;\r\n\r\n if (editPoly) {\r\n editPoly.poly.removeAll();\r\n editPoly.editable = false;\r\n\r\n editHandle.editable = false;\r\n }\r\n\r\n if (this.object && this.object.parent)\r\n this.object.parent.remove(this.object);\r\n\r\n //Controller.Current.viewModel.currentInstance = Controller.Current.getInstanceContext(this.startBaseParentId);\r\n }\r\n\r\n onKeyDown(viewModel: ViewModel) {\r\n if (viewModel.keyPressed(27)) { //esc\r\n viewModel.deselectTool();\r\n return true;\r\n } else if (viewModel.keyPressed(13)) { //enter\r\n var controller = Controller.Current,\r\n editPoly = this.editPoly,\r\n mode = this.mode,\r\n baseParentId = controller.viewModel.currentInstance.Id;\r\n\r\n if (mode === InterferenceToolMode.line && editPoly.poly.array.length > 2) {\r\n editPoly.poly.array.pop();\r\n editPoly.closed = false;\r\n\r\n InterferenceTool.createDefaultInterference(baseParentId, editPoly.poly, mode);\r\n this.reset();\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n onKeyUp(viewModel: ViewModel): boolean {\r\n return false;\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n console.log(\"ao onMouseMove\");\r\n\r\n var controller = Controller.Current,\r\n raycaster = controller.worldRaycaster,\r\n editPoly = this.editPoly,\r\n editHandle = this.editHandle,\r\n rp = viewModel.roofPosition,\r\n array = editPoly.poly.array;\r\n\r\n switch (this.mode) {\r\n case InterferenceToolMode.draw:\r\n case InterferenceToolMode.line: {\r\n var p = array[array.length - 1];\r\n p.x = rp.x;\r\n p.y = rp.y;\r\n if (viewModel.shiftDown && array.length > 1) {\r\n var pp = array[array.length - 2];\r\n if (Math.abs(p.x - pp.x) < Math.abs(p.y - pp.y))\r\n p.x = pp.x;\r\n else\r\n p.y = pp.y;\r\n }\r\n editHandle.hovered = !!editHandle.intersecsRaycaster(raycaster);\r\n break;\r\n }\r\n case InterferenceToolMode.circle: {\r\n var center = this._v1;\r\n if (!array.length)\r\n center.set(rp.x, rp.y, 0);\r\n else\r\n editPoly.poly.setAsCircle(center, this._v2.set(rp.x, rp.y, 0));\r\n break;\r\n }\r\n case InterferenceToolMode.rect: {\r\n var corner1 = this._v1;\r\n if (!array.length)\r\n corner1.set(rp.x, rp.y, 0);\r\n else\r\n editPoly.poly.setAsRectangle(corner1, this._v2.set(rp.x, rp.y, 0));\r\n break;\r\n }\r\n case InterferenceToolMode.triangle: {\r\n var corner1 = this._v1;\r\n if (!array.length)\r\n corner1.set(rp.x, rp.y, 0);\r\n else\r\n editPoly.poly.setAsTriangle(corner1, this._v2.set(rp.x, rp.y, 0));\r\n break;\r\n }\r\n }\r\n\r\n //interferenceObjects.forEach(interferenceObject => {\r\n // var s = interferenceObject.intersectRaycaster(raycaster);\r\n // if (s) {\r\n // var d = s.point.distanceToSquared(raycaster.ray.origin);\r\n // if (d < dist) {\r\n // dist = d;\r\n // hoverObject = interferenceObject;\r\n // }\r\n // }\r\n //});\r\n\r\n //if (this.hoverObject && (!hoverObject || this.hoverObject !== hoverObject)) {\r\n // this.hoverObject.isHovered = false;\r\n //}\r\n\r\n //this.hoverObject = hoverObject;\r\n\r\n //if (hoverObject)\r\n // hoverObject.isHovered = true;\r\n\r\n return false;\r\n }\r\n\r\n onMouseDown(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n raycaster = controller.worldRaycaster,\r\n editPoly = this.editPoly,\r\n editHandle = this.editHandle,\r\n baseParentId = controller.viewModel.currentInstance.Id,\r\n rp = viewModel.roofPosition,\r\n mode = this.mode;\r\n\r\n switch (mode) {\r\n case InterferenceToolMode.draw:\r\n case InterferenceToolMode.line: {\r\n if (this.step === 0)\r\n this.makePolygonPoint(viewModel);\r\n break;\r\n }\r\n case InterferenceToolMode.circle: {\r\n var center = this._v1;\r\n if (!editPoly.poly.array.length) {\r\n rp = viewModel.roofPosition;\r\n center.copy(rp);\r\n editPoly.poly.setAsCircle(center, center);\r\n } else {\r\n //editPoly.poly.setAsCircle(center, this._v2);\r\n //InterferenceTool.createDefaultInterference(baseParentId, editPoly.poly, mode);\r\n //this.reset();\r\n }\r\n break;\r\n }\r\n case InterferenceToolMode.rect: {\r\n var corner1 = this._v1;\r\n if (!editPoly.poly.array.length) {\r\n rp = viewModel.roofPosition;\r\n corner1.copy(rp);\r\n editPoly.poly.setAsRectangle(corner1, corner1);\r\n } else {\r\n editPoly.poly.setAsRectangle(corner1, this._v2);\r\n InterferenceTool.createDefaultInterference(baseParentId, editPoly.poly, mode);\r\n this.reset();\r\n }\r\n break;\r\n }\r\n case InterferenceToolMode.triangle: {\r\n var corner1 = this._v1;\r\n if (!editPoly.poly.array.length) {\r\n rp = viewModel.roofPosition;\r\n corner1.copy(rp);\r\n editPoly.poly.setAsTriangle(corner1, corner1);\r\n } else {\r\n editPoly.poly.setAsTriangle(corner1, this._v2);\r\n InterferenceTool.createDefaultInterference(baseParentId, editPoly.poly, mode);\r\n this.reset();\r\n }\r\n break;\r\n }\r\n }\r\n\r\n //if (hoverObject) {\r\n // var s = hoverObject.intersectRaycaster(raycaster);\r\n // if (s)\r\n // hoverObject.selected = s;\r\n //} else {\r\n // interferenceObjects.forEach(o => { o.selected = null; });\r\n //}\r\n\r\n return false;\r\n }\r\n\r\n onMouseUp(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n raycaster = controller.worldRaycaster,\r\n editPoly = this.editPoly,\r\n editHandle = this.editHandle,\r\n baseParentId = controller.viewModel.currentInstance.Id,\r\n rp = viewModel.roofPosition,\r\n mode = this.mode;\r\n\r\n switch (mode) {\r\n case InterferenceToolMode.draw:\r\n case InterferenceToolMode.line: {\r\n if (this.step === 0) {\r\n this.step = 1;\r\n // if moved then make point\r\n let startPoint = editPoly.poly.array[0];\r\n let currentPoint = viewModel.roofPosition;\r\n // 10mm\r\n if (startPoint.distanceTo(currentPoint) >= 10)\r\n this.makePolygonPoint(viewModel);\r\n }\r\n else\r\n this.makePolygonPoint(viewModel);\r\n break;\r\n }\r\n case InterferenceToolMode.circle: {\r\n var center = this._v1;\r\n this._v2.set(rp.x, rp.y, 0);\r\n if (editPoly.poly.array.length) {\r\n // 10mm\r\n if (center.distanceTo(this._v2) >= 10) {\r\n editPoly.poly.setAsCircle(center, this._v2);\r\n InterferenceTool.createDefaultInterference(baseParentId, editPoly.poly, mode);\r\n }\r\n this.reset();\r\n }\r\n break;\r\n }\r\n case InterferenceToolMode.rect: {\r\n var corner1 = this._v1;\r\n this._v2.set(rp.x, rp.y, 0);\r\n if (editPoly.poly.array.length) {\r\n // 10mm\r\n if (corner1.distanceTo(this._v2) >= 10) {\r\n editPoly.poly.setAsRectangle(corner1, this._v2);\r\n InterferenceTool.createDefaultInterference(baseParentId, editPoly.poly, mode);\r\n }\r\n this.reset();\r\n }\r\n break;\r\n }\r\n case InterferenceToolMode.triangle: {\r\n var corner1 = this._v1;\r\n this._v2.set(rp.x, rp.y, 0);\r\n if (editPoly.poly.array.length) {\r\n // 10mm\r\n if (corner1.distanceTo(this._v2) >= 10) {\r\n editPoly.poly.setAsTriangle(corner1, this._v2);\r\n InterferenceTool.createDefaultInterference(baseParentId, editPoly.poly, mode);\r\n }\r\n this.reset();\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private makePolygonPoint(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n raycaster = controller.worldRaycaster,\r\n editPoly = this.editPoly,\r\n editHandle = this.editHandle,\r\n baseParentId = controller.viewModel.currentInstance.Id,\r\n rp = viewModel.roofPosition,\r\n mode = this.mode;\r\n editHandle.hovered = !!this.editHandle.intersecsRaycaster(raycaster);\r\n if (editHandle.hovered) {\r\n editPoly.poly.array.pop();\r\n editPoly.closed = mode !== InterferenceToolMode.line;\r\n InterferenceTool.createDefaultInterference(baseParentId, editPoly.poly, mode);\r\n this.reset();\r\n } else {\r\n var p = editPoly.poly.array[editPoly.poly.array.length - 1];\r\n if (editPoly.poly.array.length == 1) {\r\n rp = viewModel.roofPosition;\r\n p.copy(rp).setZ(0);\r\n }\r\n editPoly.poly.push(p.x, p.y, 0);\r\n if (!editHandle.editable || mode === InterferenceToolMode.line) {\r\n var pt = editHandle.point;\r\n pt.x = p.x;\r\n pt.y = p.y;\r\n editHandle.editable = true;\r\n }\r\n }\r\n }\r\n\r\n static createInterferenceState(baseParentId: string, type = \"DynamicInterferenceObject\", pts?: THREE.Vector3[]): InteferenceState {\r\n if (!baseParentId)\r\n baseParentId = Controller.Current.viewModel.currentInstance.Id;\r\n\r\n var state = new InteferenceState();\r\n\r\n state.IsParallel = true;\r\n state.Name = AO3DStrings.Interference + \" \" + Controller.Current.viewModel.interferenceObjects.length + 1;\r\n state.Type = type;\r\n state.TypeId = null;\r\n state.BaseParentId = baseParentId;\r\n state.IdString = spt.Utils.GenerateGuid().toLowerCase();\r\n state.ClientOptions = 0;\r\n state.scalex = 1;\r\n state.scaley = 1;\r\n state.scalez = 1;\r\n state.rotation = 0;\r\n\r\n var b = new THREE.Box3();\r\n\r\n if (pts) {\r\n b.setFromPoints(pts);\r\n\r\n var data: number[] = [];\r\n\r\n for (var i = 0, l = pts.length; i < l; i++) {\r\n var p = pts[i];\r\n data.push(p.x, p.y, p.z);\r\n }\r\n\r\n state.Data = data;\r\n\r\n b.min.setZ(Math.min(0, b.min.z));\r\n }\r\n\r\n if (type === \"DynamicInterferenceObject\") {\r\n state.Settings = null as SolarProTool.IInterferenceSettings;\r\n } else {\r\n var settings = state.Settings = {} as SolarProTool.DormerInterferenceObject;\r\n\r\n settings.InterferenceType = type;\r\n\r\n switch (type) {\r\n case \"DormerInterferenceObject\":\r\n settings.DormerTiltAngle = 33;\r\n if (!b.isEmpty()) {\r\n var size = b.getSize(new THREE.Vector3());\r\n\r\n settings.DormerSizeX = size.x;\r\n settings.DormerSizeY = size.y;\r\n settings.DormerSizeZ = size.z;\r\n } else {\r\n settings.DormerSizeX = 0;\r\n settings.DormerSizeY = 0;\r\n settings.DormerSizeZ = 0;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return state;\r\n }\r\n\r\n static createDefaultInterference(baseParentId: string, poly: ObservablePolygon, mode: InterferenceToolMode) {\r\n var controller = Controller.Current,\r\n viewModel = controller.viewModel;\r\n\r\n if (mode === InterferenceToolMode.line) {\r\n var lineWidth = viewModel.interferenceLineThickness.internalValue;\r\n if (lineWidth > 0 || poly && poly.array && poly.array.length >= 2) {\r\n\r\n spt.ThreeJs.utils.generateOffsetLinePolygons(poly.array, lineWidth).forEach(interPoly => {\r\n var state = InterferenceTool.createInterferenceState(baseParentId, \"DynamicInterferenceObject\", interPoly);\r\n InterferenceTool.saveInterferenceState(state, baseParentId, false);\r\n });\r\n }\r\n } else if (poly && poly.array && poly.array.length >= 3) {\r\n if (THREE.ShapeUtils.isClockWise(poly.array))\r\n poly.array.reverse();\r\n\r\n poly.height = 100;\r\n\r\n var state = InterferenceTool.createInterferenceState(baseParentId, \"DynamicInterferenceObject\", poly.array);\r\n\r\n InterferenceTool.saveInterferenceState(state, baseParentId, true);\r\n\r\n }\r\n\r\n }\r\n\r\n private static saveInterferenceState(state: InteferenceState, baseParentId: string, openFlyOut: boolean) {\r\n var controller = Controller.Current,\r\n viewModel = controller.viewModel;\r\n controller.interferenceHelper.updateSetInterferenceState(null, baseParentId, state, (id) => {\r\n if (id) {\r\n state.IdString = id.toLowerCase();\r\n\r\n var inter = controller.interferenceHelper.createInterferenceObjectFromData(state);\r\n\r\n if (openFlyOut && !inter.isSelected && !inter.locked && !inter._isDisposed) {\r\n viewModel.addToSelection([inter], true, false, viewModel.selectedUi);\r\n var $aoConstrucionSettings = $('#ao-ConstrucionSettings') as any;\r\n if ($aoConstrucionSettings.tabs)\r\n $aoConstrucionSettings.tabs(\"option\", \"active\", 1);\r\n if (!Controller.Current.viewModel.FlyoutVisible)\r\n LS.Client3DEditor.ToolBox.toggleFlyout();\r\n }\r\n\r\n controller.updateManager.dynamicUpdate(() => {\r\n Controller.Current.interferenceHelper.createInterferenceObjectFromData(state);\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(id, baseParentId, state);\r\n }, () => {\r\n var o = Controller.Current.interferenceHelper.getById(id);\r\n if (o) {\r\n o.remove();\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(id, baseParentId, null);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n }\r\n\r\n}","module LS.Client3DEditor {\r\n export class AddSpacingTool extends BaseTool {\r\n edgeSpacing = 0;\r\n v1 = new THREE.Vector3();\r\n v2 = new THREE.Vector3();\r\n v3 = new THREE.Vector3();\r\n edgeDir = new THREE.Vector3();\r\n closestStart = new THREE.Vector3();\r\n closestEnd = new THREE.Vector3();\r\n box1 = new THREE.Box3();\r\n box2 = new THREE.Box3();\r\n spacingMode = 1;\r\n spacingModeVertical = 1;\r\n spacingModeHorizontal = 2;\r\n segments: { start: THREE.Vector3, end: THREE.Vector3, ids: string[], type: number }[] = [];\r\n viewModel: SpacingViewModel = new SpacingViewModel(this);\r\n zPadding = 75;\r\n Groups: SolarProTool.AnlagenResult[] = [];\r\n clientObjectId: string = null;\r\n updateListener: (event: IEventManagerEvent) => void;\r\n\r\n onSelect(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n segmentHighlightHelper = controller.segmentHighlightHelper,\r\n segmentsHelper = controller.segmentsHelper;\r\n\r\n segmentHighlightHelper.visible = false;\r\n segmentsHelper.visible = false;\r\n\r\n this.Groups = [];\r\n this.loadGroups();\r\n\r\n if (this.updateListener)\r\n Controller.Current.updateManager.removeListener(\"HandleClientObjectChanges\", this.updateListener);\r\n Controller.Current.updateManager.addListener(\"HandleClientObjectChanges\", (this.updateListener = this.loadGroups.bind(this)));\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n segmentHighlightHelper = controller.segmentHighlightHelper,\r\n segmentsHelper = controller.segmentsHelper;\r\n\r\n segmentHighlightHelper.visible = false;\r\n segmentsHelper.visible = false;\r\n\r\n if (this.updateListener)\r\n Controller.Current.updateManager.removeListener(\"HandleClientObjectChanges\", this.updateListener);\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n instanceContext = controller.viewModel.currentInstance,\r\n segmentHighlightHelper = controller.segmentHighlightHelper,\r\n segmentsHelper = controller.segmentsHelper,\r\n rp = viewModel.roofPosition,\r\n camera = controller.orthoCamera,\r\n tolerance = controller.ClickTolerance / camera.zoom,\r\n toleranceSq = tolerance * tolerance,\r\n v1 = this.v1,\r\n v2 = this.v2,\r\n v3 = this.v3,\r\n edgeDir = this.edgeDir,\r\n spacingMode = this.spacingMode,\r\n closestStart = this.closestStart,\r\n closestEnd = this.closestEnd,\r\n box1 = this.box1,\r\n box2 = this.box2,\r\n zPadding = this.zPadding;\r\n\r\n box1.min.set(rp.x - tolerance, rp.y - tolerance, -camera.far);\r\n box1.max.set(rp.x + tolerance, rp.y + tolerance, camera.far);\r\n\r\n var distance = Number.MAX_VALUE;\r\n var segmentFound = false;\r\n var radius = box1.getSize(v2).setZ(0).length() * 0.5;\r\n var octreeObjects = instanceContext.searchOctree(rp, radius, false);\r\n var zThickness = 100;\r\n var clientObjectId = null;\r\n\r\n for (var i = octreeObjects.length; i--;) {\r\n var object = octreeObjects[i] as ClientObjectInstance;\r\n\r\n object.updateSelectionBounds(box2.makeEmpty());\r\n\r\n //box2.copy(object.geometry.boundingBox).translate(object.position);\r\n //if (object.parent)\r\n // box2.applyMatrix4(object.parent.matrixWorld);\r\n\r\n if (box1.intersectsBox(box2)) {\r\n\r\n v1.copy(rp).clamp(box2.min, box2.max).setZ(0); // vertical pos\r\n v2.copy(v1); // horizontal pos\r\n\r\n v1.x += (Math.abs(box2.min.x - v1.x) < Math.abs(box2.max.x - v1.x)) ? box2.min.x - v1.x : box2.max.x - v1.x;\r\n v2.y += (Math.abs(box2.min.y - v2.y) < Math.abs(box2.max.y - v2.y)) ? box2.min.y - v2.y : box2.max.y - v2.y;\r\n\r\n //if (spacingMode === this.spacingModeVertical)\r\n // v1.x += (Math.abs(box2.min.x - v1.x) < Math.abs(box2.max.x - v1.x)) ? box2.min.x - v1.x : box2.max.x - v1.x;\r\n //if (spacingMode === this.spacingModeHorizontal)\r\n // v1.y += (Math.abs(box2.min.y - v1.y) < Math.abs(box2.max.y - v1.y)) ? box2.min.y - v1.y : box2.max.y - v1.y;\r\n\r\n var distV = v3.copy(v1).sub(rp).lengthSq();\r\n var distH = v3.copy(v2).sub(rp).lengthSq();\r\n\r\n var dist: number,\r\n sm: number;\r\n\r\n if (distV < distH) {\r\n sm = this.spacingModeVertical;\r\n dist = distV;\r\n } else {\r\n sm = this.spacingModeHorizontal;\r\n dist = distH;\r\n v1.copy(v2);\r\n }\r\n\r\n if (dist < distance && dist <= toleranceSq) {\r\n distance = dist;\r\n spacingMode = sm;\r\n clientObjectId = object.instanceData.Id;\r\n\r\n var bz = (box2.min.z + box2.max.z) * 0.5;\r\n\r\n if (spacingMode === this.spacingModeVertical) {\r\n closestStart.copy(box2.min).setX(v1.x).setZ(bz);\r\n closestEnd.copy(box2.max).setX(v1.x).setZ(bz);\r\n\r\n if (Math.abs(v1.x - box2.min.x) < Math.abs(v1.x - box2.max.x)) {\r\n // left edge\r\n edgeDir.set(-1, 0, 0);\r\n } else {\r\n // right edge\r\n edgeDir.set(1, 0, 0);\r\n }\r\n }\r\n else if (spacingMode === this.spacingModeHorizontal) {\r\n closestStart.copy(box2.min).setY(v1.y).setZ(box2.min.z).setZ(bz);\r\n closestEnd.copy(box2.max).setY(v1.y).setZ(bz);\r\n\r\n if (Math.abs(v1.y - box2.min.y) < Math.abs(v1.y - box2.max.y)) {\r\n // lower edge\r\n edgeDir.set(0, -1, 0);\r\n } else {\r\n // upper edge\r\n edgeDir.set(0, 1, 0);\r\n }\r\n }\r\n\r\n zThickness = box2.max.z + zPadding;\r\n\r\n segmentFound = true;\r\n }\r\n }\r\n }\r\n\r\n if (!segmentFound) {\r\n if (segmentHighlightHelper.visible)\r\n segmentHighlightHelper.visible = false;\r\n if (segmentsHelper.visible)\r\n segmentsHelper.visible = false;\r\n\r\n controller.viewModel.Cursor = this.cursor;\r\n return false;\r\n }\r\n\r\n this.spacingMode = spacingMode;\r\n this.clientObjectId = clientObjectId;\r\n var currentGroup = this.getGroup();\r\n\r\n controller.viewModel.Cursor = 'pointer';\r\n\r\n //search for another edge\r\n box2.makeEmpty()\r\n .expandByPoint(v1.copy(edgeDir).add(closestStart).setZ(0))\r\n .expandByPoint(v1.copy(edgeDir).multiplyScalar(2000).add(closestEnd).setZ(zThickness))\r\n .expandByScalar(-1);\r\n\r\n octreeObjects = instanceContext.getBoxIntersections(box2);\r\n\r\n var edgeSpacing = -1;\r\n\r\n for (var i = octreeObjects.length; i--;) {\r\n var co = octreeObjects[i] as ClientObjectInstance,\r\n id = co.instanceData.Id;\r\n\r\n if (id === clientObjectId || (currentGroup != null && currentGroup.ClientObjectIds.indexOf(id) === -1))\r\n continue;\r\n\r\n co.updateSelectionBounds(box2.makeEmpty());\r\n\r\n //box2.copy(co.geometry.boundingBox).translate(co.position);\r\n //if (co.parent)\r\n // box2.applyMatrix4(co.parent.matrixWorld);\r\n\r\n var d = Math.min(edgeDir.dot(v1.copy(box2.min).sub(closestStart)), edgeDir.dot(v1.copy(box2.max).sub(closestStart)));\r\n if (d >= 0 && (d < edgeSpacing || edgeSpacing < 0))\r\n edgeSpacing = Math.max(0, d);\r\n }\r\n\r\n //move edge to the center of the space in between\r\n if (edgeSpacing > 0) {\r\n closestStart.add(v1.copy(edgeDir).multiplyScalar(edgeSpacing * 0.5));\r\n closestEnd.add(v1.copy(edgeDir).multiplyScalar(edgeSpacing * 0.5));\r\n }\r\n\r\n this.edgeSpacing = edgeSpacing;\r\n\r\n if (!segmentHighlightHelper.visible)\r\n segmentHighlightHelper.visible = true;\r\n segmentHighlightHelper.setStartEnd(closestStart, closestEnd, true, Math.max(200, edgeSpacing), zThickness);\r\n\r\n if (!segmentsHelper.visible)\r\n segmentsHelper.visible = true;\r\n segmentsHelper.setLinePoints([closestStart, closestEnd]);\r\n\r\n return false;\r\n }\r\n\r\n private loadGroups() {\r\n if (window.isElevation && Controller.Current.viewModel.selectedTool === \"addSpacingTool\") {\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"GetAnlagen\").Data().CallBack(result => {\r\n this.Groups = result || [];\r\n });\r\n }\r\n }\r\n\r\n private getGroup(clientObjectId?: string) {\r\n if (!clientObjectId)\r\n clientObjectId = this.clientObjectId;\r\n if (!clientObjectId)\r\n return null;\r\n\r\n var groups = this.Groups;\r\n\r\n if (clientObjectId && groups.length) {\r\n for (var i = groups.length; i--;) {\r\n if (groups[i].ClientObjectIds.indexOf(clientObjectId) !== -1) {\r\n return groups[i];\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n onMouseDown(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n segmentHighlightHelper = controller.segmentHighlightHelper,\r\n segmentsHelper = controller.segmentsHelper;\r\n\r\n if (segmentHighlightHelper.visible)\r\n this.ShowSpacingDialog();\r\n\r\n return false;\r\n }\r\n\r\n ShowSpacingDialog() {\r\n DManager.loadDynamicDialog(\"/Anordnung/GetAoSpacingDialog\", \"ao-spacing-dia\", 'auto', 'auto', (dialogId, diaGenerated) => {\r\n if (diaGenerated)\r\n ko.applyBindings(this.viewModel, $(`#${dialogId}`).get(0));\r\n\r\n this.viewModel.clientObjectId = this.clientObjectId;\r\n this.viewModel.spacingMode = this.spacingMode;\r\n this.viewModel.edgeDir.copy(this.edgeDir);\r\n this.viewModel.edgeSpacing = this.edgeSpacing;\r\n this.viewModel.newLength = Math.max(0, this.edgeSpacing);\r\n this.viewModel.start.copy(this.closestStart);\r\n this.viewModel.end.copy(this.closestEnd);\r\n this.viewModel.SelectableHorizontalGaps.removeAll();\r\n this.viewModel.SelectableVerticalGaps.removeAll();\r\n\r\n if (this.edgeSpacing < 0) {\r\n if (this.edgeDir.x >= 0.9) {\r\n this.viewModel.spacingDirectionV = -1;\r\n this.viewModel.spacingDirectionH = 0;\r\n } else if (this.edgeDir.x <= -0.9) {\r\n this.viewModel.spacingDirectionV = 1;\r\n this.viewModel.spacingDirectionH = 0;\r\n } else if (this.edgeDir.y >= 0.9) {\r\n this.viewModel.spacingDirectionV = 0;\r\n this.viewModel.spacingDirectionH = -1;\r\n } else {\r\n this.viewModel.spacingDirectionV = 0;\r\n this.viewModel.spacingDirectionH = 1;\r\n }\r\n }\r\n\r\n var group = this.getGroup();\r\n if (group) {\r\n this.viewModel.SelectableHorizontalGaps.push.apply(this.viewModel.SelectableHorizontalGaps, group.SelectableHorizontalGaps || []);\r\n this.viewModel.SelectableVerticalGaps.push.apply(this.viewModel.SelectableVerticalGaps, group.SelectableVerticalGaps || []);\r\n\r\n if (this.viewModel.SelectableVerticalGaps.length && this.viewModel.isVertical) {\r\n var newLength = this.viewModel.newLength;\r\n this.viewModel.newLength = this.viewModel.SelectableVerticalGaps.reduce((prev, curr) => {\r\n return (Math.abs(curr.Value - newLength) < Math.abs(prev.Value - newLength) ? curr : prev);\r\n }).Value;\r\n }\r\n else if (this.viewModel.SelectableHorizontalGaps.length && !this.viewModel.isVertical) {\r\n var newLength = this.viewModel.newLength;\r\n this.viewModel.newLength = this.viewModel.SelectableHorizontalGaps.reduce((prev, curr) => {\r\n return (Math.abs(curr.Value - newLength) < Math.abs(prev.Value - newLength) ? curr : prev);\r\n }).Value;\r\n }\r\n }\r\n\r\n setTimeout(() => {\r\n DManager.show(dialogId);\r\n $('#ao-gap-new-distance-input').focus();\r\n Controller.Current.viewModel.hasFocus = false;\r\n }, 0);\r\n });\r\n }\r\n\r\n SaveSpacingDialog() {\r\n ko.tasks.runEarly();\r\n\r\n var controller = Controller.Current,\r\n instanceContext = controller.viewModel.currentInstance,\r\n segmentHighlightHelper = controller.segmentHighlightHelper,\r\n segmentsHelper = controller.segmentsHelper,\r\n clientObjectId = this.clientObjectId = this.viewModel.clientObjectId,\r\n currentGroup = this.getGroup(clientObjectId),\r\n v1 = this.v1,\r\n v2 = this.v2,\r\n v3 = this.v3,\r\n edgeDir = this.edgeDir.copy(this.viewModel.edgeDir),\r\n spacingMode = this.spacingMode = this.viewModel.spacingMode,\r\n start = this.viewModel.start.clone(),\r\n end = this.viewModel.end.clone(),\r\n box1 = this.box1,\r\n box2 = this.box2,\r\n edgeTolerance = currentGroup ? 2000 : 500,\r\n edgeSpacing = this.viewModel.edgeSpacing,\r\n newLength = this.viewModel.newLength,\r\n isVertical = this.viewModel.isVertical,\r\n whole = this.viewModel.whole,\r\n spacingDirection = isVertical ? this.viewModel.spacingDirectionV : this.viewModel.spacingDirectionH,\r\n expandDirs: THREE.Vector3[] = [],\r\n expandDist: number[] = [];\r\n\r\n DManager.hide(\"ao-spacing-dia\");\r\n\r\n controller.notifyRefreshView();\r\n\r\n if (segmentHighlightHelper.visible)\r\n segmentHighlightHelper.visible = false;\r\n if (segmentsHelper.visible)\r\n segmentsHelper.visible = false;\r\n\r\n controller.viewModel.Cursor = this.cursor;\r\n\r\n controller.viewModel.hasFocus = true;\r\n\r\n if (newLength < 0)\r\n return;\r\n\r\n var move = Math.round(newLength - Math.max(0, edgeSpacing));\r\n\r\n if (edgeSpacing < 0) {\r\n //edge case\r\n expandDirs.push(edgeDir.clone().negate());\r\n expandDist.push(move);\r\n\r\n start.add(edgeDir);\r\n end.add(edgeDir);\r\n } else {\r\n if (isVertical) {\r\n switch (spacingDirection) {\r\n case -1:\r\n expandDirs.push(new THREE.Vector3(-1, 0, 0));\r\n expandDist.push(move);\r\n break;\r\n case 1:\r\n expandDirs.push(new THREE.Vector3(1, 0, 0));\r\n expandDist.push(move);\r\n break;\r\n default:\r\n expandDirs.push(new THREE.Vector3(-1, 0, 0));\r\n expandDist.push(Math.floor(move * 0.5));\r\n expandDirs.push(new THREE.Vector3(1, 0, 0));\r\n expandDist.push(Math.ceil(move * 0.5));\r\n break;\r\n }\r\n } else {\r\n switch (spacingDirection) {\r\n case -1:\r\n expandDirs.push(new THREE.Vector3(0, -1, 0));\r\n expandDist.push(move);\r\n break;\r\n case 1:\r\n expandDirs.push(new THREE.Vector3(0, 1, 0));\r\n expandDist.push(move);\r\n break;\r\n default:\r\n expandDirs.push(new THREE.Vector3(0, -1, 0));\r\n expandDist.push(Math.floor(move * 0.5));\r\n expandDirs.push(new THREE.Vector3(0, 1, 0));\r\n expandDist.push(Math.ceil(move * 0.5));\r\n break;\r\n }\r\n }\r\n }\r\n\r\n box2.min.copy(start).min(end).setZ(0);\r\n box2.max.copy(end).max(start).setZ(Math.max(start.z, end.z, 1000));\r\n\r\n if (whole) {\r\n box2.min.x -= edgeTolerance;\r\n box2.min.y -= edgeTolerance;\r\n box2.max.x += edgeTolerance;\r\n box2.max.y += edgeTolerance;\r\n } else {\r\n if (isVertical) {\r\n box2.min.x -= edgeTolerance;\r\n box2.min.y += 1;\r\n box2.max.x += edgeTolerance;\r\n box2.max.y -= 1;\r\n } else { //isHorizontal\r\n box2.min.x += 1;\r\n box2.min.y -= edgeTolerance;\r\n box2.max.x -= 1;\r\n box2.max.y += edgeTolerance;\r\n }\r\n }\r\n\r\n var octreeObjects = instanceContext.getBoxIntersections(box2);\r\n if (currentGroup)\r\n octreeObjects = octreeObjects.filter((o: ClientObjectInstance) => currentGroup.ClientObjectIds.indexOf(o.instanceData.Id) !== -1);\r\n\r\n var foundObjects = octreeObjects;\r\n var foundLength = 0;\r\n\r\n while (foundLength < foundObjects.length) {\r\n foundLength = foundObjects.length;\r\n\r\n box2.makeEmpty();\r\n\r\n foundObjects.forEach(o => {\r\n box2.expandByObject(o);\r\n });\r\n\r\n if (box2.isEmpty())\r\n break;\r\n\r\n if (whole) {\r\n box2.min.x -= edgeTolerance;\r\n box2.min.y -= edgeTolerance;\r\n box2.max.x += edgeTolerance;\r\n box2.max.y += edgeTolerance;\r\n } else {\r\n if (isVertical) {\r\n box2.min.x -= edgeTolerance;\r\n box2.min.y += 1;\r\n box2.max.x += edgeTolerance;\r\n box2.max.y -= 1;\r\n } else { //isHorizontal\r\n box2.min.x += 1;\r\n box2.min.y -= edgeTolerance;\r\n box2.max.x -= 1;\r\n box2.max.y += edgeTolerance;\r\n }\r\n }\r\n\r\n octreeObjects = instanceContext.getBoxIntersections(box2).filter(o => foundObjects.indexOf(o) === -1);\r\n\r\n if (currentGroup)\r\n octreeObjects = octreeObjects.filter((o: ClientObjectInstance) => currentGroup.ClientObjectIds.indexOf(o.instanceData.Id) !== -1);\r\n\r\n if (octreeObjects.length)\r\n foundObjects = foundObjects.concat(octreeObjects);\r\n }\r\n\r\n foundObjects.forEach((o: ClientObjectInstance) => {\r\n if (o && o.position && o.instanceData && o.instanceData.Id && o.clientObject && o.clientObject.canMoveInstances) {\r\n o.updateSelectionBounds(box1.makeEmpty());\r\n var pos = v1.copy(o.position),\r\n center = box1.getCenter(v3);\r\n\r\n for (var i = 0, l = expandDirs.length; i < l; i++) {\r\n var dir = expandDirs[i];\r\n if (dir.dot(v2.copy(center).sub(start)) > 0) {\r\n pos.add(v2.copy(dir).multiplyScalar(expandDist[i]));\r\n break;\r\n }\r\n }\r\n\r\n if (o.position.x !== pos.x || o.position.y !== pos.y)\r\n o.setPosition(pos.x, pos.y, pos.z);\r\n }\r\n });\r\n\r\n }\r\n }\r\n\r\n export class SpacingViewModel {\r\n SelectableHorizontalGaps: SolarProTool.NameDouble[] = [];\r\n SelectableVerticalGaps: SolarProTool.NameDouble[] = [];\r\n readonly currentLength: number;\r\n newLength = 0;\r\n spacingDirectionV = 0;\r\n spacingDirectionH = 0;\r\n edgeSpacing = 0;\r\n spacingMode = 1;\r\n clientObjectId: string = null;\r\n edgeDir: ObservableVector3 = new ObservableVector3();\r\n start: THREE.Vector3;\r\n end: THREE.Vector3;\r\n readonly isVertical: boolean;\r\n whole = true;\r\n tool: AddSpacingTool;\r\n\r\n valueAdjustOpts: spt.Utils.IFloatFromInputOptions = {\r\n notImperial: true,\r\n precision: window.UseImperialSystem ? 3 : 0,\r\n from: \"mm\",\r\n to: window.UseImperialSystem ? \"ft\" : \"mm\"\r\n };\r\n\r\n constructor(tool: AddSpacingTool) {\r\n ko.track(this);\r\n\r\n ko.defineProperty(this, 'isVertical', () => {\r\n return Math.abs(this.edgeDir.x) > 0.5;\r\n });\r\n\r\n ko.defineProperty(this, 'currentLength', () => {\r\n return Math.max(0, this.edgeSpacing);\r\n });\r\n\r\n this.start = new THREE.Vector3();\r\n this.end = new THREE.Vector3();\r\n\r\n this.tool = tool;\r\n }\r\n\r\n setNewLength(v: number | string) {\r\n var l = spt.Utils.GetFloatFromInputValue(\"\" + v,\r\n {\r\n min: 0,\r\n max: 100000,\r\n applyArithmetic: true,\r\n isFeet: window.UseImperialSystem,\r\n notImperial: !window.UseImperialSystem,\r\n from: this.valueAdjustOpts.to,\r\n to: \"mm\"\r\n });\r\n this.newLength = l;\r\n }\r\n }\r\n}","module LS.Client3DEditor {\r\n export enum StringingToolMode {\r\n default = 0,\r\n plus = 1\r\n }\r\n\r\n export enum StringingToolStep {\r\n none = 0,\r\n drawing = 1\r\n }\r\n\r\n export class StringingTool extends BaseTool {\r\n\r\n //tempStringObject: StringObjectInstance = null;\r\n\r\n hoveredClientObjectId: string = null;\r\n\r\n hoveredJointId: string = null;\r\n\r\n get currentStringObject() {\r\n return this.currentJoint ? this.currentJoint.getParent() as StringObjectInstance : null;\r\n }\r\n\r\n currentJoint: StringJoint = null;\r\n private _v1: THREE.Vector3 = new THREE.Vector3();\r\n\r\n lastMouse: THREE.Vector2 = new THREE.Vector2();\r\n lastRoofPosition: THREE.Vector3 = new THREE.Vector3();\r\n step: StringingToolStep = StringingToolStep.none;\r\n mode: StringingToolMode = StringingToolMode.default;\r\n resetOnMouseUp: boolean = false;\r\n\r\n getPositionFromClientObjectInstance(inst: ClientObjectInstance): THREE.Vector3 {\r\n if (!inst)\r\n return null;\r\n\r\n inst.update();\r\n\r\n var bb = inst.geometry.boundingBox;\r\n\r\n return bb.getCenter(new THREE.Vector3()).setZ(bb.max.z + 50).applyMatrix4(inst.matrixWorld);\r\n }\r\n\r\n onSelect(viewModel: ViewModel, params: { mode?: string }) {\r\n viewModel.deselectAll();\r\n this.reset();\r\n this.mode = params && params.mode ? StringingToolMode[params.mode] : StringingToolMode.default;\r\n LS.Electric.InvertersModel.doSelectString();\r\n }\r\n\r\n onDeselect(viewModel: ViewModel) {\r\n this.reset();\r\n }\r\n\r\n reset() {\r\n Controller.Current.viewModel.Cursor = this.cursor;\r\n this.cleanUp();\r\n this.step = StringingToolStep.none;\r\n this.resetOnMouseUp = false;\r\n this.hoveredClientObjectId = null;\r\n this.currentJoint = null;\r\n }\r\n\r\n onMouseMove(viewModel: ViewModel) {\r\n if (LoaderManager.isLoading()) {\r\n this.lastMouse.copy(viewModel.mouse);\r\n this.lastRoofPosition.copy(viewModel.roofPosition);\r\n\r\n return false;\r\n }\r\n\r\n var mouse = viewModel.mouse,\r\n roofPosition = viewModel.roofPosition,\r\n lastMouse = this.lastMouse,\r\n lastRoofPosition = this.lastRoofPosition,\r\n distSq = roofPosition.distanceToSquared(lastRoofPosition);\r\n\r\n if (this.step === StringingToolStep.drawing && this.currentJoint && distSq > 640000) {\r\n //is drawing\r\n var sec = Math.ceil(Math.sqrt(distSq) / 800),\r\n m = new THREE.Vector2();\r\n\r\n for (var i = 1; i < sec; i++) {\r\n this.onMouseMoveIntern(viewModel, m.lerpVectors(lastMouse, mouse, i / sec));\r\n }\r\n }\r\n\r\n lastMouse.copy(mouse);\r\n lastRoofPosition.copy(roofPosition);\r\n\r\n return this.onMouseMoveIntern(viewModel, viewModel.mouse);\r\n }\r\n\r\n private onMouseMoveIntern(viewModel: ViewModel, mouse: THREE.Vector2) {\r\n var controller = Controller.Current,\r\n instanceContext = controller.viewModel.currentInstance,\r\n raycaster = controller.getWorldRaycaster(null, mouse),\r\n stringObjectHolder = controller.stringObjectHolder,\r\n hoveredClientObjectId: string = this.hoveredClientObjectId = null,\r\n isDrawing = this.step === StringingToolStep.drawing && !!this.currentJoint;\r\n\r\n var intersections = instanceContext.getInstanceIntersections(raycaster).filter(ci => ci && !ci._isDisposed && ci.instanceData && ci.instanceData.Id && ci.clientObject.dataType.match(/ModuleObject|DiffusionPointObject/));\r\n\r\n var canHoverJoint = !isDrawing;\r\n\r\n if (intersections.length > 0) {\r\n var instance = intersections[0];\r\n\r\n LS.Client3DEditor.setBoxhelper(instance);\r\n\r\n //hoveredInstanceChanged = this.hoveredClientObjectId !== instaceId;\r\n if (instance.clientObject.dataType.indexOf(\"ModuleObject\") != -1) {\r\n this.hoveredClientObjectId = hoveredClientObjectId = instance.instanceData.Id;\r\n\r\n if(canHoverJoint)\r\n canHoverJoint = !!stringObjectHolder.getJointByModuleId(hoveredClientObjectId);\r\n }\r\n\r\n if (this.resetOnMouseUp)\r\n this.resetOnMouseUp = false;\r\n\r\n //cursor = 'pointer';\r\n } else {\r\n LS.Client3DEditor.setBoxhelper(null);\r\n }\r\n\r\n raycaster = controller.getLocalRaycaster(raycaster, instanceContext);\r\n \r\n var hoveredJoint = canHoverJoint ? stringObjectHolder.getClosestJointToRaycaster(raycaster) : null;\r\n\r\n this.hoveredJointId = hoveredJoint && !hoveredJoint.isTemporary ? hoveredJoint.ModuleObjectIdString : null;\r\n\r\n controller.viewModel.Cursor = this.hoveredJointId ? 'pointer' : this.cursor;\r\n\r\n if (isDrawing) {\r\n //is drawing\r\n\r\n var conduitObjectHolder = LS.Client3DEditor.Controller.Current.conduitObjectHolder;\r\n var prev = this.currentJoint.getPrevious();\r\n\r\n this.currentJoint.setPosition(viewModel.roofPosition.x, viewModel.roofPosition.y);\r\n\r\n if (viewModel.shiftDown && prev)\r\n spt.ThreeJs.utils.ProjectVectorToClosestAxis(this.currentJoint.position.sub(prev.position), 100).add(prev.position);\r\n\r\n if (!viewModel.mouseDown && !hoveredClientObjectId) {\r\n\r\n var co = conduitObjectHolder.closestCenterByRaycaster(raycaster);\r\n if (co && co.p) {\r\n if (viewModel.shiftDown && prev) {\r\n var co2 = co.o.getClosestByRay2D(prev.position, this._v1.copy(this.currentJoint.position).sub(prev.position).normalize());\r\n if (co2 && co2.p) {\r\n co.p.copy(co2.p.setZ(this.currentJoint.position.z));\r\n }\r\n }\r\n\r\n this.currentJoint.position.copy(co.p.setZ(this.currentJoint.position.z));\r\n }\r\n }\r\n\r\n if (viewModel.mouseDown && hoveredClientObjectId && !stringObjectHolder.getJointByModuleId(hoveredClientObjectId)) {\r\n\r\n var so = this.currentJoint.getParent(),\r\n pos = this.getPositionFromClientObjectInstance(controller.Instances[hoveredClientObjectId]);\r\n\r\n if (so.modulesStringObjectValid()) {\r\n //string is already full\r\n return false;\r\n } else {\r\n this.currentJoint.set(pos, hoveredClientObjectId);\r\n\r\n if (so.modulesStringObjectValid()) {\r\n so.save();\r\n\r\n //break drawing\r\n this.reset();\r\n LS.Electric.InvertersModel.doSelectString();\r\n return false;\r\n }\r\n }\r\n\r\n if (so.Joints.indexOf(this.currentJoint) === 0)\r\n this.currentJoint = so.prependJoint(pos.clone().setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n else\r\n this.currentJoint = so.addJoint(pos.clone().setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n\r\n //this.currentJoint.set(pos, hoveredClientObjectId);\r\n\r\n //if (so.modulesStringObjectValid()) {\r\n // this.onStringingFinished(so);\r\n // return false;\r\n //}\r\n //else\r\n // this.currentJoint = so.addJoint(pos.clone().setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n\r\n }\r\n }\r\n\r\n //controller.viewModel.Cursor = cursor;\r\n return false;\r\n }\r\n\r\n onMouseDown(viewModel: ViewModel) {\r\n var controller = Controller.Current,\r\n instanceContext = controller.viewModel.currentInstance,\r\n //camera = controller.camera,\r\n //raycaster = controller.raycaster,\r\n //mouse = viewModel.mouse,\r\n stringObjectHolder = controller.stringObjectHolder,\r\n hoveredClientObjectId = this.hoveredClientObjectId,\r\n selectedInverterStringObject = LS.Electric.InvertersModel.getModulesStringObject(),\r\n hoveredJoint = stringObjectHolder.getJointByModuleId(this.hoveredJointId),\r\n hoveredClientObjectJoint = hoveredClientObjectId && stringObjectHolder.getJointByModuleId(hoveredClientObjectId),\r\n //hoveredJoint = hoveredClientObjectId && stringObjectHolder.getJointById(hoveredClientObjectId),\r\n additionalPoints = viewModel.ctrlDown || this.mode === StringingToolMode.plus;\r\n\r\n if (LoaderManager.isLoading())\r\n return false;\r\n\r\n this.resetOnMouseUp = this.step === StringingToolStep.drawing && !hoveredJoint && !hoveredClientObjectJoint && !hoveredClientObjectId;\r\n\r\n //pick up existing string\r\n if (this.step === StringingToolStep.none && hoveredJoint) {\r\n var curSo = hoveredJoint.getParent(),\r\n jIdx = curSo.getIndexOfJointByModuleId(hoveredJoint.ModuleObjectIdString),\r\n removeCurrent = !viewModel.ctrlDown;\r\n\r\n if (jIdx > 0) {\r\n curSo.removeRange(removeCurrent ? jIdx : jIdx + 1);\r\n this.currentJoint = curSo.addJoint(hoveredJoint.position.clone().setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n LS.Electric.InvertersModel.doSelectString(curSo.IdString);\r\n this.step = StringingToolStep.drawing;\r\n return false;\r\n } else if (jIdx === 0) {\r\n if (removeCurrent) {\r\n //take root\r\n curSo.removeRange(0, 1);\r\n\r\n //curSo.removeInstance();\r\n }\r\n\r\n //prepend joint to root\r\n this.currentJoint = curSo.prependJoint(hoveredJoint.position.clone().setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n LS.Electric.InvertersModel.doSelectString(curSo.IdString);\r\n this.step = StringingToolStep.drawing;\r\n\r\n return false;\r\n }\r\n //if (jIdx > 0) {\r\n // curSo.removeRange(jIdx);\r\n // this.currentJoint = curSo.addJoint(hoveredJoint.position.clone().setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n // LS.Electric.InvertersModel.doSelectString(curSo.IdString);\r\n // this.step = StringingToolStep.drawing;\r\n // return false;\r\n //} else if (jIdx === 0) {\r\n // this.currentJoint = null;\r\n // LS.Electric.InvertersModel.doSelectString(curSo.IdString);\r\n // curSo.removeInstance();\r\n // return false;\r\n //}\r\n }\r\n\r\n if (hoveredClientObjectId) {\r\n //if module hovered\r\n\r\n if (!selectedInverterStringObject) {\r\n AManager.GetTranslation(\"ElectricStrings.DoSelectInverterInput\", (str) => {\r\n DManager.ShowSmallInfo(str);\r\n });\r\n return false;\r\n }\r\n\r\n if (!hoveredClientObjectJoint) {\r\n //no joint hovered\r\n\r\n var pos = this.getPositionFromClientObjectInstance(controller.Instances[hoveredClientObjectId]);\r\n\r\n if (viewModel.ctrlDown) {\r\n pos.setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y);\r\n }\r\n\r\n if (viewModel.shiftDown && this.currentJoint) {\r\n var prev = this.currentJoint.getPrevious();\r\n if (prev)\r\n spt.ThreeJs.utils.ProjectVectorToClosestAxis(pos.copy(this.currentJoint.position).sub(prev.position), 100).add(prev.position);\r\n }\r\n\r\n if (this.step === StringingToolStep.none) {\r\n //not currently drawing\r\n\r\n var newSo = stringObjectHolder.getById(selectedInverterStringObject.Id);\r\n if (newSo)\r\n newSo.removeAll();\r\n else\r\n newSo = stringObjectHolder.addNewStringObject(selectedInverterStringObject.Id);\r\n newSo.setStringColor(selectedInverterStringObject.Color);\r\n newSo.addJoint(pos, hoveredClientObjectId);\r\n this.currentJoint = newSo.addJoint(pos.clone().setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n this.step = StringingToolStep.drawing;\r\n if (newSo.modulesStringObjectValid()) {\r\n newSo.save();\r\n\r\n //break drawing\r\n this.reset();\r\n LS.Electric.InvertersModel.doSelectString();\r\n return false;\r\n }\r\n } else if (this.step === StringingToolStep.drawing && this.currentJoint) {\r\n\r\n var so = this.currentJoint.getParent();\r\n\r\n if (so.modulesStringObjectValid()) {\r\n //string is already full\r\n\r\n this.reset();\r\n this.hoveredClientObjectId = hoveredClientObjectId;\r\n LS.Electric.InvertersModel.doSelectString();\r\n return this.onMouseDown(viewModel);\r\n\r\n } else {\r\n this.currentJoint.set(pos, hoveredClientObjectId);\r\n\r\n if (so.modulesStringObjectValid()) {\r\n so.save();\r\n\r\n //break drawing\r\n this.reset();\r\n LS.Electric.InvertersModel.doSelectString();\r\n return false;\r\n }\r\n }\r\n if (so.Joints.indexOf(this.currentJoint) === 0)\r\n this.currentJoint = so.prependJoint(pos.clone().setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n else\r\n this.currentJoint = so.addJoint(pos.clone().setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n //this.step = StringingToolStep.none;\r\n }\r\n }\r\n else if (additionalPoints && this.step === StringingToolStep.drawing && this.currentJoint) {\r\n //add free joint\r\n var currentJoint = this.currentJoint,\r\n so = currentJoint.getParent();\r\n if (so.Joints.every(jt => jt === currentJoint || jt.position.distanceToSquared(currentJoint.position) > 1)) {\r\n currentJoint.ModuleObjectIdString = spt.Utils.GenerateGuid(); // make it persistent\r\n\r\n if (so.Joints.indexOf(this.currentJoint) === 0)\r\n this.currentJoint = so.prependJoint(currentJoint.position.clone().setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n else\r\n this.currentJoint = so.addJoint(currentJoint.position.clone().setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n }\r\n }\r\n else if (hoveredJoint && this.step === StringingToolStep.drawing && this.currentJoint && this.currentJoint.getParent().id === hoveredJoint.getParent().id) {\r\n //pick up string\r\n var so = hoveredJoint.getParent();\r\n so.removeJoint(this.currentJoint);\r\n var idx = so.Joints.indexOf(hoveredJoint);\r\n\r\n if (idx > 0) {\r\n so.removeRange(idx + 1);\r\n this.currentJoint = so.addJoint(this\r\n .getPositionFromClientObjectInstance(controller.Instances[hoveredClientObjectId])\r\n .setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n } else if (idx === 0) {\r\n this.currentJoint = so.prependJoint(this\r\n .getPositionFromClientObjectInstance(controller.Instances[hoveredClientObjectId])\r\n .setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n } else {\r\n if (so.modulesStringObjectValid())\r\n so.save();\r\n this.reset();\r\n }\r\n //if (idx > 0) {\r\n // so.removeRange(idx);\r\n // this.currentJoint = so.addJoint(this\r\n // .getPositionFromClientObjectInstance(controller.Instances[hoveredClientObjectId])\r\n // .setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n //} else if (idx === 0) {\r\n // so.removeInstance();\r\n // LS.Electric.InvertersModel.doSelectString(so.IdString);\r\n // this.currentJoint = null;\r\n // this.step = StringingToolStep.none;\r\n //}\r\n }\r\n } else if (!hoveredJoint) {\r\n var raycaster = controller.worldRaycaster;\r\n\r\n var intersections = instanceContext.getInstanceIntersections(raycaster).filter(ci => ci && !ci._isDisposed && ci.instanceData && ci.instanceData.Id && ci.clientObject.dataType.indexOf(\"DiffusionPointObject\") != -1);\r\n\r\n if (intersections.length > 0) {\r\n var instance = intersections[0];\r\n viewModel.addToSelection([instance]);\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n cleanUp() {\r\n var controller = Controller.Current,\r\n currentJoint = this.currentJoint;\r\n if (currentJoint) {\r\n var so = currentJoint.getParent();\r\n\r\n so.cleanUp();\r\n\r\n if (!so.Joints.length) {\r\n controller.stringObjectHolder.removeObject(so);\r\n }\r\n else if (!so.modulesStringObjectValid()) {\r\n var mso = so.getModulesStringObject(),\r\n maxLength = mso ? \"\" + mso.MaxModuleCount : \"?\",\r\n msoName = mso ? mso.Name : \"?\";\r\n DManager.ShowSmallInfo(`String length incorrect! Please connect ${maxLength} modules for input ${msoName}.`);\r\n controller.stringObjectHolder.removeObject(so);\r\n }\r\n }\r\n this.currentJoint = null;\r\n }\r\n\r\n onMouseUp(viewModel: ViewModel) {\r\n if (LoaderManager.isLoading())\r\n return false;\r\n\r\n var currentJoint = this.currentJoint,\r\n so = currentJoint && currentJoint.getParent();\r\n\r\n if (this.resetOnMouseUp && this.step === StringingToolStep.drawing && this.currentJoint) {\r\n\r\n var controller = Controller.Current,\r\n mouse = viewModel.mouse,\r\n raycaster = controller.getWorldRaycaster(null, mouse),\r\n conduitObjectHolder = LS.Client3DEditor.Controller.Current.conduitObjectHolder,\r\n additionalPoints = viewModel.ctrlDown || this.mode === StringingToolMode.plus,\r\n doReset: boolean = false;\r\n\r\n var co = conduitObjectHolder.closestCenterByRaycaster(raycaster);\r\n if (co && co.p) {\r\n var prev = this.currentJoint.getPrevious();\r\n\r\n if (viewModel.shiftDown && prev) {\r\n var co2 = co.o.getClosestByRay2D(prev.position, this._v1.copy(this.currentJoint.position).sub(prev.position).normalize());\r\n if (co2 && co2.p /*&& co2.p.setZ(viewModel.roofPosition.z).distanceToSquared(viewModel.roofPosition) < raycaster.linePrecision * raycaster.linePrecision*/) {\r\n co.p.copy(co2.p)/*.sub(this.currentJoint.getParent().getPointOffset())*/;\r\n }\r\n }\r\n //var off = this.currentJoint.getParent().getPointOffset();\r\n this.currentJoint.position.copy(co.p.setZ(this.currentJoint.position.z))/*.sub(off)*/;\r\n doReset = !additionalPoints;\r\n additionalPoints = true;\r\n }\r\n\r\n if (additionalPoints) {\r\n //add free joint\r\n if (so.Joints.every(jt => jt === currentJoint ||\r\n jt.position.distanceToSquared(currentJoint.position) > 1)) {\r\n currentJoint.ModuleObjectIdString = spt.Utils.GenerateGuid(); // make it persistent\r\n\r\n if (so.Joints.indexOf(this.currentJoint) === 0)\r\n this.currentJoint = so.prependJoint(currentJoint.position.clone()\r\n .setX(viewModel.roofPosition.x).setY(viewModel.roofPosition.y));\r\n else\r\n this.currentJoint = so.addJoint(currentJoint.position.clone().setX(viewModel.roofPosition.x)\r\n .setY(viewModel.roofPosition.y));\r\n }\r\n\r\n if (!doReset) {\r\n this.resetOnMouseUp = false;\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n if (this.resetOnMouseUp && viewModel.diffViewPosition.lengthSq() < 100) {\r\n if (so && so.modulesStringObjectValid())\r\n so.save();\r\n this.reset();\r\n LS.Electric.InvertersModel.doSelectString();\r\n }\r\n\r\n return false;\r\n }\r\n\r\n onKeyDown(viewModel: ViewModel) {\r\n if (LoaderManager.isLoading())\r\n return false;\r\n\r\n if (viewModel.keyPressed(27)) // esc\r\n this.onSelect(viewModel, { mode: StringingToolMode[this.mode] });\r\n return false;\r\n }\r\n\r\n }\r\n\r\n export class StringJoint implements SolarProTool.IModuleConnectionJoint {\r\n\r\n ModuleObjectIdString: string;\r\n\r\n get X() {\r\n return this.position.x;\r\n }\r\n\r\n set X(v: number) {\r\n this.position.x = v;\r\n }\r\n\r\n get Y() {\r\n return this.position.y;\r\n }\r\n\r\n set Y(v: number) {\r\n this.position.y = v;\r\n }\r\n\r\n get Z() {\r\n return this.position.z;\r\n }\r\n\r\n set Z(v: number) {\r\n this.position.z = v;\r\n }\r\n\r\n constructor(position?: THREE.Vector3, modId?: string, parent?: StringObjectInstance) {\r\n this.position = position || new THREE.Vector3();\r\n this.ModuleObjectIdString = modId || null;\r\n this.parent = parent || null;\r\n if (modId)\r\n this.setStyleToClientObject();\r\n }\r\n\r\n hasClientObjectInstance(controller?: LS.Client3DEditor.Controller) {\r\n if (!controller)\r\n controller = LS.Client3DEditor.Controller.Current;\r\n return !!(this.ModuleObjectIdString && controller && controller.Instances[this.ModuleObjectIdString]);\r\n }\r\n\r\n getClientObjectInstance(controller?: LS.Client3DEditor.Controller): LS.Client3DEditor.ClientObjectInstance {\r\n if (!controller)\r\n controller = LS.Client3DEditor.Controller.Current;\r\n return this.ModuleObjectIdString && controller && (controller.Instances[this.ModuleObjectIdString] || null);\r\n }\r\n\r\n getModulesStringObject(): LS.Electric.ModulesStringObject {\r\n return this.parent && this.parent.getModulesStringObject();\r\n }\r\n\r\n getParent(): StringObjectInstance {\r\n return this.parent;\r\n }\r\n\r\n getPrevious(): StringJoint {\r\n var so = this.getParent(),\r\n joints = so.Joints;\r\n\r\n if (joints.length <= 1)\r\n return null;\r\n\r\n var idx = joints.indexOf(this);\r\n\r\n if (idx === 0)\r\n return joints[1];\r\n\r\n return joints[idx - 1];\r\n }\r\n\r\n set(p: THREE.Vector3, id?: string) {\r\n var parent = this.parent,\r\n idChanged: boolean = false;\r\n\r\n this.position.copy(p);\r\n\r\n if (id && this.ModuleObjectIdString !== id) {\r\n this.ModuleObjectIdString = id;\r\n idChanged = true;\r\n this.setStyleToClientObject();\r\n }\r\n\r\n if (parent)\r\n parent.onJointChanged(this, idChanged);\r\n\r\n return this;\r\n }\r\n\r\n setStyleToClientObject(clean?: boolean) {\r\n var ci = this.getClientObjectInstance(),\r\n mso = this.getModulesStringObject();\r\n\r\n if (clean) {\r\n if (ci) {\r\n ci.instanceData.InstanceColor = 0;\r\n ci.instanceAlphaOverride = 0.7;\r\n ci.OnChanged();\r\n }\r\n }\r\n else if (ci && mso) {\r\n var stringColor = new THREE.Color().setStyle(mso.Color).offsetHSL(0, -0.3, 0),\r\n cellColor: THREE.Color = new THREE.Color(0x0b1b3c);\r\n\r\n var co = ci.clientObject;\r\n\r\n for (var i = 0, sl = co.SharedMeshes.length; i < sl; i++) {\r\n var sm = co.SharedMeshes[i];\r\n\r\n if (sm.material instanceof LS.Client3DEditor.ModuleAppearanceShader) {\r\n cellColor.copy((sm.material).moduleCellColor);\r\n break;\r\n }\r\n }\r\n\r\n //ci.instanceData.InstanceColor;\r\n //this.instanceColor.setHex(data.InstanceColor).multiplyScalar(2).addScalar(-1);\r\n\r\n var ic = stringColor.sub(cellColor).addScalar(1).multiplyScalar(0.5).getHex();\r\n\r\n ci.instanceData.InstanceColor = ic;\r\n ci.instanceAlphaOverride = 0.5;\r\n ci.OnChanged();\r\n\r\n }\r\n }\r\n\r\n setPosition(x: number, y: number) {\r\n this.position.setX(x).setY(y);\r\n\r\n if (this.parent)\r\n this.parent.onJointChanged(this);\r\n\r\n return this;\r\n }\r\n\r\n dispose() {\r\n this.setStyleToClientObject(true);\r\n this.parent = null;\r\n }\r\n\r\n private parent: StringObjectInstance;\r\n position: THREE.Vector3;\r\n\r\n //Temporary: ModuleObjectIdString == null\r\n //joint: ModuleObjectIdString == Guid.Empty\r\n //moduleObject: ModuleObjectIdString == Guid\r\n get isTemporary() {\r\n return !this.ModuleObjectIdString;\r\n }\r\n\r\n setData(data: SolarProTool.IModuleConnectionJoint) {\r\n if (data) {\r\n this.position.set(data.X || 0, data.Y || 0, data.Z || 0);\r\n this.ModuleObjectIdString = data.ModuleObjectIdString || null;\r\n }\r\n }\r\n\r\n exportData(): SolarProTool.IModuleConnectionJoint {\r\n return {\r\n X: this.position.x,\r\n Y: this.position.y,\r\n Z: this.position.z,\r\n ModuleObjectIdString: this.ModuleObjectIdString\r\n };\r\n }\r\n }\r\n\r\n export interface IStringObjectIntersection extends IObjectIntersection {\r\n j1: StringJoint;\r\n j2?: StringJoint;\r\n }\r\n\r\n export class StringObjectInstance extends GenericObjectInstance {\r\n moveBy(v: THREE.Vector3): void {\r\n\r\n }\r\n\r\n GetPositionProperty(k: string): number {\r\n return 0;\r\n }\r\n\r\n GetSizeProperty(k: string): number {\r\n return 0;\r\n }\r\n\r\n constructor(id?: string) {\r\n super(id);\r\n this.renderOrder = LS.Client3DEditor.UIRenderOrder;\r\n this.drawAngled = LS.Electric.InvertersModel ? (!LS.Electric.InvertersModel.allowDiagonalLinesForStringing) : true;\r\n }\r\n\r\n private _stringColor = new THREE.Color();\r\n stringColor1: THREE.Color = new THREE.Color(0xff4116);\r\n stringColor2: THREE.Color = new THREE.Color(0xff4116);\r\n\r\n drawAngled: boolean = true;\r\n\r\n DiffusionPointObjectId: string = null;\r\n\r\n getDiffusionPointObject(): ClientObjectInstance {\r\n return this.DiffusionPointObjectId ? Controller.Current.Instances[this.DiffusionPointObjectId] : null;\r\n }\r\n\r\n searchClosestDiffusionPointObject() {\r\n var controller = Controller.Current,\r\n viewModel = controller.viewModel,\r\n stringingTool = viewModel.tools.stringingTool;\r\n\r\n var diffusionPointObjects = viewModel.selected.filter(o => o.clientObject.dataType.indexOf(\"DiffusionPointObject\") != -1);\r\n\r\n if (!diffusionPointObjects.length) {\r\n var allInstances = controller.Instances;\r\n for (var id in allInstances) {\r\n var inst = allInstances[id];\r\n if (inst && inst.clientObject.dataType.indexOf(\"DiffusionPointObject\") != -1)\r\n diffusionPointObjects.push(inst);\r\n }\r\n }\r\n\r\n if (!diffusionPointObjects.length)\r\n return null;\r\n\r\n var dist = Number.MAX_VALUE,\r\n bb = this._bounds,\r\n c = bb.getCenter(new THREE.Vector3()),\r\n diffPoint: ClientObjectInstance = null;\r\n\r\n for (var i = diffusionPointObjects.length; i--;) {\r\n var diffusionPointObject = diffusionPointObjects[i];\r\n var p = stringingTool.getPositionFromClientObjectInstance(diffusionPointObject);\r\n var d = c.distanceToSquared(p);\r\n if (d < dist) {\r\n dist = d;\r\n diffPoint = diffusionPointObject;\r\n }\r\n }\r\n\r\n return diffPoint;\r\n }\r\n\r\n setStringColor(s: string): void {\r\n this.stringColor1.setStyle(s);\r\n this.stringColor2.copy(this.stringColor1).offsetHSL(0, +0.3, +0.4);\r\n this._needsUpdate = true;\r\n }\r\n\r\n updateJointStringColors() {\r\n this.Joints.forEach(j => {\r\n if (j.ModuleObjectIdString)\r\n j.setStyleToClientObject();\r\n });\r\n }\r\n\r\n getColor(): THREE.Color {\r\n return this._stringColor.copy(this.stringColor1).lerp(this.stringColor2, this.isSelected ? 1 : (this.isHovered ? 0.5 : 0));\r\n }\r\n\r\n getAlpha(): number {\r\n return 1;//this.isSelected ? 1 : (this.isHovered ? 0.8 : 0.5);\r\n }\r\n\r\n getModulesStringObject(): LS.Electric.ModulesStringObject {\r\n var invertersModel = LS.Electric.InvertersModel;\r\n return invertersModel && invertersModel.getModulesStringObject(this.IdString);\r\n }\r\n\r\n modulesStringObjectValid() {\r\n var mso = this.getModulesStringObject();\r\n return !!mso && mso.CurrentModuleCount === mso.MaxModuleCount;\r\n }\r\n\r\n onJointChanged(j: StringJoint, idChanged?: boolean) {\r\n if (idChanged)\r\n this.onJointsChanged();\r\n this._needsUpdate = true;\r\n this._positionsChanged = true;\r\n }\r\n\r\n onJointsChanged() {\r\n var mso = this.getModulesStringObject(),\r\n controller = LS.Client3DEditor.Controller.Current,\r\n instances = controller && controller.Instances;\r\n if (instances && mso)\r\n mso.CurrentModuleCount = this.Joints.filter(j => j.ModuleObjectIdString && controller.Instances[j.ModuleObjectIdString]).length;\r\n\r\n this._needsUpdate = true;\r\n this._positionsChanged = true;\r\n }\r\n\r\n getJointByModuleId(moduleId: string) {\r\n if (this._isDisposed || !moduleId)\r\n return null;\r\n var res = this.Joints.filter(j => j.ModuleObjectIdString === moduleId);\r\n if (res.length)\r\n return res[0];\r\n return null;\r\n }\r\n\r\n getJointByIndex(idx: number) {\r\n if (this._isDisposed || idx < 0 || idx > this.Joints.length)\r\n return null;\r\n return this.Joints[idx];\r\n }\r\n\r\n getIndexOfJointByModuleId(modId: string) {\r\n if (this._isDisposed)\r\n return -1;\r\n\r\n var joints = this.Joints;\r\n for (var i = 0, l = joints.length; i < l; i++) {\r\n if (joints[i].ModuleObjectIdString === modId)\r\n return i;\r\n }\r\n\r\n return -1;\r\n }\r\n\r\n addJoint(p: THREE.Vector3, id?: string): StringJoint {\r\n if (this._isDisposed)\r\n return null;\r\n var jt = new StringJoint(p, id, this);\r\n this.Joints.push(jt);\r\n this.onJointsChanged();\r\n return jt;\r\n }\r\n\r\n prependJoint(p: THREE.Vector3, id?: string): StringJoint {\r\n if (this._isDisposed)\r\n return null;\r\n var jt = new StringJoint(p, id, this);\r\n this.Joints.unshift(jt);\r\n this.onJointsChanged();\r\n return jt;\r\n }\r\n\r\n removeAll(fn?: (item: StringJoint) => boolean): void {\r\n if (!fn) {\r\n this.Joints.splice(0, this.Joints.length).forEach(joint => {\r\n joint.dispose();\r\n });\r\n } else {\r\n this.Joints = this.Joints.filter(joint => {\r\n if (fn(joint)) {\r\n joint.dispose();\r\n return false;\r\n }\r\n return true;\r\n });\r\n }\r\n\r\n this.onJointsChanged();\r\n }\r\n\r\n removeRange(startIndex: number, count?: number) {\r\n if (this._isDisposed)\r\n return;\r\n\r\n if (count === undefined) {\r\n this.Joints.splice(startIndex).forEach(joint => {\r\n joint.dispose();\r\n });\r\n } else {\r\n this.Joints.splice(startIndex, count).forEach(joint => {\r\n joint.dispose();\r\n });\r\n }\r\n\r\n this.onJointsChanged();\r\n }\r\n\r\n removeJoint(joint: StringJoint): void {\r\n if (this._isDisposed || !joint)\r\n return;\r\n var index = this.Joints.indexOf(joint);\r\n if (index > -1)\r\n this.removeRange(index, 1);\r\n }\r\n\r\n cleanUp() {\r\n var joints = this.Joints.slice(),\r\n controller = LS.Client3DEditor.Controller.Current;\r\n for (var i = joints.length; i--;) {\r\n if (joints[i].isTemporary)\r\n this.removeJoint(joints[i]);\r\n }\r\n if (joints.every(jt => !jt.getClientObjectInstance(controller)))\r\n this.removeAll();\r\n }\r\n\r\n insertBefore(targetJoint: StringJoint, p: THREE.Vector3, id?: string): StringJoint {\r\n if (this._isDisposed || !targetJoint)\r\n return null;\r\n var jt: StringJoint = null;\r\n var index = this.Joints.indexOf(targetJoint);\r\n if (index > -1) {\r\n jt = new StringJoint(p, id, this);\r\n this.Joints.splice(index, 0, new StringJoint(p, id, this));\r\n }\r\n\r\n this.onJointsChanged();\r\n return jt;\r\n }\r\n\r\n Joints: StringJoint[] = [];\r\n\r\n _positionsChanged: boolean = true;\r\n\r\n _lineMesh: THREE.Mesh = null;\r\n _pointMesh: THREE.Mesh = null;\r\n\r\n _lineMat: THREE.Material = null;\r\n _pointMat: THREE.Material = null;\r\n\r\n _linesCount: number = 0;\r\n _pointsCount: number = 0;\r\n\r\n static LineThickness: number = 100;\r\n static PointRadius: number = 75;\r\n\r\n txtHolder: spt.ThreeJs.utils.SDFTextObjectInstances = null;\r\n\r\n private _bounds: THREE.Box3 = new THREE.Box3();\r\n private _boundingSphere: THREE.Sphere = new THREE.Sphere();\r\n\r\n clear() {\r\n if (this._isDisposed)\r\n return;\r\n\r\n this._lineMesh = null;\r\n this._pointMesh = null;\r\n\r\n if (this.txtHolder) {\r\n this.txtHolder.dispose();\r\n this.txtHolder = null;\r\n }\r\n\r\n spt.ThreeJs.utils.emptyObject3D(this, true, true, false);\r\n }\r\n\r\n build() {\r\n if (this._isDisposed)\r\n return;\r\n\r\n var joints = this.Joints,\r\n drawAngled = this.drawAngled,\r\n pointsCount = joints.length,\r\n linesCount = Math.max(0, pointsCount - 1);\r\n\r\n pointsCount = this._pointsCount = Math.ceil(pointsCount / 10) * 10;\r\n linesCount = this._linesCount = Math.ceil(linesCount / 10) * 10;\r\n\r\n this.clear();\r\n\r\n if (!this._lineMat) {\r\n this._lineMat = new THREE.BaseInstancedShader(new THREE.Color(0xFFCCCC), null, 0.8, false, true, true);\r\n this._lineMat.side = THREE.FrontSide;\r\n //this._lineMat.depthTest = false;\r\n //this._lineMat.depthWrite = false;\r\n }\r\n\r\n if (!this._pointMat) {\r\n var loader = new THREE.TextureLoader();\r\n var tex = loader.load(\"../../Content/images/icons/arrow64.png\", () => {\r\n LoaderManager.notifyResourceLoaded();\r\n });\r\n tex.anisotropy = Detector.webglParameters.maxAnisotropy || 1;\r\n tex.wrapS = tex.wrapT = THREE.RepeatWrapping;\r\n\r\n this._pointMat = new THREE.BaseInstancedShader(new THREE.Color(0xFFCCCC), tex, 0.8, false, true, false, true);\r\n this._pointMat.side = THREE.FrontSide;\r\n //this._pointMat.depthTest = false;\r\n //this._pointMat.depthWrite = false;\r\n }\r\n\r\n if (pointsCount > 0) {\r\n var pointGeo = (new THREE.InstancedBufferGeometry()).copy(new THREE.CircleBufferGeometry(StringObjectInstance.PointRadius, 16) as any);\r\n pointGeo.maxInstancedCount = pointsCount;\r\n var pointOffsets = new THREE.InstancedBufferAttribute(new Float32Array(pointsCount * 3), 3, false, 1);\r\n pointOffsets.setUsage(THREE.DynamicDrawUsage);\r\n var pointsRots = new THREE.InstancedBufferAttribute(new Float32Array(pointsCount * 4), 4, false, 1);\r\n pointsRots.setUsage(THREE.DynamicDrawUsage);\r\n pointGeo.setAttribute('offseti', pointOffsets);\r\n pointGeo.setAttribute('roti', pointsRots);\r\n\r\n var pointMesh = this._pointMesh = new THREE.Mesh(pointGeo, this._pointMat);\r\n pointMesh.position.setZ(10);\r\n this.add(pointMesh);\r\n }\r\n\r\n if (linesCount > 0) {\r\n if (drawAngled)\r\n linesCount *= 2;\r\n var linesOffsets = new THREE.InstancedBufferAttribute(new Float32Array(linesCount * 3), 3, false, 1);\r\n linesOffsets.setUsage(THREE.DynamicDrawUsage);\r\n var linesRots = new THREE.InstancedBufferAttribute(new Float32Array(linesCount * 4), 4, false, 1);\r\n linesRots.setUsage(THREE.DynamicDrawUsage);\r\n var linesScales = new THREE.InstancedBufferAttribute(new Float32Array(linesCount * 3), 3, false, 1);\r\n linesScales.setUsage(THREE.DynamicDrawUsage);\r\n\r\n var halfThickness = StringObjectInstance.LineThickness * 0.5;\r\n\r\n var lineGeo = new THREE.InstancedBufferGeometry();\r\n\r\n lineGeo.setAttribute('position', new THREE.BufferAttribute(new Float32Array([0, -halfThickness, 0, 1, -halfThickness, 0, 1, halfThickness, 0, 0, -halfThickness, 0, 1, halfThickness, 0, 0, halfThickness, 0]), 3));\r\n lineGeo.setAttribute('offseti', linesOffsets);\r\n lineGeo.setAttribute('roti', linesRots);\r\n lineGeo.setAttribute('scalei', linesScales);\r\n lineGeo.maxInstancedCount = linesCount;\r\n\r\n this.add(this._lineMesh = new THREE.Mesh(lineGeo, this._lineMat));\r\n }\r\n\r\n this._positionsChanged = true;\r\n }\r\n\r\n private static setBufferAttributesForLine = (() => {\r\n var _v1 = new THREE.Vector3();\r\n\r\n return (p1: THREE.Vector3, p2: THREE.Vector3, idx: number, offset: THREE.InstancedBufferAttribute, rot: THREE.InstancedBufferAttribute, scale: THREE.InstancedBufferAttribute) => {\r\n var d = _v1.copy(p2).sub(p1),\r\n len = d.length(),\r\n q = new THREE.Quaternion(),\r\n s = new THREE.Vector3(len, 1, 1);\r\n if (len > 0)\r\n q.setFromAxisAngle(new THREE.Vector3(0, 0, 1), Math.atan2(d.y, d.x));\r\n\r\n offset.setXYZ(idx, p1.x, p1.y, p1.z);\r\n rot.setXYZW(idx, q.x, q.y, q.z, q.w);\r\n scale.setXYZ(idx, s.x, s.y, s.z);\r\n\r\n return q;\r\n }\r\n })();\r\n\r\n update() {\r\n if (this._isDisposed || !this._needsUpdate || !this.Joints || !this.Joints.length)\r\n return;\r\n\r\n if (this.isHidden) {\r\n this.visible = false;\r\n this._needsUpdate = false;\r\n return;\r\n }\r\n\r\n var joints = this.Joints,\r\n drawAngled = this.drawAngled,\r\n pointsCount = joints.length,\r\n linesCount = Math.max(0, pointsCount - 1);\r\n\r\n if (!this._lineMesh || !this._pointMesh || this._linesCount < linesCount || this._pointsCount < pointsCount)\r\n this.build();\r\n\r\n var bounds = this._bounds,\r\n boundingSphere = this._boundingSphere;\r\n\r\n bounds.makeEmpty();\r\n\r\n if (!pointsCount) {\r\n this.visible = false;\r\n this._needsUpdate = false;\r\n return;\r\n }\r\n\r\n this.visible = true;\r\n\r\n if (this._positionsChanged) {\r\n\r\n var off = this.getPointOffset(),\r\n p1 = new THREE.Vector3(),\r\n p2 = new THREE.Vector3();\r\n\r\n if (linesCount) {\r\n if (drawAngled)\r\n linesCount *= 2;\r\n\r\n var lineMesh = this._lineMesh,\r\n pointMesh = this._pointMesh,\r\n pointGeo = pointMesh.geometry,\r\n pointOffset = pointGeo.getAttribute('offseti') as THREE.InstancedBufferAttribute,\r\n pointRot = pointGeo.getAttribute('roti') as THREE.InstancedBufferAttribute,\r\n lineGeo = lineMesh.geometry,\r\n lineOffset = lineGeo.getAttribute('offseti') as THREE.InstancedBufferAttribute,\r\n lineRot = lineGeo.getAttribute('roti') as THREE.InstancedBufferAttribute,\r\n lineScale = lineGeo.getAttribute('scalei') as THREE.InstancedBufferAttribute;\r\n\r\n pointGeo.maxInstancedCount = pointsCount;\r\n lineGeo.maxInstancedCount = linesCount;\r\n pointOffset.needsUpdate = true;\r\n pointRot.needsUpdate = true;\r\n lineOffset.needsUpdate = true;\r\n lineRot.needsUpdate = true;\r\n lineScale.needsUpdate = true;\r\n\r\n if (drawAngled) {\r\n var dir = spt.ThreeJs.utils.ToClosestAxis(new THREE.Vector3().subVectors(joints[1].position, joints[0].position)).setZ(0),\r\n p3 = new THREE.Vector3(1, 0, 0),\r\n halfThickness = StringObjectInstance.LineThickness * 0.5;\r\n\r\n //p2 -- p3 -- p1\r\n for (let i = 0, l = joints.length - 1; i <= l; i++) {\r\n p1.copy(joints[i].position).add(off);\r\n\r\n bounds.expandByPoint(p1);\r\n\r\n pointOffset.setXYZ(i, p1.x, p1.y, p1.z);\r\n\r\n if (i > 0) {\r\n var i2 = i - 1;\r\n\r\n p2.copy(joints[i2].position).add(off);\r\n\r\n p3.subVectors(p1, p2);\r\n\r\n var q: THREE.Quaternion;\r\n var idx = i2 * 2;\r\n\r\n if (Math.abs(p3.x) < 0.00001 || Math.abs(p3.y) < 0.00001) {\r\n p3.addVectors(p1, p2).multiplyScalar(0.5);\r\n\r\n StringObjectInstance.setBufferAttributesForLine(p1, p3, idx, lineOffset, lineRot, lineScale);\r\n q = StringObjectInstance.setBufferAttributesForLine(p3, p2, idx + 1, lineOffset, lineRot, lineScale);\r\n } else {\r\n var dt = dir.dot(p3.subVectors(p1, p2));\r\n if (dt < 0) {\r\n dir.set(-dir.y, dir.x, dir.z);\r\n dt = dir.dot(p3);\r\n }\r\n p3.copy(dir).multiplyScalar(dt).add(p2);\r\n\r\n StringObjectInstance.setBufferAttributesForLine(p1, p3, idx, lineOffset, lineRot, lineScale);\r\n p3.add(dir.multiplyScalar(dt < 0 ? -halfThickness : halfThickness));\r\n\r\n q = StringObjectInstance.setBufferAttributesForLine(p3, p2, idx + 1, lineOffset, lineRot, lineScale);\r\n }\r\n\r\n spt.ThreeJs.utils.ToClosestAxis(dir.subVectors(p1, p3));\r\n\r\n pointRot.setXYZW(i2, q.x, q.y, q.z, q.w);\r\n\r\n if (i === l) {\r\n pointRot.setXYZW(i, q.x, q.y, q.z, q.w);\r\n }\r\n }\r\n }\r\n } else {\r\n for (let i = 0, l = joints.length - 1; i <= l; i++) {\r\n p1.copy(joints[i].position).add(off);\r\n\r\n bounds.expandByPoint(p1);\r\n\r\n pointOffset.setXYZ(i, p1.x, p1.y, p1.z);\r\n\r\n //p2 -- p1\r\n if (i > 0) {\r\n var i2 = i - 1;\r\n\r\n p2.copy(joints[i2].position).add(off);\r\n\r\n var q = StringObjectInstance.setBufferAttributesForLine(p1, p2, i2, lineOffset, lineRot, lineScale);\r\n\r\n pointRot.setXYZW(i2, q.x, q.y, q.z, q.w);\r\n\r\n if (i === l) {\r\n pointRot.setXYZW(i, q.x, q.y, q.z, q.w);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n var pointMesh = this._pointMesh,\r\n pointGeo = pointMesh.geometry,\r\n pointOffset = pointGeo.getAttribute('offseti') as THREE.InstancedBufferAttribute,\r\n pointRot = pointGeo.getAttribute('roti') as THREE.InstancedBufferAttribute;\r\n\r\n pointGeo.maxInstancedCount = pointsCount;\r\n pointOffset.needsUpdate = true;\r\n pointRot.needsUpdate = true;\r\n\r\n pointGeo.maxInstancedCount = pointsCount;\r\n\r\n var r90 = 1/Math.sqrt(2);\r\n\r\n for (let i = 0, l = joints.length; i < l; i++) {\r\n p1.copy(joints[i].position).add(off);\r\n bounds.expandByPoint(p1);\r\n\r\n pointOffset.setXYZ(i, p1.x, p1.y, p1.z);\r\n pointRot.setXYZW(i, 0, 0, r90, r90);\r\n }\r\n }\r\n\r\n bounds.getBoundingSphere(boundingSphere);\r\n boundingSphere.radius += Math.max(StringObjectInstance.LineThickness, StringObjectInstance.PointRadius);\r\n boundingSphere.getBoundingBox(bounds);\r\n\r\n if (this._lineMesh)\r\n this._lineMesh.geometry.boundingSphere = boundingSphere;\r\n\r\n if (this._pointMesh)\r\n this._pointMesh.geometry.boundingSphere = boundingSphere;\r\n\r\n this._positionsChanged = false;\r\n }\r\n\r\n var col = this.getColor();\r\n var alpha = this.getAlpha();\r\n\r\n var lineMat = this._lineMat as LS.Client3DEditor.BaseInstancedShader;\r\n var pointMat = this._pointMat as LS.Client3DEditor.BaseInstancedShader;\r\n\r\n lineMat.color = col;\r\n pointMat.color = col;\r\n\r\n lineMat.alpha = alpha;\r\n pointMat.alpha = alpha;\r\n\r\n this._needsUpdate = false;\r\n }\r\n\r\n getBounds(): THREE.Box3 {\r\n return this._bounds;\r\n }\r\n getPointOffset(): THREE.Vector3 {\r\n var controller = LS.Client3DEditor.Controller.Current,\r\n joints = this.Joints;\r\n if (!joints || joints.length <= 1)\r\n return new THREE.Vector3();\r\n var joint = joints.find(jt => !!controller.Instances[jt.ModuleObjectIdString]) || joints[0];\r\n var x = (Math.abs(joint.position.y) * 0.05) % 200 - 100,\r\n y = (Math.abs(joint.position.x) * 0.05) % 200 - 100;\r\n return new THREE.Vector3(x, y, (x + y + 200) * 0.5);\r\n }\r\n getPoints(): THREE.Vector3[] {\r\n return this.Joints.map(j => j.position);\r\n }\r\n getLines(angled?: boolean): THREE.Line3[] {\r\n var result: THREE.Line3[] = [];\r\n this.iterateLines((p1, p2) => {\r\n result.push(new THREE.Line3(p1, p2));\r\n return true;\r\n });\r\n\r\n return result;\r\n }\r\n\r\n iterateLines(fn: (start: THREE.Vector3, end: THREE.Vector3, j1?: StringJoint, j2?: StringJoint) => boolean, angled?: boolean) {\r\n var joints = this.Joints,\r\n pointsCount = joints.length,\r\n p1 = new THREE.Vector3(),\r\n p2 = new THREE.Vector3();\r\n\r\n if (angled && pointsCount > 1) {\r\n var dir = spt.ThreeJs.utils.ToClosestAxis(new THREE.Vector3().subVectors(joints[1].position, joints[0].position)).setZ(0),\r\n p3 = new THREE.Vector3(1, 0, 0);\r\n\r\n //p2 -- p3 -- p1\r\n for (let i2 = 1, l = pointsCount; i2 < l; i2++) {\r\n let i = i2 - 1,\r\n j2 = joints[i],\r\n j1 = joints[i2];\r\n\r\n p2.copy(j2.position);\r\n p1.copy(j1.position);\r\n p3.subVectors(p1, p2);\r\n\r\n if (Math.abs(p3.x) < 0.00001 || Math.abs(p3.y) < 0.00001) {\r\n if (fn(p2, p1, j2, j1) === false)\r\n return;\r\n } else {\r\n var dt = dir.dot(p3.subVectors(p1, p2));\r\n if (dt < 0) {\r\n dir.set(-dir.y, dir.x, dir.z);\r\n dt = dir.dot(p3);\r\n }\r\n p3.copy(dir).multiplyScalar(dt).add(p2);\r\n\r\n if (fn(p2, p3, j2, j1) === false)\r\n return;\r\n if (fn(p3, p1, j2, j1) === false)\r\n return;\r\n }\r\n\r\n spt.ThreeJs.utils.ToClosestAxis(dir.subVectors(p1, p3));\r\n\r\n }\r\n } else {\r\n for (let i2 = 1; i2 < pointsCount; i2++) {\r\n let i = i2 - 1,\r\n j2 = joints[i],\r\n j1 = joints[i2];\r\n\r\n p2.copy(j2.position);\r\n p1.copy(j1.position);\r\n\r\n if (fn(p2, p1, j2, j1) === false)\r\n return;\r\n }\r\n }\r\n }\r\n\r\n getClosestPoint(p: THREE.Vector3, thresholdSq: number): IStringObjectIntersection {\r\n if (this._isDisposed || !this.visible)\r\n return null;\r\n\r\n var joints = this.Joints,\r\n pointsCount = joints.length,\r\n off = this.getPointOffset(),\r\n pos1 = new THREE.Vector3(),\r\n pos2 = new THREE.Vector3(),\r\n result = null as IStringObjectIntersection,\r\n closestDistance: number = Number.MAX_VALUE;\r\n\r\n if (pointsCount > 0) {\r\n joints.forEach((j, idx) => {\r\n if (!j.isTemporary) {\r\n pos1.copy(j.position).add(off).setZ(p.z);\r\n var jdsq = pos1.distanceToSquared(p);\r\n if (jdsq <= thresholdSq && jdsq < closestDistance) {\r\n closestDistance = jdsq;\r\n result = { o: this, p: pos1, distSq: jdsq, j1: j, idx: idx };\r\n }\r\n }\r\n });\r\n }\r\n\r\n if (result == null) {\r\n this.iterateLines((p1, p2, j1, j2) => {\r\n pos1.copy(p1).add(off).setZ(p.z);\r\n pos2.copy(p2).add(off).setZ(p.z);\r\n var cp = spt.ThreeJs.utils.GetClosestPointToLine(pos1, pos2, p),\r\n dsq = cp.p.distanceToSquared(p);\r\n if (dsq <= thresholdSq && dsq < closestDistance) {\r\n closestDistance = dsq;\r\n result = { o: this, p: cp.p, distSq: dsq, j1: j1, j2: j2, l: cp.l, idx: -1 };\r\n }\r\n return true;\r\n }, this.drawAngled);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n intersecsBox(searchBox: THREE.Box3) {\r\n if (!this._isDisposed && this.visible && this.Joints && this.Joints.length && this._bounds && this._bounds.intersectsBox(searchBox)) {\r\n var joints = this.Joints,\r\n pointsCount = joints.length,\r\n off = this.getPointOffset(),\r\n pos1 = new THREE.Vector3(),\r\n pos2 = new THREE.Vector3(),\r\n sphere = new THREE.Sphere(),\r\n pRadius = StringObjectInstance.PointRadius;\r\n\r\n if (joints.some(j => searchBox.intersectsSphere(sphere.set(pos1.copy(j.position).add(off), pRadius))))\r\n return true;\r\n\r\n var intersecs: boolean = false;\r\n this.iterateLines((p1, p2, j1, j2) => {\r\n pos1.copy(p1).add(off);\r\n pos2.copy(p2).add(off);\r\n\r\n //spt.ThreeJs.utils.BoxisIntersectingTriangle()\r\n\r\n if (spt.ThreeJs.utils.LineIntersecsBox(pos1, pos2, searchBox)) {\r\n intersecs = true;\r\n return false;\r\n }\r\n return true;\r\n }, this.drawAngled);\r\n\r\n return intersecs;\r\n }\r\n return false;\r\n }\r\n\r\n getClosestPointToRay(ray: THREE.Ray, threshold: number): IStringObjectIntersection {\r\n if (this._isDisposed || !this.visible)\r\n return null;\r\n var joints = this.Joints;\r\n\r\n if (joints.length <= 0)\r\n return null;\r\n\r\n var off = this.getPointOffset(),\r\n pos1 = new THREE.Vector3(),\r\n inter = ray.intersectPlane(new THREE.Plane().setFromNormalAndCoplanarPoint(new THREE.Vector3(0, 0, 1), pos1.copy(joints[0].position).add(off)), new THREE.Vector3());\r\n\r\n if (inter)\r\n return this.getClosestPoint(inter, threshold * threshold);\r\n\r\n return null;\r\n }\r\n\r\n getClosestJointToRay(ray: THREE.Ray, thresholdSq: number) {\r\n if (this._isDisposed || !this.visible)\r\n return null;\r\n\r\n var joints = this.Joints,\r\n pos1 = new THREE.Vector3(),\r\n pos2 = new THREE.Vector3(),\r\n off = this.getPointOffset(),\r\n result = null as StringJoint,\r\n closestDistance: number = Number.MAX_VALUE;\r\n\r\n if (joints.length <= 0)\r\n return null;\r\n\r\n joints.forEach(j => {\r\n var cp = ray.closestPointToPoint(pos1.copy(j.position).add(off), pos2),\r\n jdsq = pos1.distanceToSquared(cp);\r\n if (jdsq <= thresholdSq && jdsq < closestDistance) {\r\n closestDistance = jdsq;\r\n result = j;\r\n }\r\n });\r\n\r\n return result;\r\n }\r\n\r\n dispose() {\r\n if (!this._isDisposed) {\r\n var mso = this.getModulesStringObject();\r\n if (mso)\r\n mso.CurrentModuleCount = 0;\r\n this.removeAll();\r\n this.clear();\r\n this._isDisposed = true;\r\n }\r\n }\r\n\r\n getObjectHolder(): GenericObjectHolder {\r\n return LS.Client3DEditor.Controller.Current.stringObjectHolder;\r\n }\r\n\r\n save(showError?: boolean) {\r\n var controller = Controller.Current,\r\n viewModel = controller.viewModel,\r\n mso = this.getModulesStringObject();\r\n\r\n if (!mso || mso.CurrentModuleCount !== mso.MaxModuleCount) {\r\n if (showError && mso)\r\n DManager.ShowSmallInfo(window.electricTranslation[\"PolyDes_ElectricInputModuleInfo\"].replace(\"{0}\", \"\" + mso.MaxModuleCount));\r\n return;\r\n }\r\n\r\n var moduleObjects = this.Joints.map(j => j.getClientObjectInstance(controller)).filter(m => !!m);\r\n\r\n var diffusionPointObject = this.getDiffusionPointObject() || this.searchClosestDiffusionPointObject();\r\n\r\n if (!moduleObjects.length)\r\n return;\r\n\r\n //get baseparent id from modules\r\n\r\n var parentList: { [id: string]: number } = {};\r\n\r\n moduleObjects.forEach(m => {\r\n var bpId = m.clientObject.userData.BaseParentId;\r\n if (!parentList[bpId])\r\n parentList[bpId] = 0;\r\n parentList[bpId]++;\r\n });\r\n\r\n var baseParentId: string = null;\r\n var bpCount = 0;\r\n\r\n Object.keys(parentList).forEach(id => {\r\n if (parentList[id] > bpCount) {\r\n bpCount = parentList[id];\r\n baseParentId = id;\r\n }\r\n });\r\n\r\n var moduleObjectsIds = moduleObjects.map(m => m.instanceData.Id);\r\n var diffusionPointObjectId = this.DiffusionPointObjectId = diffusionPointObject ? diffusionPointObject.instanceData.Id : null;\r\n\r\n var joints = this.Joints.filter(j => !j.isTemporary).map(j => j.exportData());\r\n\r\n SolarProTool.Ajax(\"Areas/Electric/WebServices/ElectricServices.asmx\").Call(\"CreateModuleConnection\").Data({ moduleIds: moduleObjectsIds, diffusionPointId: diffusionPointObjectId || null, stringId: this.IdString, baseParentId: baseParentId, joints: joints }).CallBack((result) => {\r\n\r\n });\r\n }\r\n }\r\n\r\n export class StringObjectHolder extends GenericObjectHolder {\r\n\r\n getById(id: string): StringObjectInstance {\r\n if (!id)\r\n return null;\r\n var mObjs = this.children;\r\n for (var i = mObjs.length; i--;) {\r\n var mObj = mObjs[i] as StringObjectInstance;\r\n if (mObj.IdString === id)\r\n return mObj;\r\n }\r\n return null;\r\n }\r\n\r\n getAllStringObjects() {\r\n return this.children as StringObjectInstance[];\r\n }\r\n\r\n getJointByModuleId(modId: string) {\r\n if (!modId)\r\n return null;\r\n var mObjs = this.children;\r\n for (var i = mObjs.length; i--;) {\r\n var mObj = mObjs[i] as StringObjectInstance;\r\n var j = mObj.getJointByModuleId(modId);\r\n if (j)\r\n return j;\r\n }\r\n return null;\r\n }\r\n\r\n onObjectRemoved(so: StringObjectInstance) {\r\n SolarProTool.Ajax(\"Areas/Electric/WebServices/ElectricServices.asmx\").Call(\"DeleteModuleConnection\").Data({ stringId: so.IdString }).CallBack(() => {\r\n\r\n });\r\n }\r\n\r\n addNewStringObject(id: string): StringObjectInstance {\r\n var so = new StringObjectInstance(id);\r\n this.add(so);\r\n return so;\r\n }\r\n\r\n getClosestJointToRaycaster(raycaster: THREE.Raycaster, tolerance?: number) {\r\n var so = this.getByRaycaster(raycaster, tolerance);\r\n\r\n if (so && so.o && so.idx >= 0)\r\n return so.o.Joints[so.idx];\r\n\r\n //return so && so.o ? so.o.getClosestJointToRay(raycaster.ray, thresholdSq) : null;\r\n }\r\n }\r\n}","module LS.Client3DEditor {\r\n export interface IBaseChange {\r\n //update type\r\n type: string;\r\n oldValue?: string | number;\r\n newValue?: string | number;\r\n apply?: () => void;\r\n revert?: () => void;\r\n skipCheck: boolean;\r\n }\r\n \r\n export interface IIdObject {\r\n Id: string | number;\r\n }\r\n \r\n export interface IChangeEvent extends IBaseChange {\r\n //target of this change\r\n object: IIdObject;\r\n //property name that has been changed\r\n name?: string;\r\n //dataType of object\r\n dataType: string;\r\n }\r\n\r\n export interface IChange {\r\n Uuid: string;\r\n TypeString: string;\r\n UpdateType: string;\r\n IdStrings: string[];\r\n skipCheck?: boolean;\r\n NewValueString?: string;\r\n OldValueString?: string;\r\n Name?: string;\r\n apply?: () => void;\r\n revert?: () => void;\r\n ErrorCode?: number;\r\n ErrorMessage?: string;\r\n Tx?: number;\r\n Ty?: number;\r\n Tz?: number;\r\n Sx?: number;\r\n Sy?: number;\r\n }\r\n\r\n export interface IInstanceChanges {\r\n [key: string]: IBaseChange;\r\n X?: IBaseChange;\r\n Y?: IBaseChange;\r\n Z?: IBaseChange;\r\n SizeX?: IBaseChange;\r\n SizeY?: IBaseChange;\r\n }\r\n \r\n export interface IChangeProcessor {\r\n applyChanges: (change: IChange, revert?: boolean) => void;\r\n revertChanges: (change: IChange, revert?: boolean) => void;\r\n }\r\n\r\n export interface IChangeEventHandler {\r\n handle: (e: IChangeEvent) => string;\r\n }\r\n\r\n export enum ErrorLevel {\r\n NoError = 0,\r\n Fail, //Standard Error. No error message.\r\n Severe, //Big error message on screen\r\n Warning, //Big Info message on screen\r\n Info //Small info message on screen\r\n }\r\n\r\n export class UpdateManagerChangeEvent implements IChangeEvent {\r\n constructor(target: IInstanceData, type: string, key: string, old: string | number, v: string | number, skipCheck?: boolean) {\r\n this.object = target;\r\n this.type = type || \"update\";\r\n this.name = key || null;\r\n this.oldValue = old || null;\r\n this.newValue = v || null;\r\n this.skipCheck = !!skipCheck;\r\n }\r\n\r\n object: IInstanceData;\r\n type: string;\r\n skipCheck: boolean;\r\n name: string;\r\n oldValue: string | number;\r\n newValue: string | number;\r\n dataType: string;\r\n }\r\n\r\n var dynamicUpdateId = 0;\r\n\r\n var changeEvent = { type: 'change' };\r\n var clientObjectUpdateEvent = { type: 'clientObjectUpdate' };\r\n var handleClientObjectChangesEvent = { type: \"HandleClientObjectChanges\" };\r\n\r\n export class UpdateManager implements IEventManager {\r\n \r\n changeProcessor: { [updateType: string]: IChangeProcessor };\r\n changeEventHandler: { [updateType: string]: IChangeEventHandler };\r\n changeSets: IChange[][];\r\n pointer: number;\r\n tempChanges: { [dataType: string]: { [id: string]: { [key: string]: IBaseChange } } };\r\n needsUpdate: boolean;\r\n acceptChanges: boolean;\r\n isWaiting: boolean;\r\n doClearHistory: boolean;\r\n\r\n constructor() {\r\n this.changeSets = [];\r\n this.pointer = -1;\r\n this.tempChanges = {};\r\n this.needsUpdate = false;\r\n this.acceptChanges = true;\r\n this.isWaiting = false;\r\n this.doClearHistory = false;\r\n this.changeProcessor = {};\r\n this.changeEventHandler = {};\r\n\r\n this.init();\r\n }\r\n\r\n dynamicUpdate(apply: () => void, revert: () => void) {\r\n var id = dynamicUpdateId++;\r\n\r\n this.handleClientObjectUpdate({\r\n type: \"dynamic\",\r\n name: \"dynamic\",\r\n skipCheck: true,\r\n dataType: \"dynamic\",\r\n object: { Id: id },\r\n apply: apply,\r\n revert: revert\r\n });\r\n }\r\n\r\n //add to temporary changes. those will be summed for the next changeset and likely send to server\r\n handleClientObjectUpdate(e : IChangeEvent) {\r\n if (!this.acceptChanges)\r\n return;\r\n\r\n this.triggerEvent(clientObjectUpdateEvent);\r\n\r\n var data = e.object,\r\n id = data.Id,\r\n dataType = e.dataType,\r\n key = e.name;\r\n var tempChanges = this.tempChanges;\r\n\r\n if (!tempChanges[dataType])\r\n tempChanges[dataType] = {};\r\n var dt = tempChanges[dataType];\r\n\r\n if (!dt[id])\r\n dt[id] = {};\r\n var t = dt[id];\r\n\r\n if (this.changeEventHandler[e.type]) {\r\n key = this.changeEventHandler[e.type].handle(e) || key;\r\n }\r\n\r\n if (t[key])\r\n (t[key]).newValue = e.newValue;\r\n else {\r\n delete e.object;\r\n delete e.name;\r\n t[key] = e;\r\n }\r\n\r\n if (key === 'Id') {\r\n if (id !== e.newValue)\r\n dt[e.newValue] = dt[id];\r\n if (id !== e.oldValue)\r\n dt[e.oldValue] = dt[id];\r\n }\r\n\r\n this.needsUpdate = true;\r\n }\r\n\r\n //check changes and add a new changeset\r\n processChanges() {\r\n if (this.isWaiting)\r\n return;\r\n this.trimChangesets();\r\n var tempChanges = this.tempChanges,\r\n newChanges: IChange[] = [];\r\n for (var dataType in tempChanges) {\r\n var tChanges = tempChanges[dataType];\r\n var nChanges: IChange[] = [];\r\n for (var id in tChanges) {\r\n var instanceChanges = tChanges[id];\r\n\r\n var cKeys = Object.keys(instanceChanges);\r\n \r\n this.convertChangeEvents(cKeys, instanceChanges, id, dataType, nChanges);\r\n }\r\n if (!newChanges.length)\r\n newChanges = nChanges;\r\n else\r\n newChanges = newChanges.concat(nChanges);\r\n }\r\n if (newChanges.length) {\r\n this.changeSets.push(newChanges);\r\n this.pointer++;\r\n\r\n if (newChanges.some((c) => { return !c.skipCheck; })) {\r\n this.reviewChanges(newChanges.filter((c) => { return !c.skipCheck; }), false);\r\n }\r\n newChanges.forEach((c) => { delete c.skipCheck; });\r\n }\r\n this.tempChanges = {};\r\n this.needsUpdate = false;\r\n }\r\n\r\n registerChangeProcessor(name: string, applyFn: (change: IChange, revert?: boolean) => void, revertFn?: (change: IChange, revert?: boolean) => void) {\r\n this.changeProcessor[name] = {\r\n applyChanges: applyFn,\r\n revertChanges: revertFn || applyFn\r\n };\r\n }\r\n\r\n registerChangeEventHandler(name: string, handleFn: (e: IChangeEvent) => string) {\r\n this.changeEventHandler[name] = {\r\n handle: handleFn\r\n };\r\n }\r\n \r\n //remove all changesets after current pointer position\r\n trimChangesets() {\r\n var changeSets = this.changeSets,\r\n pointer = this.pointer + 1;\r\n if (changeSets.length > pointer)\r\n changeSets.splice(pointer, changeSets.length - pointer);\r\n }\r\n \r\n addListener(type: string, listener: (event: IEventManagerEvent) => void): EventManager { return this; }\r\n\r\n hasListener(type: string, listener: (event: IEventManagerEvent) => void): boolean { return false; }\r\n\r\n removeListener(type?: string, listener?: (event: IEventManagerEvent) => void): void { }\r\n\r\n dispatchEvent(event: IEventManagerEvent): void { }\r\n\r\n triggerEvent(event: IEventManagerEvent): void {\r\n this.dispatchEvent(event);\r\n this.onChanged();\r\n }\r\n\r\n onChanged() {\r\n this.dispatchEvent(changeEvent);\r\n }\r\n\r\n reviewChanges(newChanges: IChange[], revert: boolean): void {\r\n this.isWaiting = true;\r\n LoaderManager.addLoadingJob();\r\n //var stopwatch = new SCENE3D.Stopwatch().start();\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"HandleClientObjectChanges\").Data({changes: newChanges as any[], revert: false, disableSnapping: !!Controller.Current.viewModel.snappingDeactivated}).CallBack((modifiedChanges) => {\r\n //stopwatch.log(\"HandleClientObjectChanges\");\r\n if (modifiedChanges && modifiedChanges.length)\r\n this.handleModifiedChanges(modifiedChanges, false);\r\n this.isWaiting = false;\r\n Controller.Current.viewModel.checkSelection();\r\n this.triggerEvent(handleClientObjectChangesEvent);\r\n LoaderManager.finishLoadingJob();\r\n });\r\n }\r\n\r\n handleModifiedChanges(changes: IChange[] | SolarProTool.ClientObjectChanges[], revert: boolean) {\r\n var currentChanges = this.changeSets[this.pointer],\r\n removeChanges = [],\r\n newChanges = [],\r\n hasErrors = false;\r\n\r\n for (var i = 0, j = changes.length; i < j; i++) {\r\n var change = changes[i] as IChange;\r\n\r\n //check revert change\r\n if (change.ErrorCode != ErrorLevel.NoError) {\r\n hasErrors = true;\r\n if (change.Uuid) {\r\n for (var k = currentChanges.length; k--;) {\r\n var currChange = currentChanges[k];\r\n if (currChange.Uuid === change.Uuid) {\r\n removeChanges.push(currChange);\r\n currentChanges.splice(k, 1);\r\n break;\r\n }\r\n }\r\n }\r\n this.handleErrorChange(change);\r\n } else if (change.UpdateType && change.IdStrings && change.IdStrings.length) {\r\n newChanges.push(change);\r\n }\r\n }\r\n\r\n if (removeChanges.length) {\r\n if (revert)\r\n this.applyChanges(removeChanges, false);\r\n else\r\n this.revertChanges(removeChanges, false);\r\n }\r\n if (newChanges.length) {\r\n if (revert) {\r\n this.revertChanges(newChanges, false);\r\n for (var n = newChanges.length; n--;)\r\n this.changeSets[this.pointer].unshift(newChanges[n]);\r\n } else {\r\n this.applyChanges(newChanges, false);\r\n\r\n if (currentChanges) {\r\n //generate uuids before we add it to changesets\r\n for (var l = newChanges.length; l--;) {\r\n var nChange = newChanges[l];\r\n if (!nChange.Uuid)\r\n nChange.Uuid = THREE.MathUtils.generateUUID();\r\n }\r\n\r\n this.changeSets[this.pointer] = currentChanges.concat(newChanges);\r\n }\r\n }\r\n }\r\n if (!hasErrors)\r\n this.onNoError();\r\n }\r\n\r\n handleErrorChange(change: IChange) {\r\n switch (change.ErrorCode) {\r\n case ErrorLevel.Fail:\r\n //Silent fail, no error message\r\n break;\r\n case ErrorLevel.Severe:\r\n DManager.showErrorMessage(change.ErrorMessage || (\"Errorcode: \" + change.ErrorCode));\r\n break;\r\n case ErrorLevel.Warning:\r\n DManager.showInfoWindow(change.ErrorMessage || (\"Errorcode: \" + change.ErrorCode));\r\n break;\r\n case ErrorLevel.Info:\r\n DManager.ShowSmallInfo(change.ErrorMessage || (\"Errorcode: \" + change.ErrorCode), true);\r\n break;\r\n }\r\n\r\n }\r\n\r\n applyChanges(changes: IChange[], noIdChanges: boolean) {\r\n this.acceptChanges = false;\r\n\r\n for (var k = 0, l = changes.length; k < l; k++) {\r\n var change = changes[k];\r\n\r\n if (noIdChanges && change.UpdateType === 'update' && change.Name === 'Id')\r\n continue;\r\n this.changeProcessor[change.UpdateType].applyChanges(change, false);\r\n }\r\n\r\n this.acceptChanges = true;\r\n }\r\n\r\n revertChanges(changes: IChange[], noIdChanges: boolean) {\r\n this.acceptChanges = false;\r\n\r\n for (var i = changes.length; i--;) {\r\n var change = changes[i];\r\n if (noIdChanges && change.UpdateType === 'update' && change.Name === 'Id')\r\n continue;\r\n this.changeProcessor[change.UpdateType].revertChanges(change, true);\r\n }\r\n\r\n this.acceptChanges = true;\r\n }\r\n\r\n onNoError() {\r\n DManager.SmallInfoWindowClear();\r\n }\r\n\r\n clearHistory() {\r\n this.changeSets = [];\r\n this.pointer = -1;\r\n }\r\n\r\n update() {\r\n if (this.needsUpdate)\r\n this.processChanges();\r\n if (this.doClearHistory) {\r\n this.clearHistory();\r\n this.doClearHistory = false;\r\n }\r\n }\r\n\r\n insertSerializedInstance(sData: string) {\r\n var data = JSON.parse(sData);\r\n delete data.ModCount;\r\n delete data.Orientation;\r\n var clientObject = Controller.Current.Objects[data.ClientObjectInstance];\r\n if (clientObject)\r\n clientObject.insertClientObjectInstance(data);\r\n }\r\n\r\n deleteInstances(ids: number[] | string[]) {\r\n var instances = Controller.Current.Instances;\r\n (ids).forEach((id) => {\r\n instances[id].removeMe();\r\n });\r\n }\r\n\r\n ShrinkChanges(changes: IChange[]) {\r\n if (changes && changes.length > 1) {\r\n if (changes.every((change) => { return change.UpdateType === \"remove\"; })) {\r\n var typeDir = {};\r\n ArrayHelper.iterateArray(changes, (change) => {\r\n if (typeDir[change.TypeString] === undefined) {\r\n typeDir[change.TypeString] = {\r\n Uuid: null,//THREE.MathUtils.generateUUID(),\r\n TypeString: change.TypeString,\r\n UpdateType: change.UpdateType,\r\n IdStrings: change.IdStrings.slice(),\r\n skipCheck: !!change.skipCheck,\r\n NewValueString: null,\r\n OldValueString: null,\r\n Name: change.Name\r\n };\r\n } else {\r\n var idStrings = typeDir[change.TypeString].IdStrings;\r\n idStrings.push.apply(idStrings, change.IdStrings);\r\n }\r\n });\r\n return Object.keys(typeDir).map((k) => { return typeDir[k]; }) as IChange[];\r\n }\r\n }\r\n return changes;\r\n }\r\n\r\n Undo() {\r\n if (this.isWaiting || this.pointer < 0)\r\n return;\r\n var changes = this.changeSets[this.pointer];\r\n this.revertChanges(changes, true);\r\n var self = this;\r\n changes = changes.filter(ch => ch.UpdateType !== \"dynamic\");\r\n if (!changes.length) {\r\n self.pointer--;\r\n return;\r\n }\r\n this.isWaiting = true;\r\n LoaderManager.addLoadingJob();\r\n var viewModel = Controller.Current.viewModel;\r\n //var stopwatch = new SCENE3D.Stopwatch().start();\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"HandleClientObjectChanges\").Data({changes: changes as any[], revert: true, disableSnapping: !!Controller.Current.viewModel.snappingDeactivated}).CallBack((modifiedChanges) => {\r\n //stopwatch.log(\"HandleClientObjectChanges\");\r\n if (modifiedChanges && modifiedChanges.length)\r\n self.handleModifiedChanges(modifiedChanges, true);\r\n self.pointer--;\r\n self.isWaiting = false;\r\n viewModel.checkSelection();\r\n //if (changes.some(function(c) { return c.UpdateType === \"remove\"; })) {\r\n // //reload all since Errorcodes are wrong\r\n //}\r\n this.triggerEvent(handleClientObjectChangesEvent);\r\n LoaderManager.finishLoadingJob();\r\n });\r\n }\r\n\r\n Redo() {\r\n if (this.isWaiting || this.pointer >= this.changeSets.length - 1)\r\n return;\r\n this.pointer++;\r\n var changes = this.changeSets[this.pointer];\r\n this.applyChanges(changes, true);\r\n var self = this;\r\n changes = changes.filter(ch => ch.UpdateType !== \"dynamic\");\r\n if (!changes.length)\r\n return;\r\n this.isWaiting = true;\r\n LoaderManager.addLoadingJob();\r\n var viewModel = Controller.Current.viewModel;\r\n //var stopwatch = new SCENE3D.Stopwatch().start();\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"HandleClientObjectChanges\").Data({changes: this.ShrinkChanges(changes) as any[], revert: false, disableSnapping: !!Controller.Current.viewModel.snappingDeactivated}).CallBack((modifiedChanges) => {\r\n //stopwatch.log(\"HandleClientObjectChanges\");\r\n if (modifiedChanges && modifiedChanges.length)\r\n self.handleModifiedChanges(modifiedChanges, false);\r\n self.isWaiting = false;\r\n viewModel.checkSelection();\r\n this.triggerEvent(handleClientObjectChangesEvent);\r\n LoaderManager.finishLoadingJob();\r\n });\r\n }\r\n \r\n convertChangeEventsBase(keys: string[], instanceChanges: { [key: string]: IBaseChange }, id: string, dataType: string, output: IChange[]) {\r\n keys.forEach((key) => {\r\n var change = instanceChanges[key];\r\n var existing = false;\r\n for (var i = output.length; i--;) {\r\n var nChange = output[i];\r\n if (nChange.UpdateType === change.type && nChange.Name === key && nChange.NewValueString === change.newValue && nChange.OldValueString === change.oldValue) {\r\n nChange.IdStrings.push(id);\r\n existing = true;\r\n break;\r\n }\r\n }\r\n if (!existing) {\r\n output.push({\r\n Uuid: THREE.MathUtils.generateUUID(),\r\n TypeString: dataType,\r\n UpdateType: change.type,\r\n NewValueString: change.newValue !== undefined && change.newValue !== null ? change.newValue.toString() : null,\r\n OldValueString: change.oldValue !== undefined && change.oldValue !== null ? change.oldValue.toString() : null,\r\n Name: key,\r\n IdStrings: [id],\r\n skipCheck: !!change.skipCheck,\r\n apply: change.apply,\r\n revert: change.revert\r\n });\r\n }\r\n });\r\n }\r\n\r\n convertChangeEvents(keys: string[], instanceChanges: IInstanceChanges, id: string, dataType: string, output: IChange[]) {\r\n //move and scale change\r\n if (keys.some(key => key === \"X\" || key === \"Y\" || key === \"Z\" || key === \"SizeX\" || key === \"SizeY\")) {\r\n var tx = (instanceChanges.X ? Math.round((instanceChanges.X.newValue as number) - (instanceChanges.X.oldValue as number)) : 0);\r\n var ty = (instanceChanges.Y ? Math.round((instanceChanges.Y.newValue as number) - (instanceChanges.Y.oldValue as number)) : 0);\r\n var tz = (instanceChanges.Z ? Math.round((instanceChanges.Z.newValue as number) - (instanceChanges.Z.oldValue as number)) : 0);\r\n var sx = (instanceChanges.SizeX ? Math.round((instanceChanges.SizeX.newValue as number) - (instanceChanges.SizeX.oldValue as number)) : 0);\r\n var sy = (instanceChanges.SizeY ? Math.round((instanceChanges.SizeY.newValue as number) - (instanceChanges.SizeY.oldValue as number)) : 0);\r\n\r\n var existing = false;\r\n for (var i = output.length; i--;) {\r\n var nChange = output[i];\r\n if (nChange.UpdateType === \"translate\" && nChange.Tx === tx && nChange.Ty === ty && nChange.Tz === tz && nChange.Sx === sx && nChange.Sy === sy) {\r\n nChange.IdStrings.push(id);\r\n existing = true;\r\n break;\r\n }\r\n }\r\n if (!existing) {\r\n output.push({\r\n Uuid: THREE.MathUtils.generateUUID(),\r\n TypeString: dataType,\r\n UpdateType: \"translate\",\r\n Tx: tx,\r\n Ty: ty,\r\n Tz: tz,\r\n Sx: sx,\r\n Sy: sy,\r\n IdStrings: [id],\r\n skipCheck: false\r\n });\r\n }\r\n\r\n keys = keys.filter(key => key !== \"X\" && key !== \"Y\" && key !== \"Z\" && key !== \"SizeX\" && key !== \"SizeY\");\r\n }\r\n \r\n this.convertChangeEventsBase(keys, instanceChanges, id, dataType, output);\r\n }\r\n \r\n init() {\r\n var self = this;\r\n\r\n //change processors\r\n\r\n self.registerChangeProcessor('update', (change, revert) => {\r\n var instances = Controller.Current.Instances;\r\n change.IdStrings.forEach((id) => {\r\n var instance = instances[id];\r\n if (instance) {\r\n if (change.Name === 'Id') {\r\n if (revert) {\r\n if (!instance)\r\n instance = instances[change.NewValueString] || instances[change.OldValueString];\r\n delete instances[change.NewValueString];\r\n instances[change.OldValueString] = instance;\r\n } else {\r\n if (!instance)\r\n instance = instances[change.OldValueString] || instances[change.NewValueString];\r\n delete instances[change.OldValueString];\r\n instances[change.NewValueString] = instance;\r\n }\r\n }\r\n\r\n if (instance) {\r\n var val = revert ? change.OldValueString : change.NewValueString,\r\n dType = typeof instance.instanceData[change.Name];\r\n switch (dType) {\r\n case \"number\":\r\n instance.instanceData[change.Name] = parseFloat(val);\r\n break;\r\n case \"boolean\":\r\n instance.instanceData[change.Name] = val === \"true\" || val === \"1\";\r\n break;\r\n default:\r\n instance.instanceData[change.Name] = val;\r\n break;\r\n }\r\n }\r\n\r\n instance.OnChanged();\r\n }\r\n });\r\n });\r\n\r\n self.registerChangeProcessor('insert', (change) => {\r\n //apply\r\n self.insertSerializedInstance(change.NewValueString);\r\n }, (change) => {\r\n //revert\r\n self.deleteInstances(change.IdStrings);\r\n });\r\n\r\n self.registerChangeProcessor('remove', (change) => {\r\n //apply\r\n self.deleteInstances(change.IdStrings);\r\n }, (change) => {\r\n //revert\r\n self.insertSerializedInstance(change.OldValueString);\r\n });\r\n\r\n self.registerChangeProcessor('translate', (change: IChange, revert) => {\r\n var instances = Controller.Current.Instances;\r\n //apply\r\n change.IdStrings.forEach((id) => {\r\n var instance = instances[id];\r\n if (instance) {\r\n var tx = change.Tx, ty = change.Ty, tz = change.Tz;\r\n var sx = change.Sx || 0, sy = change.Sy || 0;\r\n if (revert) {\r\n instance.instanceData.X -= tx;\r\n instance.instanceData.Y -= ty;\r\n instance.instanceData.Z -= tz;\r\n instance.instanceData.SizeX -= sx;\r\n instance.instanceData.SizeY -= sy;\r\n } else {\r\n instance.instanceData.X += tx;\r\n instance.instanceData.Y += ty;\r\n instance.instanceData.Z += tz;\r\n instance.instanceData.SizeX += sx;\r\n instance.instanceData.SizeY += sy;\r\n }\r\n instance.OnChanged();\r\n }\r\n });\r\n });\r\n \r\n self.registerChangeProcessor('clearHistory', (change: IChange, revert) => {\r\n self.clearHistory();\r\n });\r\n\r\n self.registerChangeProcessor('dynamic', (change: IChange, revert) => {\r\n if (revert)\r\n change.revert();\r\n else\r\n change.apply();\r\n });\r\n\r\n //change event handlers\r\n\r\n self.registerChangeEventHandler('remove', (e: IChangeEvent) => {\r\n var data = (((e.object)));\r\n var d = (((data.clone())));\r\n var clientObject = (data.ClientObjectInstance as ClientObjectInstance).clientObject;\r\n d.ClientObjectInstance = (clientObject.id);\r\n d.ModCount = clientObject.userData.ModCount;\r\n d.Orientation = clientObject.userData.Orientation;\r\n //serialize removed object\r\n e.oldValue = JSON.stringify(d);\r\n return 'remove';\r\n });\r\n\r\n self.registerChangeEventHandler('insert', (e: IChangeEvent) => {\r\n var data = (((e.object)));\r\n var d = (((data.clone())));\r\n var clientObject = (data.ClientObjectInstance as ClientObjectInstance).clientObject;\r\n d.ClientObjectInstance = (clientObject.id);\r\n d.ModCount = clientObject.userData.ModCount;\r\n d.Orientation = clientObject.userData.Orientation;\r\n //serialize inserted object\r\n e.newValue = JSON.stringify(d);\r\n return 'insert';\r\n });\r\n\r\n self.registerChangeEventHandler('dynamic', (e: IChangeEvent) => {\r\n return 'dynamic';\r\n });\r\n }\r\n }\r\n\r\n EventManager.apply(UpdateManager.prototype);\r\n}","interface Window {\r\n initialStepsWidth?: number;\r\n initialStepsHeight?: number;\r\n}\r\n\r\nmodule LS.Client3DEditor {\r\n import ObservableValue = spt.Utils.ObservableValue;\r\n\r\n var startDragEvent = { type: 'startDrag' };\r\n var selectionChangedEvent = { type: 'selectionChanged' };\r\n var selectionUiChangedEvent = { type: 'selectionUiChanged' };\r\n var selectionNeedsUpdateEvent = { type: 'selectionNeedsUpdate' };\r\n var selectionUiNeedsUpdateEvent = { type: 'selectionUiNeedsUpdate' };\r\n var moduleAppearanceNeedsUpdateEvent = { type: 'moduleAppearanceNeedsUpdate' };\r\n var changeEvent = { type: 'change' };\r\n var toolChangedEvent = { type: 'toolChanged' };\r\n var mouseUpEvent = { type: 'mouseUp' };\r\n var mouseDownEvent = { type: 'mouseDown' };\r\n var beforeMouseMoveEvent = { type: 'beforeMouseMove' };\r\n var mouseMoveEvent = { type: 'mouseMove' };\r\n var keyDownEvent = { type: 'keyDown' };\r\n var keyUpEvent = { type: 'keyUp' };\r\n var dblclickEvent = { type: 'dblclick' };\r\n var beforeMouseDownEvent = { type: 'beforeMouseDown' };\r\n var afterMouseDownEvent = { type: 'afterMouseDown', ev: null };\r\n var applyEntryEvent = { type: 'applyEntry', data: null, source: null };\r\n\r\n export interface IViewLayer {\r\n Name: string;\r\n DisplayName: string;\r\n IconX: number;\r\n IconY: number;\r\n }\r\n\r\n export interface ISelectableUi {\r\n moveBy(v: THREE.Vector3): void;\r\n removeInstance(): void;\r\n GetPositionProperty(k: string): number;\r\n GetSizeProperty(k: string): number;\r\n isSelected: boolean;\r\n isHovered: boolean;\r\n _isDisposed: boolean;\r\n id: number;\r\n OnChanged(viewModel?: ViewModel): void;\r\n applyObjectPosition(): void;\r\n duplicate(count?: number, distance?: number, direction?: THREE.Vector3): void;\r\n rotateByPivot(pivot: THREE.Vector3, angleRad: number);\r\n getPivot(): THREE.Vector3;\r\n }\r\n\r\n export interface IParameterObject {\r\n setParameter(name: string, oldValue: any, newValue: any): void;\r\n getParameter(name: string): any;\r\n TypeName: string;\r\n }\r\n\r\n export class ViewModel implements IEventManager {\r\n ContainerWidth = 200;\r\n ContainerHeight = 200;\r\n\r\n pressedKeys: number[] = [];\r\n protected _selectedToolUri: string = null;\r\n //selected tool without parameters\r\n selectedTool: string = null;\r\n //selected tool with parameters\r\n selectedToolUri: string;\r\n tools: {\r\n [name: string]: ITool;\r\n addSpacingTool: AddSpacingTool;\r\n conduitTool: ConduitTool;\r\n stringingTool: StringingTool;\r\n } = {} as any;\r\n emptyTool: ITool = new EmptyTool();\r\n\r\n additionalViewmodels: { [name: string]: any } = {};\r\n\r\n isToolboxRowOrientation: boolean;\r\n isReadOnly: boolean;\r\n\r\n //mouse postion in range [-1, 1]\r\n readonly mouse: THREE.Vector2;\r\n readonly startMouse = new THREE.Vector2();\r\n\r\n //current dom mouse position\r\n readonly viewPosition = new ObservableVector2();\r\n //dom mouse on last mousedown\r\n readonly startViewPosition = new ObservableVector2();\r\n readonly diffViewPosition: ReadonlyVector2Property;\r\n\r\n view: JQuery = null;\r\n width = 0;\r\n height = 0;\r\n\r\n mouseDown = false;\r\n altDown = false;\r\n ctrlDown = false;\r\n shiftDown = false;\r\n spaceDown = false;\r\n hasFocus = false;\r\n disableMouseMove = false;\r\n cancelMouseDown = false;\r\n needsUpdate = false;\r\n\r\n readonly emptyInstance: InstanceContext = new InstanceContext(spt.Utils.GuidEmpty());\r\n readonly instances: InstanceContext[] = [];\r\n private activeInstance: InstanceContext = null;\r\n currentInstance: InstanceContext;\r\n private _highlightedInstance: InstanceContext = null;\r\n highlightedInstance: InstanceContext;\r\n readonly instancesById: { [id: string]: InstanceContext };\r\n\r\n Cursor: string = 'default';\r\n FlyoutVisible: boolean = false;\r\n ShowInverterFlyout: boolean = false;\r\n //EnableMultiEdit: boolean = false;\r\n selectInterferencesEnabled = true;//window.isDebugMode && window.currLogin === \"janh\";\r\n RoofAreaStartX: string;\r\n RoofAreaStartY: string;\r\n RoofAreaDistanceToRoofBorder: string;\r\n RoofOrientation: number;\r\n IsElevation: boolean;\r\n HasShadows: boolean;\r\n modulesCounter: { [id: string]: number } = {};\r\n modulesCount = 0;\r\n scaleLeftToRight: boolean = true;\r\n scaleBottomToUpper: boolean = true;\r\n selected: ClientObjectInstance[] = [];\r\n readonly selectedModules: number;\r\n selectedUi: ISelectableUi[] = [];\r\n selectionChanged: boolean = false;\r\n canSelect = false;\r\n //selecting via rectangle\r\n isSelecting = false;\r\n canDrag = false;\r\n //dragging instances\r\n isDragging = false;\r\n isScaling = false;\r\n scaleHelperObject: spt.ThreeJs.utils.edgeIntersectResult;\r\n canSnap = false;\r\n _snappingDeactivated = false;\r\n snappingDeactivated: boolean;\r\n hovered: ClientObjectInstance = null;\r\n\r\n filteredModuleTypes: string[] = [];\r\n\r\n readonly insertableClientObjects: ClientObject[];\r\n singleInsertableClientObjects: ClientObject[];\r\n readonly groupedInsertableClientObjects: ClientObject[][];\r\n readonly scaleInsertableClientObjects: ClientObject[];\r\n interferenceObjects: IDynamicInterferenceObject[] = [];\r\n readonly currentInterferenceObjects: IDynamicInterferenceObject[];\r\n readonly editableObjectsManager: EditableObjectsManager;\r\n showModuleAppearance = false;\r\n showRoofAppearance = false;\r\n showModulePlan = false;\r\n showEditorSettings = true;\r\n hideRoofAppearance = false;\r\n\r\n multiInterferenceView: MultiInterferenceObjectView;\r\n\r\n selectedInsertable: ClientObject = null;\r\n ModuleNominalPower: number;\r\n enableSnapping = true;\r\n private _selectionNeedsUpdate = false;\r\n private _selectionUiNeedsUpdate = false;\r\n private _moduleAppearanceNeedsUpdate = false;\r\n\r\n get selectionNeedsUpdate() {\r\n return this._selectionNeedsUpdate;\r\n }\r\n\r\n set selectionNeedsUpdate(b: boolean) {\r\n if (b)\r\n this.triggerEvent(selectionNeedsUpdateEvent);\r\n this._selectionNeedsUpdate = b;\r\n }\r\n\r\n get selectionUiNeedsUpdate() {\r\n return this._selectionUiNeedsUpdate;\r\n }\r\n\r\n set selectionUiNeedsUpdate(b: boolean) {\r\n if (b)\r\n this.triggerEvent(selectionUiNeedsUpdateEvent);\r\n this._selectionUiNeedsUpdate = b;\r\n }\r\n\r\n get moduleAppearanceNeedsUpdate() {\r\n return this._moduleAppearanceNeedsUpdate;\r\n }\r\n\r\n set moduleAppearanceNeedsUpdate(b: boolean) {\r\n if (b)\r\n this.triggerEvent(moduleAppearanceNeedsUpdateEvent);\r\n this._moduleAppearanceNeedsUpdate = b;\r\n }\r\n\r\n readonly keyBoardSteps: ObservableValue;\r\n readonly interferenceLineThickness: ObservableValue;\r\n readonly modulePower: string;\r\n //startRoofPosition --> roofPosition\r\n get diffRoofPosition(): ReadonlyVector3Property {\r\n return this.currentInstance.diffRoofPosition;\r\n }\r\n //diffRoofPosition after snapping\r\n get diffSnapPosition(): THREE.Vector3 {\r\n return this.currentInstance.diffSnapPosition;\r\n }\r\n get diffScale(): THREE.Vector3 {\r\n return this.currentInstance.diffScale;\r\n }\r\n get diffScalePosition(): THREE.Vector3 {\r\n return this.currentInstance.diffScalePosition;\r\n }\r\n //roof position on last mousedown\r\n readonly startRoofPosition = new ObservableVector3();\r\n //current mouse position on roof\r\n get roofPosition(): ObservableVector3 {\r\n return this.currentInstance.roofPosition;\r\n }\r\n //internal position of selection\r\n readonly _selectionPosition = new ObservableVector3();\r\n readonly ViewSelectionPosition: Vector3Property;\r\n readonly _selectionSize = new ObservableVector3();\r\n readonly ViewSelectionSize: Vector3Property;\r\n readonly showScaleXExtensionInputs: boolean;\r\n readonly showScaleYExtensionInputs: boolean;\r\n EditorViewMode: string = window.EditorViewMode;\r\n ViewLayers: IViewLayer[];\r\n private _currentViewLayerName: string = null;\r\n CurrentViewLayerName: string;\r\n CurrentViewLayer: IViewLayer;\r\n readonly currentRoofLayers: string[];\r\n measuredLength = 0;\r\n stepsWidth: number = window.initialStepsWidth || 0;\r\n stepsHeight: number = window.initialStepsHeight || 0;\r\n\r\n _moduleCellColor = '0b1b3c';\r\n _moduleFrameColor = 'b5b5b5';\r\n _moduleBacksheetColor = 'e5e5e5';\r\n _moduleCellType: ModuleCellType = ModuleCellType.Monocrystalline;\r\n _moduleCellcols = 6;\r\n _moduleCellrows = 10;\r\n _moduleFrameWidth = 20;\r\n\r\n ModuleCellColor: string;\r\n ModuleFrameColor: string;\r\n ModuleBacksheetColor: string;\r\n ModuleCellType: ModuleCellType;\r\n ModuleCellcols: number;\r\n ModuleCellrows: number;\r\n ModuleFrameWidth: number;\r\n availableCellTypes: string[] = [\r\n ModuleCellType[ModuleCellType.Monocrystalline],\r\n ModuleCellType[ModuleCellType.Polycrystalline],\r\n ModuleCellType[ModuleCellType.Thinfilm],\r\n ModuleCellType[ModuleCellType.Flat],\r\n ModuleCellType[ModuleCellType.Custom]\r\n ];\r\n availableCellNumbers: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18];\r\n\r\n readonly roofAppearance: SolarProTool.InstanceholderAppearance;\r\n\r\n align90Degree = false;\r\n keepDepth = false;\r\n\r\n slopeAdjustOpts: spt.Utils.IFloatFromInputOptions = {\r\n notImperial: true,\r\n precision: 3\r\n };\r\n\r\n valueAdjustOpts: spt.Utils.IFloatFromInputOptions = {\r\n notImperial: true,\r\n precision: window.UseImperialSystem || window.usemeteronroof ? 3 : 0,\r\n from: \"mm\",\r\n to: window.UseImperialSystem ? \"ft\" : (window.usemeteronroof ? \"m\" : \"mm\")\r\n };\r\n\r\n scaleAdjustOpts: spt.Utils.IFloatFromInputOptions = {\r\n notImperial: true,\r\n precision: 2,\r\n scale: 100\r\n };\r\n\r\n rotateAdjustOpts: spt.Utils.IFloatFromInputOptions = {\r\n notImperial: true,\r\n precision: 2\r\n };\r\n\r\n setRotation(o: any, k: string, v: number) {\r\n var r = spt.Utils.GetFloatFromInputValue(\"\" + v,\r\n {\r\n min: -360,\r\n max: 360,\r\n applyArithmetic: true,\r\n notImperial: true\r\n });\r\n\r\n o[k] = r;\r\n }\r\n\r\n setScale(o: any, k: string, v: number) {\r\n var s = spt.Utils.GetFloatFromInputValue(\"\" + v,\r\n {\r\n min: 0,\r\n max: 1000000,\r\n applyArithmetic: true,\r\n notImperial: true,\r\n scale: 1 / 100\r\n });\r\n\r\n o[k] = s;\r\n }\r\n\r\n setLength(o: any, k: string, v: number) {\r\n var s = spt.Utils.GetFloatFromInputValue(\"\" + v,\r\n {\r\n min: -1000000,\r\n max: 1000000,\r\n applyArithmetic: true,\r\n isFeet: window.UseImperialSystem,\r\n notImperial: !window.UseImperialSystem,\r\n from: this.valueAdjustOpts.to,\r\n to: \"mm\"\r\n });\r\n\r\n o[k] = s;\r\n }\r\n\r\n readonly selectedBounds: ObservableBounds;\r\n\r\n genericParameters: GenericParamsObject = new GenericParamsObject();\r\n moduleMetaEdit: ModuleMetaEdit = new ModuleMetaEdit();\r\n\r\n constructor() {\r\n ko.defineProperty(this, 'selectedToolUri', {\r\n get: () => {\r\n return this._selectedToolUri;\r\n },\r\n set: (newTool: string) => {\r\n var oldTool = this.selectedTool;\r\n\r\n //seperate params from uri\r\n var uri = spt.Utils.SeperateUriParameters(newTool);\r\n if (uri != null)\r\n newTool = uri.target;\r\n\r\n if (newTool === oldTool && (uri == null || uri.params == null))\r\n return;\r\n\r\n if (typeof oldTool === \"string\" && this.tools[oldTool]) {\r\n this.tools[oldTool].onDeselect(this);\r\n }\r\n\r\n this._selectedToolUri = uri != null ? uri.uri : newTool;\r\n this.selectedTool = newTool;\r\n\r\n if (typeof newTool === \"string\" && this.tools[newTool]) {\r\n var tool = this.tools[newTool];\r\n $(this.view).css('cursor', tool.cursor);\r\n tool.onSelect(this, uri != null ? uri.params : null);\r\n } else\r\n $(this.view).css('cursor', 'default');\r\n\r\n this.triggerEvent(toolChangedEvent);\r\n }\r\n });\r\n\r\n ko.getObservable(this, 'selectedToolUri').extend({ notify: 'always' });\r\n\r\n ko.defineProperty(this, 'isToolboxRowOrientation', {\r\n get: () => {\r\n let $aoMapDrawer = $('#root-aoMapDrawer');\r\n let direction = $aoMapDrawer.css('flex-direction');\r\n return direction === 'row';\r\n }\r\n });\r\n\r\n ko.getObservable(this, 'isToolboxRowOrientation').extend({ notify: 'always' });\r\n\r\n ko.track(this);\r\n\r\n var roofAppearance: SolarProTool.InstanceholderAppearance = {\r\n AoBaseColor: -5363199,\r\n AoFlatColor: -4144960,\r\n AoBorderColor: -16744448,\r\n AoAtticaColor: -7829368,\r\n AoBeamColor: -256,\r\n AoRafterColor: -1,\r\n AoAreaBorderColor: -1,\r\n AoShowWindzoneAreas: true,\r\n AoShowRafterAndBeams: true,\r\n AoShowWindZoneStrings: true\r\n };\r\n\r\n ko.track(roofAppearance);\r\n\r\n Object.keys(roofAppearance).forEach(k => {\r\n if (k.endsWith(\"Color\")) {\r\n var tc = new THREE.Color();\r\n ko.defineProperty(roofAppearance, k + \"Hex\" as any, {\r\n get: () => {\r\n return tc.set(roofAppearance[k]).getHexString();\r\n },\r\n set: (v: string) => {\r\n if (v && v.length && v.charAt(0) === '#')\r\n v = v.substr(1);\r\n v = v.toLowerCase();\r\n\r\n roofAppearance[k] = 255 << 24 ^ (tc.set(\"#\" + v).getHex());\r\n }\r\n });\r\n }\r\n });\r\n\r\n this.roofAppearance = roofAppearance;\r\n\r\n let _mouse = new THREE.Vector2();\r\n\r\n //mouse postion in range [-1, 1]\r\n ko.defineProperty(this, 'mouse', () => {\r\n return _mouse.set((this.viewPosition.x / this.width) * 2 - 1, -(this.viewPosition.y / this.height) * 2 + 1);\r\n });\r\n\r\n this.diffViewPosition = new ReadonlyVector2Property((k) => {\r\n return this.viewPosition[k] - this.startViewPosition[k];\r\n });\r\n\r\n ko.defineProperty(this, 'currentInstance',\r\n {\r\n get: () => {\r\n return this.activeInstance || (this.instances.length ? this.instances[0] : this.emptyInstance);\r\n },\r\n set: (v) => {\r\n this.activeInstance = v || null;\r\n this.highlightedInstance = null;\r\n }\r\n });\r\n\r\n ko.defineProperty(this, 'highlightedInstance',\r\n {\r\n get: () => {\r\n return this._highlightedInstance;\r\n },\r\n set: (v) => {\r\n if (this._highlightedInstance)\r\n this._highlightedInstance.highlighted = false;\r\n\r\n this._highlightedInstance = v || null;\r\n\r\n if (this._highlightedInstance)\r\n this._highlightedInstance.highlighted = true;\r\n }\r\n });\r\n\r\n ko.defineProperty(this, 'instancesById', () => {\r\n var kv: { [id: string]: InstanceContext } = {};\r\n this.instances.forEach(inst => {\r\n kv[inst.Id] = inst;\r\n });\r\n return kv;\r\n });\r\n\r\n //tools\r\n Object.keys(LS.Client3DEditor).filter((n) => (LS.Client3DEditor[n]).prototype instanceof BaseTool).forEach(n => {\r\n var nLower = n.charAt(0).toLowerCase() + n.slice(1);\r\n this.tools[nLower] = new LS.Client3DEditor[n]() as ITool;\r\n });\r\n\r\n //ModuleFrameColor: string;\r\n //ModuleBacksheetColor: string;\r\n\r\n ko.defineProperty(this, \"currentInterferenceObjects\", () => {\r\n //if (this.EnableMultiEdit)\r\n // return this.interferenceObjects;\r\n if (!this.currentInstance || !this.currentInstance.Id)\r\n return [];\r\n var curId = this.currentInstance.Id.toLowerCase();\r\n return this.interferenceObjects.filter(o => o && o.BaseParentId === curId);\r\n });\r\n\r\n this.multiInterferenceView = new MultiInterferenceObjectView(this);\r\n\r\n ko.defineProperty(this, \"snappingDeactivated\",\r\n {\r\n get: () => this._snappingDeactivated || this.selectedTool === \"addSpacingTool\",\r\n set: (v) => { this._snappingDeactivated = v; }\r\n });\r\n\r\n ko.defineProperty(this, \"insertableClientObjects\", () => this.currentInstance.insertableClientObjects);\r\n ko.defineProperty(this, \"scaleInsertableClientObjects\", () => this.currentInstance.scaleInsertableClientObjects);\r\n ko.defineProperty(this, \"singleInsertableClientObjects\", () => this.currentInstance.insertableClientObjects\r\n .filter(co => !co.userData.GroupIconInsert)\r\n .filter(obj => !this.filteredModuleTypes.includes(obj.dataType)));\r\n ko.defineProperty(this, \"groupedInsertableClientObjects\", () => {\r\n return ArrayHelper.groupBy(this.insertableClientObjects.filter(co => co.userData.GroupIconInsert), (co: ClientObject) => co.dataType);\r\n });\r\n ko.defineProperty(this, \"RoofAreaStartX\", { get: () => this.currentInstance.RoofAreaStartX, set: (v) => { this.currentInstance.RoofAreaStartX = v; } });\r\n ko.defineProperty(this, \"RoofAreaStartY\", { get: () => this.currentInstance.RoofAreaStartY, set: (v) => { this.currentInstance.RoofAreaStartY = v; } });\r\n ko.defineProperty(this, \"RoofAreaDistanceToRoofBorder\", { get: () => this.currentInstance.RoofAreaDistanceToRoofBorder, set: (v) => { this.currentInstance.RoofAreaDistanceToRoofBorder = v; } });\r\n ko.defineProperty(this, \"RoofOrientation\", { get: () => this.currentInstance.RoofOrientation, set: (v) => { this.currentInstance.RoofOrientation = v; } });\r\n ko.defineProperty(this, \"IsElevation\", { get: () => this.currentInstance.IsElevation, set: (v) => { this.currentInstance.IsElevation = v; } });\r\n ko.defineProperty(this, \"HasShadows\", { get: () => this.currentInstance.HasShadows, set: (v) => { this.currentInstance.HasShadows = v; } });\r\n ko.defineProperty(this, \"ModuleNominalPower\", { get: () => this.currentInstance.ModuleNominalPower, set: (v) => { this.currentInstance.ModuleNominalPower = v; } });\r\n ko.defineProperty(this, \"currentRoofLayers\", () => this.currentInstance.currentRoofLayers);\r\n\r\n ko.defineProperty(this, \"ModuleCellColor\", {\r\n get: () => {\r\n return this._moduleCellColor;\r\n },\r\n set: (v: string) => {\r\n if (v && v.length && v.charAt(0) === '#')\r\n v = v.substr(1);\r\n v = v.toLowerCase();\r\n if (this._moduleCellColor !== v) {\r\n this._moduleCellColor = v;\r\n //this.moduleAppearanceNeedsUpdate = true;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"ModuleFrameColor\", {\r\n get: () => {\r\n return this._moduleFrameColor;\r\n },\r\n set: (v: string) => {\r\n if (v && v.length && v.charAt(0) === '#')\r\n v = v.substr(1);\r\n v = v.toLowerCase();\r\n if (this._moduleFrameColor !== v) {\r\n this._moduleFrameColor = v;\r\n //this.moduleAppearanceNeedsUpdate = true;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"ModuleBacksheetColor\", {\r\n get: () => {\r\n return this._moduleBacksheetColor;\r\n },\r\n set: (v: string) => {\r\n if (v && v.length && v.charAt(0) === '#')\r\n v = v.substr(1);\r\n v = v.toLowerCase();\r\n if (this._moduleBacksheetColor !== v) {\r\n this._moduleBacksheetColor = v;\r\n //this.moduleAppearanceNeedsUpdate = true;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"ModuleCellType\", {\r\n get: () => {\r\n return ModuleCellType[this._moduleCellType] as any;\r\n },\r\n set: (v) => {\r\n var t = parseInt(ModuleCellType[v]);\r\n if (this._moduleCellType != t) {\r\n this._moduleCellType = t;\r\n //this.moduleAppearanceNeedsUpdate = true;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"ModuleCellcols\", {\r\n get: () => {\r\n return this._moduleCellcols;\r\n },\r\n set: (v) => {\r\n var n = parseInt(v);\r\n if (this._moduleCellcols != n) {\r\n this._moduleCellcols = n;\r\n //this.moduleAppearanceNeedsUpdate = true;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"ModuleCellrows\", {\r\n get: () => {\r\n return this._moduleCellrows;\r\n },\r\n set: (v) => {\r\n var n = parseInt(v);\r\n if (this._moduleCellrows != n) {\r\n this._moduleCellrows = n;\r\n //this.moduleAppearanceNeedsUpdate = true;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"ModuleFrameWidth\", {\r\n get: () => {\r\n return this._moduleFrameWidth;\r\n },\r\n set: (v) => {\r\n var n = parseFloat((\"\" + v).replace(\",\", \".\"));\r\n if (!isNaN(n) && isFinite(n)) {\r\n n = Math.min(200, Math.max(0, n));\r\n if (this._moduleFrameWidth !== n) {\r\n this._moduleFrameWidth = n;\r\n //this.moduleAppearanceNeedsUpdate = true;\r\n }\r\n }\r\n }\r\n });\r\n\r\n let _vsp1 = new THREE.Vector3(),\r\n _b = new ObservableBounds(),\r\n _box1 = new THREE.Box3(),\r\n _v1 = new THREE.Vector3(),\r\n _selectionSize = this._selectionSize;\r\n\r\n ko.defineProperty(this, 'selectedBounds', () => {\r\n //TODO non-blocking\r\n var selected = this.selected, len = selected.length;\r\n if (len) {\r\n var selBounds = _box1.makeEmpty();\r\n ArrayHelper.iterateArray(selected, (sel) => {\r\n sel.updateSelectionBounds(selBounds);\r\n });\r\n this._selectionPosition.set(selBounds.min.x, selBounds.min.y, selBounds.min.z);\r\n\r\n _b.set(selBounds.min.x, selBounds.min.y, selBounds.min.z, selBounds.max.x - selBounds.min.x, selBounds.max.y - selBounds.min.y, selBounds.max.z - selBounds.min.z);\r\n }\r\n else {\r\n\r\n var selectedUi = this.selectedUi, len = selectedUi.length;\r\n\r\n if (len) {\r\n\r\n var selBounds = _box1.makeEmpty();\r\n ArrayHelper.iterateArray(selectedUi, (sel) => {\r\n var w = sel.GetSizeProperty(\"x\"),\r\n h = sel.GetSizeProperty(\"y\");\r\n\r\n if (w > 0 || h > 0) {\r\n var x = sel.GetPositionProperty(\"x\"),\r\n y = sel.GetPositionProperty(\"y\");\r\n\r\n selBounds.expandByPoint(_v1.set(x, y, 0));\r\n selBounds.expandByPoint(_v1.set(x + w, y + h, 0));\r\n }\r\n });\r\n\r\n if (!selBounds.isEmpty()) {\r\n this._selectionPosition.set(selBounds.min.x, selBounds.min.y, selBounds.min.z);\r\n\r\n _b.set(selBounds.min.x, selBounds.min.y, selBounds.min.z, selBounds.max.x - selBounds.min.x, selBounds.max.y - selBounds.min.y, selBounds.max.z - selBounds.min.z);\r\n } else {\r\n this._selectionPosition.set(0, 0, 0);\r\n\r\n _b.set(0, 0, 0, 0, 0, 0);\r\n }\r\n\r\n } else {\r\n this._selectionPosition.set(0, 0, 0);\r\n\r\n _b.set(0, 0, 0, 0, 0, 0);\r\n }\r\n }\r\n this.selectionChanged = true;\r\n _selectionSize.set(_b.w, _b.h, _b.d)\r\n return _b;\r\n });\r\n\r\n ko.defineProperty(this, 'selectedModules', () => {\r\n return this.selected.reduce((pv, ci) => {\r\n if (ci && !ci._isDisposed && ci.clientObject && ci.clientObject.userData)\r\n return pv + ci.clientObject.userData.NumModules;\r\n return pv;\r\n }, 0);\r\n });\r\n\r\n ko.defineProperty(this, 'modulePower', () => {\r\n var modCount = this.modulesCount;\r\n return (Math.round((this.ModuleNominalPower * modCount) / 10) / 100) + \" kWp (\" + modCount + \" M)\";\r\n });\r\n\r\n ko.defineProperty(this, 'ViewLayers', () => window.EditorViewLayers[this.EditorViewMode] || []);\r\n\r\n ko.defineProperty(this, 'CurrentViewLayerName',\r\n {\r\n get: () => {\r\n return this._currentViewLayerName && this.ViewLayers.some(vl => vl.Name === this._currentViewLayerName)\r\n ? this._currentViewLayerName\r\n : this.ViewLayers.length\r\n ? this.ViewLayers[0].Name\r\n : null;\r\n },\r\n set: (v) => {\r\n this._currentViewLayerName = v || null;\r\n }\r\n });\r\n\r\n ko.defineProperty(this, 'CurrentViewLayer', () => this.CurrentViewLayerName ? this.ViewLayers.filter(vl => vl.Name === this.CurrentViewLayerName)[0] : null);\r\n\r\n ko.defineProperty(this, 'showScaleXExtensionInputs', () => {\r\n return this.selected.length > 0 && this.selected[0].clientObject.canBeScaledX;\r\n });\r\n\r\n ko.defineProperty(this, 'showScaleYExtensionInputs', () => {\r\n return this.selected.length > 0 && this.selected[0].clientObject.canBeScaledY;\r\n });\r\n\r\n ko.track(this);\r\n\r\n ko.getObservable(this, 'EditorViewMode').subscribe(() => {\r\n this._currentViewLayerName = null;\r\n });\r\n\r\n //editable position of selection\r\n this.ViewSelectionPosition = new Vector3Property((k) => {\r\n //postionable UI selected\r\n if (this.selectedUi.length) {\r\n var min = Infinity, max = -Infinity;\r\n for (var i = 0, j = this.selectedUi.length; i < j; i++) {\r\n var p = this.selectedUi[i].GetPositionProperty(k);\r\n if (p !== null) {\r\n min = Math.min(p, min);\r\n max = Math.max(p, max);\r\n }\r\n }\r\n if (isFinite(min))\r\n return spt.Utils.ApplyNumberconstraints(mmToImperial((max + min) / 2), { precision: 0 });\r\n return \"-\";\r\n }\r\n //clientobject instances selected\r\n return spt.Utils.ApplyNumberconstraints(mmToImperial(this._selectionPosition[k]), { precision: 0 });\r\n },\r\n (k, v) => {\r\n\r\n var val = spt.Utils.ApplyNumberconstraints(ImperialTomm(spt.Utils.ApplyNumberArithmetic(v, false)), { precision: 0 });\r\n\r\n if (this.selectedUi.length) {\r\n var min = Infinity, max = -Infinity;\r\n for (var i = 0, j = this.selectedUi.length; i < j; i++) {\r\n var p = this.selectedUi[i].GetPositionProperty(k);\r\n if (p !== null) {\r\n min = Math.min(p, min);\r\n max = Math.max(p, max);\r\n }\r\n }\r\n if (isFinite(min)) {\r\n _vsp1.set(0, 0, 0);\r\n _vsp1[k] = val - ((max + min) / 2);\r\n } else {\r\n ko.getObservable(this.ViewSelectionPosition, k).notifySubscribers(0);\r\n return;\r\n }\r\n } else {\r\n _vsp1.copy(this._selectionPosition);\r\n _vsp1[k] = val;\r\n _vsp1.sub(this._selectionPosition);\r\n }\r\n\r\n this._selectionPosition[k] = val;\r\n\r\n Controller.Current.moveSelectedStatic(_vsp1.x, _vsp1.y, _vsp1.z, true, true);\r\n\r\n //ko.getObservable(this, 'selected').notifySubscribers(this.selected);\r\n //ko.getObservable(this._selectionPosition, k).valueHasMutated();\r\n });\r\n\r\n //editable size of selection\r\n\r\n this.ViewSelectionSize = new Vector3Property((k) => {\r\n return spt.Utils.ApplyNumberconstraints(mmToImperial(_selectionSize[k]), { precision: 0 });\r\n },\r\n (k, v) => {\r\n\r\n var len = _selectionSize[k];\r\n var lenNew = spt.Utils.ApplyNumberconstraints(ImperialTomm(spt.Utils.ApplyNumberArithmetic(v, false)), { precision: 0 });\r\n\r\n _selectionSize[k] = lenNew;\r\n\r\n Controller.Current.scaleSelectedStatic(len, lenNew, k === \"x\" ? (this.scaleLeftToRight ? 1 : -1) : 0, k === \"y\" ? (this.scaleBottomToUpper ? 1 : -1) : 0);\r\n\r\n });\r\n\r\n if (!$(\"#refreshPrinfo\").length) {\r\n ko.getObservable(this, 'modulePower').subscribe((v) => {\r\n if (window.EditorViewMode === \"Anordnung\")\r\n $('#prinfo_power').text(v);\r\n });\r\n }\r\n\r\n ko.getObservable(this, 'stepsWidth').extend({ IntMinMax: { min: 0 }, notify: 'always' });\r\n ko.getObservable(this, 'stepsHeight').extend({ IntMinMax: { min: 0 }, notify: 'always' });\r\n\r\n //selection handling\r\n ko.getObservable(this, 'selected').subscribe(this.onSelectedChanged.bind(this), null, \"arrayChange\");\r\n\r\n ko.getObservable(this, 'selectedUi').subscribe(this.onSelectedUiChanged.bind(this), null, \"arrayChange\");\r\n\r\n ko.getObservable(this, 'HasShadows').subscribe((v) => {\r\n Controller.Current.showShadowLegend(v);\r\n });\r\n\r\n this.keyBoardSteps = new ObservableValue(50, { internalUnit: \"mm\", viewUnit: UseImperialSystem ? \"in\" : \"mm\", precision: 2 });\r\n this.interferenceLineThickness = new ObservableValue(250, { internalUnit: \"mm\", viewUnit: UseImperialSystem ? \"in\" : \"mm\", precision: 2 });\r\n\r\n //logObservableChanges(this, 'selectedInsertable');\r\n //logObservableChanges(this, 'canSelect');\r\n\r\n this.editableObjectsManager = new LS.Client3DEditor.EditableObjectsManager(this);\r\n }\r\n\r\n getCurrentDefaultCursor(): string {\r\n return this.currentTool.cursor;\r\n }\r\n\r\n keyPressed(keyCode: number | number[]) {\r\n if (Array.isArray(keyCode))\r\n return (keyCode).some(function (key) {\r\n return this.pressedKeys.indexOf(key) !== -1;\r\n }, this);\r\n return this.pressedKeys.indexOf(keyCode) !== -1;\r\n }\r\n\r\n get currentTool() {\r\n var selectedTool = this.tool;\r\n if (selectedTool && this.tools[selectedTool])\r\n return this.tools[selectedTool];\r\n return this.emptyTool;\r\n }\r\n\r\n get tool() {\r\n return this.selectedTool;\r\n }\r\n\r\n set tool(value) {\r\n this.onSetTool(value);\r\n this.selectedToolUri = value || null;\r\n }\r\n\r\n domRenderCallback: () => void;\r\n\r\n afterDomRendered() {\r\n if (this.domRenderCallback)\r\n this.domRenderCallback();\r\n }\r\n\r\n toMouseEventCheck(sourceEvent: any, touch: JQueryTouchEvents.TouchEvent): JQueryMouseEventObject {\r\n sourceEvent.pageX = touch.position.x;\r\n sourceEvent.pageY = touch.position.y;\r\n sourceEvent.clientX = touch.position.x;\r\n sourceEvent.clientY = touch.position.y;\r\n return sourceEvent;\r\n }\r\n\r\n bindToView(viewId: string) {\r\n var self = this,\r\n view = this.view = $(viewId);\r\n\r\n this.width = view.innerWidth();\r\n this.height = view.innerHeight();\r\n\r\n $(document)\r\n .mousedown((e) => {\r\n //console.log(\"document mousedown\");\r\n self.hasFocus = false;\r\n self.onDocumentMouseDown(e as any);\r\n })\r\n .keydown(self.DomKeyDown.bind(self))\r\n .keyup(self.DomKeyUp.bind(self));\r\n\r\n // document\r\n $('body').tapend((e, touch) => {\r\n var button = e.which || 1;\r\n if (button !== 1 || !this.mouseDown)\r\n return;\r\n\r\n if ($.isTouchCapable())\r\n e = this.toMouseEventCheck(e, touch);\r\n console.log(\"document mouseup\");\r\n this.mouseDown = false;\r\n self.onMouseUp(e as any);\r\n this.triggerEvent(mouseUpEvent);\r\n self.afterMouseUp(e as any);\r\n });\r\n\r\n // mousedown\r\n view.tapstart((e, touch) => {\r\n if (e && typeof e.stopPropagation === \"function\")\r\n e.stopPropagation();\r\n //this.view.focus();\r\n this.hasFocus = true;\r\n if (LoaderManager.isLoading())\r\n return;\r\n console.log(\"view.mousedown\");\r\n if ($.isTouchCapable()) {\r\n e = this.toMouseEventCheck(e, touch);\r\n console.log(e);\r\n console.log(\"simulate mouse move\");\r\n var offset = self.view.offset();\r\n self.viewPosition.set(e.clientX - offset.left, e.clientY - offset.top);\r\n self.triggerEvent(beforeMouseMoveEvent);\r\n self.onMouseMove(e);\r\n self.triggerEvent(mouseMoveEvent);\r\n }\r\n\r\n this.triggerEvent(beforeMouseDownEvent);\r\n\r\n if (this.cancelMouseDown) {\r\n this.cancelMouseDown = false;\r\n return;\r\n }\r\n\r\n var button = e.which || 1;\r\n if (button === 1) {\r\n this.mouseDown = true;\r\n this.startViewPosition.copy(this.viewPosition);\r\n this.startMouse.copy(this.mouse);\r\n\r\n self.onMouseDown(e as any);\r\n this.triggerEvent(mouseDownEvent);\r\n }\r\n\r\n afterMouseDownEvent.ev = e;\r\n this.triggerEvent(afterMouseDownEvent);\r\n //this.dispatchEvent({ type: 'afterMouseDown', ev: e });\r\n });\r\n view.dblclick(e => {\r\n //console.log(\"view.dblclick\");\r\n this.triggerEvent(dblclickEvent);\r\n });\r\n\r\n view.on('tapmove', (e, touch) => {\r\n //console.log(\"viewDom.mousemove\");\r\n if ($.isTouchCapable())\r\n e = this.toMouseEventCheck(e, touch);\r\n var offset = self.view.offset();\r\n self.viewPosition.set(e.clientX - offset.left, e.clientY - offset.top);\r\n self.triggerEvent(beforeMouseMoveEvent);\r\n self.onMouseMove(e);\r\n self.triggerEvent(mouseMoveEvent);\r\n });\r\n\r\n //var viewDom = view.get(0);\r\n //viewDom.addEventListener('mousemove', (e: JQueryMouseEventObject) => {\r\n //console.log(\"viewDom.mousemove\");\r\n //}, false);\r\n //viewDom.addEventListener('touchmove', (e: JQueryMouseEventObject) => {\r\n // if (LoaderManager.isLoading())\r\n // return;\r\n // console.log(\"viewDom.touchmove\");\r\n // self.onTouchMove(e);\r\n //}, false);\r\n //viewDom.addEventListener('touchstart', (e: JQueryMouseEventObject) => {\r\n // if (LoaderManager.isLoading())\r\n // return;\r\n // console.log(\"viewDom.touchstart\");\r\n // self.onTouchStart(e);\r\n //}, false);\r\n //document.addEventListener('touchend', (e: JQueryMouseEventObject) => {\r\n // if (LoaderManager.isLoading())\r\n // return;\r\n // console.log(\"document.touchend\");\r\n // self.onTouchEnd(e);\r\n //}, false);\r\n //document.addEventListener('touchcancel', (e: JQueryMouseEventObject) => {\r\n // if (LoaderManager.isLoading())\r\n // return;\r\n // console.log(\"document.touchcancel\");\r\n // self.onTouchEnd(e);\r\n //}, false);\r\n }\r\n\r\n DomKeyDown(e: JQueryKeyEventObject) {\r\n var self = this;\r\n\r\n switch (e.keyCode) {\r\n case 16: //'Shift':\r\n self.shiftDown = true;\r\n break;\r\n case 17:\r\n self.ctrlDown = true;\r\n break;\r\n case 18:\r\n self.altDown = true;\r\n break;\r\n case 32://'Spacebar':\r\n self.spaceDown = true;\r\n break;\r\n }\r\n\r\n self.pressedKeys.push(e.keyCode);\r\n\r\n if (self.hasFocus) {\r\n if (!LoaderManager.isLoading()) {\r\n self.onKeyDown(e);\r\n this.currentTool.onKeyDown(this);\r\n this.triggerEvent(keyDownEvent);\r\n }\r\n e.stopPropagation();\r\n if (e.keyCode !== 116 && e.keyCode !== 123) //F5 //F12\r\n e.preventDefault();\r\n }\r\n }\r\n\r\n DomKeyUp(e: JQueryKeyEventObject) {\r\n var self = this;\r\n\r\n switch (e.keyCode) {\r\n case 16: //'Shift':\r\n self.shiftDown = false;\r\n break;\r\n case 17:\r\n self.ctrlDown = false;\r\n break;\r\n case 18:\r\n self.altDown = false;\r\n break;\r\n case 32://'Spacebar':\r\n self.spaceDown = false;\r\n break;\r\n }\r\n if (this.keyPressed(e.keyCode)) {\r\n self.pressedKeys.remove(e.keyCode);\r\n self.onKeyUp(e);\r\n this.currentTool.onKeyUp(this);\r\n }\r\n this.triggerEvent(keyUpEvent);\r\n }\r\n\r\n onTouchStart(e: JQueryMouseEventObject) {\r\n if ((e as any).touches.length === 1) {\r\n var touch = (e as any).touches[0];\r\n e.pageX = touch.pageX;\r\n e.pageY = touch.pageY;\r\n e.clientX = touch.clientX;\r\n e.clientY = touch.clientY;\r\n this.onMouseMove(e);\r\n ko.tasks.runEarly();\r\n this.onMouseDown(e);\r\n e.preventDefault();\r\n }\r\n }\r\n\r\n onTouchMove(e: JQueryMouseEventObject) {\r\n if ((e as any).touches.length === 1) {\r\n var touch = (e as any).touches[0];\r\n e.pageX = touch.pageX;\r\n e.pageY = touch.pageY;\r\n e.clientX = touch.clientX;\r\n e.clientY = touch.clientY;\r\n this.onMouseMove(e);\r\n }\r\n }\r\n\r\n onTouchEnd(e: JQueryMouseEventObject) {\r\n var touches = (e as any).changedTouches && (e as any).changedTouches.length ? (e as any).changedTouches : (e as any).touches;\r\n if (touches.length) {\r\n var touch = touches[0];\r\n e.pageX = touch.pageX;\r\n e.pageY = touch.pageY;\r\n e.clientX = touch.clientX;\r\n e.clientY = touch.clientY;\r\n this.onMouseMove(e);\r\n ko.tasks.runEarly();\r\n this.onMouseUp(e);\r\n }\r\n }\r\n\r\n onKeyUp(e: JQueryKeyEventObject) { }\r\n\r\n addListener(type: string, listener: (event: IEventManagerEvent) => void): EventManager { return this; }\r\n\r\n hasListener(type: string, listener: (event: IEventManagerEvent) => void): boolean { return false; }\r\n\r\n removeListener(type?: string, listener?: (event: IEventManagerEvent) => void): void { }\r\n\r\n dispatchEvent(event: IEventManagerEvent): void { }\r\n\r\n triggerEvent(event: IEventManagerEvent): void {\r\n this.dispatchEvent(event);\r\n this.onChanged();\r\n }\r\n\r\n onChanged() {\r\n this.dispatchEvent(changeEvent);\r\n }\r\n\r\n findInstanceContext = (() => {\r\n var localRay = new THREE.Ray(),\r\n localPoint = new THREE.Vector3();\r\n\r\n return (worldRay: THREE.Ray, point?: THREE.Vector3, minProcessStep = 0) => {\r\n var dist = Number.POSITIVE_INFINITY,\r\n curInst = this.currentInstance;\r\n\r\n this.instances.filter(inst => inst.ProcessStep >= minProcessStep).forEach(inst => {\r\n\r\n var p = localRay.copy(worldRay).applyMatrix4(inst.worldToLocalTransform).intersectPlane(inst.plane, localPoint);\r\n\r\n if (p) {\r\n var localDist = p.distanceToSquared(localRay.origin);\r\n if (localDist < dist && MapDrawing.Point2D.isInsidePolygon(p, inst.instancePolygons[0], 0.01)) {\r\n dist = localDist;\r\n curInst = inst;\r\n if (point) point.copy(p);\r\n }\r\n }\r\n });\r\n\r\n return curInst;\r\n };\r\n })();\r\n\r\n getInstanceContext(id: string, controller?: LS.Client3DEditor.Controller): InstanceContext {\r\n if (!id)\r\n return null;\r\n\r\n //id = id.toLowerCase();\r\n\r\n var instance = this.instancesById[id];//ArrayHelper.firstOrNull(this.instances, (inst) => inst.Id === id);\r\n\r\n if (!instance) {\r\n instance = new InstanceContext(id, controller);\r\n this.instances.push(instance);\r\n instance.addToScene(controller);\r\n }\r\n\r\n return instance;\r\n }\r\n\r\n setInstances(instances: InstanceContext[]) {\r\n this.activeInstance = null;\r\n\r\n ArrayHelper.replaceContent(this.instances, instances).forEach((inst: InstanceContext) => {\r\n inst.dispose();\r\n });\r\n }\r\n\r\n clearInstances() {\r\n this.activeInstance = null;\r\n\r\n this.instances.splice(0, this.instances.length).forEach((inst: InstanceContext) => {\r\n inst.dispose();\r\n });\r\n }\r\n\r\n onDocumentMouseDown(e: JQueryMouseEventObject) {\r\n this.hovered = null;\r\n }\r\n\r\n onMouseDown(e: JQueryMouseEventObject) {\r\n var enableSelect = this.currentTool.onMouseDown(this) && this.editableObjectsManager.onMouseDown(this) && !this.spaceDown;\r\n this.isDragging = false;\r\n this.isScaling = false;\r\n this.scaleHelperObject = null;\r\n this.isSelecting = false;\r\n this.canSelect = enableSelect;\r\n this.canDrag = enableSelect;\r\n this.startRoofPosition.copy(this.roofPosition);\r\n this.startViewPosition.copy(this.viewPosition);\r\n }\r\n\r\n onMouseUp(e: JQueryMouseEventObject) {\r\n this.canSelect = this.currentTool.onMouseUp(this) && this.editableObjectsManager.onMouseUp(this) && this.canSelect;\r\n }\r\n\r\n afterMouseUp(e: JQueryMouseEventObject) {\r\n this.isDragging = false;\r\n this.isScaling = false;\r\n this.scaleHelperObject = null;\r\n this.isSelecting = false;\r\n }\r\n\r\n onKeyDown(e: JQueryKeyEventObject) {\r\n if (this.spaceDown) {\r\n this.canSelect = false;\r\n this.canDrag = false;\r\n }\r\n }\r\n\r\n onMouseMove(e: JQueryMouseEventObject) {\r\n //e.preventDefault();\r\n this.canSelect = this.currentTool.onMouseMove(this) && this.editableObjectsManager.onMouseMove(this) && this.canSelect;\r\n\r\n if (this.mouseDown && this.canDrag && this.diffViewPosition.lengthSq() >= 100)\r\n this.startDrag();\r\n }\r\n\r\n onSelectedChanged(changes: { value: ClientObjectInstance, status: string }[]) {\r\n changes.forEach((change) => {\r\n var instance = change.value;\r\n if (!instance._isDisposed) {\r\n switch (change.status) {\r\n case \"deleted\":\r\n if (instance.isSelected === true) {\r\n instance.isSelected = false;\r\n instance.OnChanged();\r\n }\r\n //this.dispatchEvent({ type: 'selectionDeleted', instance: instance });\r\n break;\r\n case \"added\":\r\n if (instance.isSelected === false) {\r\n instance.isSelected = true;\r\n instance.OnChanged();\r\n }\r\n //this.dispatchEvent({ type: 'selectionAdded', instance: instance });\r\n break;\r\n }\r\n }\r\n });\r\n\r\n this.triggerEvent(selectionChangedEvent);\r\n //this.selectionChanged = true;\r\n //if (LS && LS.Electric && LS.Electric.InvertersModel)\r\n // LS.Electric.InvertersModel.highlightByIds(this.selected.map(s => s.instanceData.Id));\r\n }\r\n\r\n onSelectedUiChanged(changes: { value: ISelectableUi, status: string }[]) {\r\n changes.forEach((change) => {\r\n var instance = change.value;\r\n if (!instance._isDisposed) {\r\n switch (change.status) {\r\n case \"deleted\":\r\n if (instance.isSelected === true) {\r\n instance.isSelected = false;\r\n instance.OnChanged();\r\n }\r\n //this.dispatchEvent({ type: 'selectionDeleted', instance: instance });\r\n break;\r\n case \"added\":\r\n if (instance.isSelected === false) {\r\n instance.isSelected = true;\r\n instance.OnChanged();\r\n }\r\n //this.dispatchEvent({ type: 'selectionAdded', instance: instance });\r\n break;\r\n }\r\n }\r\n });\r\n\r\n this.triggerEvent(selectionUiChangedEvent);\r\n //this.selectionChanged = true;\r\n }\r\n\r\n startDrag() {\r\n this.canSelect = false;\r\n this.triggerEvent(startDragEvent);\r\n this.canDrag = false;\r\n }\r\n\r\n switchViewLayer(viewLayer: IViewLayer) {\r\n if (!viewLayer || !viewLayer.Name)\r\n return;\r\n\r\n this.deselectAll();\r\n\r\n this.CurrentViewLayerName = viewLayer.Name;\r\n\r\n if (this.EditorViewMode === \"Electric\")\r\n Controller.Current.SetupElectricView(viewLayer);\r\n\r\n this.currentTool.onViewLayerChanged(this, this.CurrentViewLayerName);\r\n }\r\n\r\n addToSelection(instances: { id: string | number }[], forceAdd?: boolean, forceRemove?: boolean, selection?: { id: string | number }[]) {\r\n var selected = selection || this.selected as { id: string | number }[],\r\n shift = this.shiftDown,\r\n ctrl = this.ctrlDown;\r\n\r\n if (!instances || !instances.length) {\r\n if (!shift && !ctrl && !forceAdd && !forceRemove)\r\n selected.removeAll();\r\n return;\r\n }\r\n\r\n if ((shift && !ctrl) || forceAdd) {\r\n //add to selection which are not already selected\r\n\r\n let sel = {};\r\n\r\n instances.filter(s => sel[s.id] ? false : sel[s.id] = true);\r\n\r\n selected.forEach(s => {\r\n if (sel[s.id])\r\n sel[s.id] = false;\r\n });\r\n\r\n selected.push.apply(selected, instances.filter(s => sel[s.id]));\r\n //selected.splice.apply(selected, [selected.length, 0].concat(instances.filter(s => sel[s.id])));\r\n } else if ((shift && ctrl) || forceRemove) {\r\n //remove\r\n\r\n let sel = {};\r\n\r\n instances.forEach(s => { sel[s.id] = true; });\r\n\r\n selected.remove(s => !!sel[s.id]);\r\n } else if (ctrl) {\r\n //remove if already selected. Add if not already selected.\r\n\r\n let sel = {};\r\n\r\n instances.filter(s => sel[s.id] ? false : sel[s.id] = true);\r\n\r\n selected.remove(s => {\r\n if (sel[s.id]) {\r\n sel[s.id] = false;\r\n return true;\r\n }\r\n return false;\r\n });\r\n\r\n ko.tasks.runEarly();\r\n selected.push.apply(selected, instances.filter(s => sel[s.id]));\r\n //selected.splice.apply(selected, [selected.length, 0].concat(instances.filter(s => sel[s.id])));\r\n } else {\r\n //replace selection\r\n selected.removeAll();\r\n ko.tasks.runEarly();\r\n selected.push.apply(selected, instances);\r\n //selected.splice.apply(selected, ([0, 0] as any[]).concat(instances));\r\n }\r\n }\r\n\r\n filterSelection(fn: (o: ClientObjectInstance) => boolean, selection?: ClientObjectInstance[] | THREE.Object3D[]) {\r\n var selected = selection || this.selected;\r\n selected.remove(o => !fn(o));\r\n }\r\n\r\n hasSelected(id: number) {\r\n return this.selected.some((s) => { return id === s.id; });\r\n }\r\n\r\n //update selected after objects moved\r\n updateSelected() {\r\n this.selected.forEach((o) => {\r\n o.OnChanged();\r\n });\r\n this.selectedUi.forEach(o => {\r\n o.OnChanged(this);\r\n });\r\n this.selectionUiNeedsUpdate = true;\r\n this.selectionNeedsUpdate = true;\r\n //ko.getObservable(this, \"selected\").valueHasMutated();\r\n //ko.getObservable(this, \"selectedUi\").valueHasMutated();\r\n //ko.valueHasMutated(this, \"selected\");\r\n //ko.valueHasMutated(this, \"selectedUi\");\r\n }\r\n\r\n checkSelection(): void {\r\n //make sure selection is valid\r\n this.selected.remove((o: ClientObjectInstance) => { return !!o._isDisposed || !o.visible; });\r\n this.selectionNeedsUpdate = true;\r\n\r\n }\r\n\r\n resetModuleAppearance() {\r\n this._moduleCellColor = '0b1b3c';\r\n this._moduleFrameColor = 'b5b5b5';\r\n this._moduleBacksheetColor = 'e5e5e5';\r\n this._moduleCellType = ModuleCellType.Monocrystalline;\r\n this._moduleCellcols = 6;\r\n this._moduleCellrows = 10;\r\n this._moduleFrameWidth = 20;\r\n //this.moduleAppearanceNeedsUpdate = true;\r\n this.saveModuleAppearance(true);\r\n }\r\n\r\n setModuleAppearance(material: ModuleAppearanceShader) {\r\n this._moduleCellType = material.cellType;\r\n this._moduleCellcols = material.cols;\r\n this._moduleCellrows = material.rows;\r\n this._moduleCellColor = material.moduleCellColor.getHexString();\r\n this._moduleFrameColor = material.moduleFrameColor.getHexString();\r\n this._moduleBacksheetColor = material.moduleBacksheetColor.getHexString();\r\n this._moduleFrameWidth = material.frameWidth;\r\n }\r\n\r\n updateModuleAppearance() {\r\n var objects = Controller.Current.Objects;\r\n for (var id in objects) {\r\n var clientObject = objects[id] as ClientObject;\r\n if (clientObject.SharedMeshes && clientObject.SharedMeshes.length) {\r\n for (var i = clientObject.SharedMeshes.length; i--;) {\r\n var sharedMesh = clientObject.SharedMeshes[i],\r\n material = sharedMesh.material;\r\n if (material instanceof THREE.ModuleAppearanceShader) {\r\n material.cellType = this._moduleCellType;\r\n material.cols = this.ModuleCellcols;\r\n material.rows = this.ModuleCellrows;\r\n material.frameWidth = this.ModuleFrameWidth;\r\n material.moduleCellColor.set('#' + this.ModuleCellColor);\r\n material.moduleFrameColor.set('#' + this.ModuleFrameColor);\r\n material.moduleBacksheetColor.set('#' + this.ModuleBacksheetColor);\r\n } else if (material instanceof THREE.DefaultAppearanceShader) {\r\n material.color.set('#' + this.ModuleFrameColor);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n saveModuleAppearance(reset?: boolean) {\r\n if (LoaderManager.isLoading())\r\n return;\r\n\r\n var col = new THREE.Color('#' + this.ModuleCellColor);\r\n var framecol = new THREE.Color('#' + this.ModuleFrameColor);\r\n var backsheetcol = new THREE.Color('#' + this.ModuleBacksheetColor);\r\n this.moduleAppearanceNeedsUpdate = true;\r\n\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"ChangeModuleObjectAppearance\").Data({ cellType: this._moduleCellType, cellCols: this.ModuleCellcols, cellRows: this.ModuleCellrows, cellColor: col.getHex(), frameColor: framecol.getHex(), backsheetColor: backsheetcol.getHex(), frameWidth: this.ModuleFrameWidth }).CallBack(() => { });\r\n }\r\n\r\n saveRoofAppearance() {\r\n if (LoaderManager.isLoading())\r\n return;\r\n var roofAppearance = this.roofAppearance;\r\n var appearance: SolarProTool.InstanceholderAppearance = {\r\n AoBaseColor: roofAppearance.AoBaseColor,\r\n AoFlatColor: roofAppearance.AoFlatColor,\r\n AoBorderColor: roofAppearance.AoBorderColor,\r\n AoAtticaColor: roofAppearance.AoAtticaColor,\r\n AoBeamColor: roofAppearance.AoBeamColor,\r\n AoRafterColor: roofAppearance.AoRafterColor,\r\n AoAreaBorderColor: roofAppearance.AoAreaBorderColor,\r\n AoShowWindzoneAreas: roofAppearance.AoShowWindzoneAreas,\r\n AoShowRafterAndBeams: roofAppearance.AoShowRafterAndBeams,\r\n AoShowWindZoneStrings: roofAppearance.AoShowWindZoneStrings\r\n };\r\n\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"ChangeInstanceholderAppearance\").Data({ appearance: appearance }).CallBack(() => {\r\n Controller.Current.reloadRoofObject(false, false);\r\n });\r\n }\r\n\r\n resetRoofAppearance() {\r\n SolarProTool.Ajax(\"WebServices/Anordnung3DService.asmx\").Call(\"ChangeInstanceholderAppearance\").Data({ appearance: null }).CallBack(() => {\r\n Controller.Current.reloadRoofObject(false, false);\r\n });\r\n }\r\n\r\n deselectAll() {\r\n this.selected.removeAll();\r\n this.selectedUi.removeAll();\r\n }\r\n\r\n setTool(tool: string) {\r\n this.tool = tool;\r\n }\r\n\r\n deselectTool() {\r\n this.setTool(null);\r\n }\r\n\r\n onSetTool(tool: string) {\r\n if (this.selectedInsertable != null)\r\n this.selectedInsertable = null;\r\n var controller = Controller.Current;\r\n controller.setTransformControlsEnabled(!tool);\r\n setBoxhelper(null);\r\n }\r\n\r\n interOverviewClick() {\r\n if (this.selectedTool)\r\n this.deselectTool();\r\n return true;\r\n }\r\n\r\n selectInsertable(insertable: ClientObject) {\r\n this.selectedInsertable = insertable;\r\n if (insertable) {\r\n var rectInsertSelected = this.selectedToolUri === 'rectInsert' && (insertable.userOptions & Client3DObectOptions.NoRectInsert) === 0;\r\n this.selectedToolUri = null;\r\n if (rectInsertSelected)\r\n this.selectedToolUri = 'rectInsert';\r\n else\r\n this.selectedToolUri = 'insertSingle';\r\n } else {\r\n this.deselectTool();\r\n }\r\n }\r\n\r\n updateModuleCount(id: number, count: number) {\r\n if (this.modulesCounter[id] !== count) {\r\n this.modulesCounter[id] = count;\r\n this.needsUpdate = true;\r\n }\r\n }\r\n\r\n update() {\r\n var instances = this.instances;\r\n for (var i = instances.length - 1; i >= 0; i--) {\r\n instances[i].update();\r\n }\r\n if (this.needsUpdate) {\r\n var modCount = 0, modulesCounter = this.modulesCounter;\r\n for (var id in modulesCounter) {\r\n modCount += modulesCounter[id];\r\n }\r\n this.modulesCount = modCount;\r\n this.needsUpdate = false;\r\n }\r\n if (this.selectionUiNeedsUpdate) {\r\n ko.valueHasMutated(this, 'selectedUi');\r\n //ko.getObservable(this, 'selectedUi').notifySubscribers(this.selectedUi);\r\n this.selectionUiNeedsUpdate = false;\r\n }\r\n if (this.selectionNeedsUpdate) {\r\n ko.valueHasMutated(this, 'selected');\r\n //ko.getObservable(this, 'selected').notifySubscribers(this.selected);\r\n this.selectionNeedsUpdate = false;\r\n }\r\n if (this.moduleAppearanceNeedsUpdate) {\r\n this.updateModuleAppearance();\r\n this.moduleAppearanceNeedsUpdate = false;\r\n }\r\n this.updateSelectionMeasures();\r\n this.editableObjectsManager.update(this);\r\n }\r\n\r\n updateSelectionMeasures() {\r\n if (!this.selectionChanged)\r\n return;\r\n\r\n this.selectionChanged = false;\r\n\r\n var measureVisualizer = this.currentInstance.measureVisualizer;\r\n\r\n measureVisualizer.clearSteps();\r\n\r\n var selBounds = this.selectedBounds;\r\n\r\n if (selBounds.w || selBounds.h) {\r\n var _v1 = new THREE.Vector3();\r\n\r\n if (this.isDragging) {\r\n\r\n var dp = this.diffSnapPosition;\r\n\r\n measureVisualizer.addStep(_v1.set(selBounds.x, selBounds.y, selBounds.z).add(dp));\r\n measureVisualizer.addStep(_v1.set(selBounds.x + selBounds.w, selBounds.y + selBounds.h, selBounds.z + selBounds.d).add(dp));\r\n\r\n } else {\r\n measureVisualizer.addStep(_v1.set(selBounds.x, selBounds.y, selBounds.z));\r\n measureVisualizer.addStep(_v1.set(selBounds.x + selBounds.w, selBounds.y + selBounds.h, selBounds.z + selBounds.d));\r\n }\r\n }\r\n\r\n //var _v1 = new THREE.Vector3();\r\n\r\n //ArrayHelper.iterateArray(this.selected, (sel) => {\r\n // var mat = sel.matrixWorld,\r\n // bb = sel.geometry.boundingBox;\r\n // measureVisualizer.addStep(_v1.copy(bb.min).applyMatrix4(mat));\r\n // measureVisualizer.addStep(_v1.copy(bb.max).applyMatrix4(mat));\r\n //});\r\n\r\n measureVisualizer.update();\r\n\r\n }\r\n\r\n snappingDeactivatedClick() {\r\n if (this.selectedTool !== \"addSpacingTool\")\r\n this.snappingDeactivated = !this.snappingDeactivated;\r\n }\r\n\r\n GetSnap(source: THREE.Box3 | THREE.Vector3) {\r\n if (!this.enableSnapping || !source)\r\n return null;\r\n var e: ISnapEvent = {\r\n source: source,\r\n snap: null,\r\n type: source instanceof THREE.Box3 ? 'SnapBox' : 'SnapPoint'\r\n };\r\n this.triggerEvent(e);\r\n return e.snap;\r\n }\r\n\r\n ApplyDiffSnapPosition() {\r\n var diff = this.diffSnapPosition,\r\n dx = Math.round(diff.x),\r\n dy = Math.round(diff.y),\r\n dz = Math.round(diff.z);\r\n\r\n if (Math.abs(dx) > 0 || Math.abs(dy) > 0) {\r\n this.selected.forEach((o) => {\r\n var pos = o.position;\r\n o.setPosition(pos.x + dx, pos.y + dy, pos.z + dz);\r\n });\r\n if (this.selectedUi.length) {\r\n this.selectedUi.forEach((o) => {\r\n o.applyObjectPosition();\r\n });\r\n Controller.Current.directedAreaHolder.onDirectedAreasChanged(this.selectedUi, false);\r\n }\r\n }\r\n }\r\n\r\n ApplyDiffScalePosition(dt?: THREE.Vector3, ds?: THREE.Vector3) {\r\n if (!dt)\r\n dt = this.diffScalePosition;\r\n if (!ds)\r\n ds = this.diffScale;\r\n\r\n if (Math.abs(dt.x) > 0 || Math.abs(dt.y) > 0) {\r\n this.selected.forEach((o) => {\r\n var pos = o.position,\r\n scale = o.scale;\r\n o.setPosition(pos.x + dt.x, pos.y + dt.y, pos.z);\r\n o.setSize(scale.x * ds.x, scale.y * ds.y);\r\n });\r\n //if (this.selectedUi.length) {\r\n // this.selectedUi.forEach((o) => {\r\n // o.applyObjectPosition();\r\n // });\r\n // Controller.Current.directedAreaHolder.onDirectedAreasChanged(this.selectedUi, false);\r\n //}\r\n }\r\n }\r\n\r\n GetCurrentDefaultCursor() {\r\n var viewModel = this;\r\n if (viewModel.selectedTool == null)\r\n return 'default';\r\n return viewModel.tools[viewModel.selectedTool].cursor;\r\n }\r\n\r\n private lastClickedIndex = -1;\r\n\r\n onInterListClick(data: IDynamicInterferenceObject, index: number) {\r\n var viewModel = this,\r\n lastClickedIndex = this.lastClickedIndex,\r\n inters = this.interferenceObjects;\r\n\r\n if (viewModel.shiftDown && index !== lastClickedIndex && lastClickedIndex >= 0 && index >= 0 && inters && inters.length > index && inters.length > lastClickedIndex) {\r\n var step = index < lastClickedIndex ? 1 : -1;\r\n var selInters: IDynamicInterferenceObject[] = [];\r\n for (var i = index; i !== lastClickedIndex; i += step) {\r\n var inter = inters[i];\r\n if (inter && !inter._isDisposed && !inter.locked)\r\n selInters.push(inter);\r\n }\r\n\r\n viewModel.addToSelection(selInters, true, false, viewModel.selectedUi);\r\n } else {\r\n if ((!data.isSelected || viewModel.shiftDown || viewModel.ctrlDown) && !data.locked && !data._isDisposed)\r\n viewModel.addToSelection([data], false, false, viewModel.selectedUi);\r\n }\r\n\r\n this.lastClickedIndex = +index;\r\n\r\n return true; //false := preventDefault()\r\n }\r\n\r\n changeInterType(newType: string, interference: IDynamicInterferenceObject) {\r\n if (!interference || interference.Type === newType)\r\n return;\r\n\r\n var wasSelected = false;\r\n\r\n if (interference.isSelected) {\r\n this.addToSelection([interference], false, true, this.selectedUi);\r\n ko.tasks.runEarly();\r\n wasSelected = true;\r\n }\r\n\r\n var position = new THREE.Vector3(),\r\n size = new THREE.Vector3();\r\n\r\n interference.positionAndSize(position, size);\r\n\r\n if (size.x <= 0 || size.y <= 0 || size.z <= 0)\r\n return;\r\n\r\n var pts: THREE.Vector3[] = [\r\n position.clone().setZ(size.z),\r\n position.clone().setX(position.x + size.x).setZ(size.z),\r\n position.clone().setX(position.x + size.x).setY(position.y + size.y).setZ(size.z),\r\n position.clone().setY(position.y + size.y).setZ(size.z)\r\n ];\r\n\r\n var baseParentId = interference.BaseParentId;\r\n var oldId = interference.IdString;\r\n var oldState = interference.state.clone();\r\n var newState = InterferenceTool.createInterferenceState(this.currentInstance.Id, newType, pts);\r\n\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(null, baseParentId, newState, (newId) => {\r\n if (newId) {\r\n newState.IdString = newId.toLowerCase();\r\n\r\n interference.remove();\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(interference.IdString, baseParentId, null);\r\n\r\n var newInterference = Controller.Current.interferenceHelper.createInterferenceObjectFromData(newState);\r\n\r\n if (wasSelected && !newInterference.isSelected && !newInterference.locked && !newInterference._isDisposed) {\r\n this.addToSelection([newInterference], true, false, this.selectedUi);\r\n var $aoConstrucionSettings = $('#ao-ConstrucionSettings') as any;\r\n if ($aoConstrucionSettings.tabs)\r\n $aoConstrucionSettings.tabs(\"option\", \"active\", 1);\r\n if (!Controller.Current.viewModel.FlyoutVisible)\r\n LS.Client3DEditor.ToolBox.toggleFlyout();\r\n }\r\n\r\n Controller.Current.updateManager.dynamicUpdate(() => {\r\n var o = Controller.Current.interferenceHelper.getById(oldId);\r\n if (o) {\r\n o.remove();\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(oldId, baseParentId, null);\r\n\r\n Controller.Current.interferenceHelper.createInterferenceObjectFromData(newState);\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(newId, baseParentId, newState);\r\n }\r\n }, () => {\r\n var o = Controller.Current.interferenceHelper.getById(newId);\r\n if (o) {\r\n o.remove();\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(newId, baseParentId, null);\r\n\r\n Controller.Current.interferenceHelper.createInterferenceObjectFromData(oldState);\r\n Controller.Current.interferenceHelper.updateSetInterferenceState(oldId, baseParentId, oldState);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n clickScaleArrow(horizontal: boolean) {\r\n if (horizontal)\r\n this.scaleLeftToRight = !this.scaleLeftToRight;\r\n else\r\n this.scaleBottomToUpper = !this.scaleBottomToUpper;\r\n }\r\n }\r\n\r\n EventManager.apply(ViewModel.prototype);\r\n\r\n export interface ISnapEvent extends IEventManagerEvent {\r\n source: THREE.Box3 | THREE.Vector3;\r\n snap: THREE.Vector3;\r\n }\r\n\r\n export class Vector2Property extends THREE.Vector2 {\r\n constructor(getter: (name: 'x' | 'y') => number | string, setter: (name: 'x' | 'y', val: number) => void) {\r\n super();\r\n ko.defineProperty(this, 'x', {\r\n get: getter.bind(this, 'x'),\r\n set: setter.bind(this, 'x')\r\n });\r\n\r\n ko.defineProperty(this, 'y', {\r\n get: getter.bind(this, 'y'),\r\n set: setter.bind(this, 'y')\r\n });\r\n\r\n ko.track(this);\r\n }\r\n }\r\n\r\n export class ReadonlyVector2Property extends THREE.Vector2 {\r\n constructor(getter: (name: 'x' | 'y') => number | string) {\r\n super();\r\n ko.defineProperty(this, 'x', getter.bind(this, 'x'));\r\n\r\n ko.defineProperty(this, 'y', getter.bind(this, 'y'));\r\n\r\n ko.track(this);\r\n }\r\n }\r\n\r\n export class Vector3Property extends THREE.Vector3 {\r\n constructor(getter: (name: 'x' | 'y' | 'z') => number | string, setter: (name: 'x' | 'y' | 'z', val: number) => void) {\r\n super();\r\n ko.defineProperty(this, 'x', {\r\n get: getter.bind(this, 'x'),\r\n set: setter.bind(this, 'x')\r\n });\r\n\r\n ko.defineProperty(this, 'y', {\r\n get: getter.bind(this, 'y'),\r\n set: setter.bind(this, 'y')\r\n });\r\n\r\n ko.defineProperty(this, 'z', {\r\n get: getter.bind(this, 'z'),\r\n set: setter.bind(this, 'z')\r\n });\r\n\r\n ko.track(this);\r\n }\r\n }\r\n\r\n export class ReadonlyVector3Property extends THREE.Vector3 {\r\n constructor(getter: (name: 'x' | 'y' | 'z') => number | string) {\r\n super();\r\n ko.defineProperty(this, 'x', getter.bind(this, 'x'));\r\n\r\n ko.defineProperty(this, 'y', getter.bind(this, 'y'));\r\n\r\n ko.defineProperty(this, 'z', getter.bind(this, 'z'));\r\n\r\n ko.track(this);\r\n }\r\n }\r\n\r\n export class ObservableVector3 extends THREE.Vector3 {\r\n constructor() {\r\n super();\r\n ko.track(this);\r\n }\r\n }\r\n\r\n export class ObservableVector2 extends THREE.Vector2 {\r\n constructor() {\r\n super();\r\n ko.track(this);\r\n }\r\n }\r\n\r\n export class ObservableBounds {\r\n constructor(x?: number, y?: number, z?: number, w?: number, h?: number, d?: number) {\r\n this.set(x, y, z, w, h, d);\r\n ko.track(this);\r\n }\r\n\r\n set(x?: number, y?: number, z?: number, w?: number, h?: number, d?: number) {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n this.h = h || 0;\r\n this.d = d || 0;\r\n }\r\n\r\n x: number;\r\n y: number;\r\n z: number;\r\n w: number;\r\n h: number;\r\n d: number;\r\n }\r\n\r\n export class ObservablePolygon {\r\n readonly bounds: THREE.Box3;\r\n readonly array: ObservableVector3[] = [];\r\n private readonly subscriptions: WeakMap = new WeakMap();\r\n\r\n readonly lines: THREE.Line3[];\r\n\r\n size: THREE.Vector3;\r\n center: THREE.Vector3;\r\n position: THREE.Vector3;\r\n\r\n sizeX: number;\r\n sizeY: number;\r\n sizeZ: number;\r\n\r\n positionX: number;\r\n positionY: number;\r\n positionZ: number;\r\n\r\n scaleX: number;\r\n scaleY: number;\r\n scaleZ: number;\r\n\r\n rotation: number;\r\n height: number;\r\n\r\n private _scaleX = 1;\r\n private _scaleY = 1;\r\n private _scaleZ = 1;\r\n private _rotation = 0;\r\n\r\n resetScale(x?: number, y?: number, z?: number) {\r\n this._scaleX = x || 1;\r\n this._scaleY = y || 1;\r\n this._scaleZ = z || 1;\r\n }\r\n\r\n resetRotation(v?: number) {\r\n this._rotation = v || 0;\r\n }\r\n\r\n constructor() {\r\n ko.track(this, [\"array\", \"_rotation\", \"_scaleX\", \"_scaleY\", \"_scaleZ\"] as any);\r\n\r\n var koArray = ko.getObservable(this, 'array') as KnockoutObservableArray;\r\n var onPointChanged = () => {\r\n koArray.valueHasMutated();\r\n };\r\n\r\n koArray.subscribe((changes: { value: ObservableVector3, status: string }[]) => {\r\n var subscriptions = this.subscriptions;\r\n changes.forEach((change) => {\r\n var v = change.value;\r\n if (v) {\r\n switch (change.status) {\r\n case \"deleted\":\r\n if (subscriptions.has(v)) {\r\n subscriptions.get(v).forEach(s => { s.dispose(); });\r\n subscriptions.delete(v);\r\n }\r\n break;\r\n case \"added\":\r\n if (!subscriptions.has(v)) {\r\n var subs: KnockoutSubscription[] = [];\r\n\r\n subs.push(ko.getObservable(v, 'x').subscribe(onPointChanged));\r\n subs.push(ko.getObservable(v, 'y').subscribe(onPointChanged));\r\n subs.push(ko.getObservable(v, 'z').subscribe(onPointChanged));\r\n\r\n subscriptions.set(v, subs);\r\n }\r\n break;\r\n }\r\n }\r\n\r\n });\r\n }, null, \"arrayChange\");\r\n\r\n var v1 = new THREE.Vector3();\r\n\r\n var bounds = new THREE.Box3();\r\n var size = new THREE.Vector3();\r\n var center = new THREE.Vector3();\r\n\r\n ko.defineProperty(this, \"bounds\", () => {\r\n return bounds.setFromPoints(koArray());\r\n });\r\n\r\n ko.defineProperty(this, \"lines\", () => {\r\n var points = koArray(),\r\n result: THREE.Line3[] = [],\r\n pointsCount = points.length;\r\n\r\n for (let i2 = 1, l = pointsCount; i2 < l; i2++) {\r\n let i = i2 - 1,\r\n p1 = points[i],\r\n p2 = points[i2];\r\n\r\n result.push(new THREE.Line3(p1, p2));\r\n\r\n }\r\n\r\n return result;\r\n });\r\n\r\n ko.defineProperty(this, \"size\",\r\n {\r\n get: () => {\r\n return this.bounds.getSize(size);\r\n },\r\n set: (v: THREE.Vector3) => {\r\n var newSize = v1.copy(v);\r\n var oldSize = this.size;\r\n if (newSize.x !== 0 && newSize.y !== 0 && newSize.z !== 0 && oldSize.x !== 0 && oldSize.y !== 0 && oldSize.z !== 0) {\r\n var s = newSize.divide(oldSize);\r\n var c = this.center;\r\n\r\n var m = new THREE.Matrix4().makeTranslation(c.x, c.y, c.z).multiply(new THREE.Matrix4().makeScale(s.x, s.y, s.z).multiply(new THREE.Matrix4().makeTranslation(-c.x, -c.y, -c.z)));\r\n\r\n this.applyMatrix4(m);\r\n\r\n this._scaleX *= s.x;\r\n this._scaleY *= s.y;\r\n this._scaleZ *= s.z;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"center\",\r\n {\r\n get: () => {\r\n return this.bounds.getCenter(center);\r\n },\r\n set: (v: THREE.Vector3) => {\r\n var t = v1.copy(v).sub(this.center);\r\n this.array.forEach(p => { p.add(t); });\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"position\",\r\n {\r\n get: () => {\r\n return this.bounds.min;\r\n },\r\n set: (v: THREE.Vector3) => {\r\n var t = v1.copy(v).sub(this.position);\r\n this.array.forEach(p => { p.add(t); });\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"sizeX\",\r\n {\r\n get: () => {\r\n return this.size.x;\r\n },\r\n set: (newSize: number) => {\r\n var size = this.sizeX;\r\n var scale = this.scaleX;\r\n if (size > 0 && newSize > 0 && scale !== 0) {\r\n this.scaleX = scale * newSize / size;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"sizeY\",\r\n {\r\n get: () => {\r\n return this.size.y;\r\n },\r\n set: (newSize: number) => {\r\n var size = this.sizeY;\r\n var scale = this.scaleY;\r\n if (size > 0 && newSize > 0 && scale !== 0) {\r\n this.scaleY = scale * newSize / size;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"sizeZ\",\r\n {\r\n get: () => {\r\n return this.size.z;\r\n },\r\n set: (newSize: number) => {\r\n var size = this.sizeZ;\r\n var scale = this.scaleZ;\r\n if (size > 0 && newSize > 0 && scale !== 0) {\r\n this.scaleZ = scale * newSize / size;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"positionX\",\r\n {\r\n get: () => {\r\n return this.bounds.min.x;\r\n },\r\n set: (val) => {\r\n var t = (+val || 0) - this.bounds.min.x;\r\n this.array.forEach(p => { p.setX(p.x + t); });\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"positionY\",\r\n {\r\n get: () => {\r\n return this.bounds.min.y;\r\n },\r\n set: (val) => {\r\n var t = (+val || 0) - this.bounds.min.y;\r\n this.array.forEach(p => { p.setY(p.y + t); });\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"positionZ\",\r\n {\r\n get: () => {\r\n return this.bounds.min.z;\r\n },\r\n set: (val) => {\r\n var t = (+val || 0) - this.bounds.min.z;\r\n this.array.forEach(p => { p.setZ(p.z + t); });\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"scaleX\",\r\n {\r\n get: () => {\r\n return this._scaleX;\r\n },\r\n set: (val) => {\r\n var newScale = (+val || 0);\r\n var oldScale = this._scaleX;\r\n if (newScale !== 0 && oldScale !== 0) {\r\n var s = newScale / oldScale;\r\n var c = this.center;\r\n\r\n var m = new THREE.Matrix4().makeTranslation(c.x, c.y, c.z).multiply(new THREE.Matrix4().makeScale(s, 1, 1).multiply(new THREE.Matrix4().makeTranslation(-c.x, -c.y, -c.z)));\r\n\r\n this.applyMatrix4(m);\r\n\r\n this._scaleX = newScale;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"scaleY\",\r\n {\r\n get: () => {\r\n return this._scaleY;\r\n },\r\n set: (val) => {\r\n var newScale = (+val || 0);\r\n var oldScale = this._scaleY;\r\n if (newScale !== 0 && oldScale !== 0) {\r\n var s = newScale / oldScale;\r\n var c = this.center;\r\n\r\n var m = new THREE.Matrix4().makeTranslation(c.x, c.y, c.z).multiply(new THREE.Matrix4().makeScale(1, s, 1).multiply(new THREE.Matrix4().makeTranslation(-c.x, -c.y, -c.z)));\r\n\r\n this.applyMatrix4(m);\r\n\r\n this._scaleY = newScale;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"scaleZ\",\r\n {\r\n get: () => {\r\n return this._scaleZ;\r\n },\r\n set: (val) => {\r\n var newScale = (+val || 0);\r\n var oldScale = this._scaleZ;\r\n if (newScale !== 0 && oldScale !== 0) {\r\n var s = newScale / oldScale;\r\n var c = this.center;\r\n\r\n var m = new THREE.Matrix4().makeTranslation(c.x, c.y, c.z).multiply(new THREE.Matrix4().makeScale(1, 1, s).multiply(new THREE.Matrix4().makeTranslation(-c.x, -c.y, -c.z)));\r\n\r\n this.applyMatrix4(m);\r\n\r\n this._scaleZ = newScale;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"rotation\",\r\n {\r\n get: () => {\r\n return this._rotation;\r\n },\r\n set: (val) => {\r\n var newRotation = (+val || 0) % 360;\r\n var r = newRotation - this._rotation;\r\n if (r !== 0) {\r\n var c = this.center;\r\n\r\n var m = new THREE.Matrix4().makeTranslation(c.x, c.y, c.z).multiply(new THREE.Matrix4().makeRotationZ(r / 180 * Math.PI).multiply(new THREE.Matrix4().makeTranslation(-c.x, -c.y, -c.z)));\r\n\r\n this.applyMatrix4(m);\r\n\r\n this._rotation = newRotation;\r\n }\r\n }\r\n });\r\n\r\n ko.defineProperty(this, \"height\",\r\n {\r\n get: () => {\r\n return this.array.reduce((c: number, v) => v.z > c ? v.z : c, -Infinity);\r\n },\r\n set: (val) => {\r\n var v = +val || 0;\r\n this.array.forEach(p => { p.setZ(v); });\r\n }\r\n });\r\n }\r\n\r\n subscribe(callback: () => void) {\r\n return ko.getObservable(this, 'array').subscribe(callback);\r\n }\r\n\r\n applyMatrix4(m: THREE.Matrix4) {\r\n this.array.forEach(p => { p.applyMatrix4(m); });\r\n }\r\n\r\n removeAll() {\r\n this.array.removeAll();\r\n }\r\n\r\n push(p: { x: number, y: number, z?: number } | number, py?: number, pz?: number) {\r\n var x: number, y: number, z: number;\r\n\r\n if (typeof p === 'number') {\r\n x = p || 0;\r\n y = py || 0;\r\n z = pz || 0;\r\n } else {\r\n x = p.x || 0;\r\n y = p.y || 0;\r\n z = p.z || 0;\r\n }\r\n\r\n this.array.push(new ObservableVector3().set(x, y, z));\r\n }\r\n\r\n getData(): number[] {\r\n var result: number[] = [],\r\n points = this.array;\r\n\r\n for (var i = 0, l = points.length; i < l; i++) {\r\n var p = points[i];\r\n result.push(p.x, p.y, p.z);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n setLength(length: number) {\r\n var array = this.array;\r\n if (array.length !== length) {\r\n if (array.length > length) {\r\n array.splice(0, array.length - length);\r\n } else {\r\n while (array.length < length) {\r\n array.push(new ObservableVector3());\r\n }\r\n }\r\n }\r\n }\r\n\r\n setAsCircle(c: THREE.Vector3, p: THREE.Vector3) {\r\n if (!c || !p)\r\n return;\r\n\r\n var z = c.z || p.z || 0,\r\n radius = c.setZ(0).distanceTo(p.setZ(0));\r\n\r\n var numPoints = Math.floor(Math.min(32, Math.max(8, radius * 0.2))),\r\n array = this.array;\r\n\r\n if (array.length !== numPoints)\r\n this.setLength(numPoints);\r\n\r\n var cx = c.x,\r\n cy = c.y,\r\n tx = p.x - cx,\r\n ty = p.y - cy,\r\n pi2 = Math.PI * 2;\r\n\r\n for (var i = 0; i < numPoints; i++) {\r\n var rad = pi2 * i / numPoints,\r\n sin: number = Math.sin(rad),\r\n cos: number = Math.cos(rad),\r\n xnew: number = tx * cos - ty * sin,\r\n ynew: number = tx * sin + ty * cos;\r\n\r\n array[i].set(cx + xnew, cy + ynew, z);\r\n }\r\n\r\n }\r\n\r\n setAsRectangle(p1: { x: number, y: number, z?: number }, p2: { x: number, y: number, z?: number }) {\r\n if (!p1 || !p2)\r\n return;\r\n var z = p1.z || p2.z || 0;\r\n\r\n var array = this.array;\r\n\r\n if (array.length !== 4)\r\n this.setLength(4);\r\n\r\n var minx = Math.min(p1.x, p2.x),\r\n miny = Math.min(p1.y, p2.y),\r\n maxx = Math.max(p1.x, p2.x),\r\n maxy = Math.max(p1.y, p2.y);\r\n\r\n array[0].set(minx, miny, z);\r\n array[1].set(maxx, miny, z);\r\n array[2].set(maxx, maxy, z);\r\n array[3].set(minx, maxy, z);\r\n }\r\n\r\n setAsTriangle(p1: { x: number, y: number, z?: number }, p2: { x: number, y: number, z?: number }) {\r\n if (!p1 || !p2)\r\n return;\r\n var z = p1.z || p2.z || 0;\r\n\r\n var array = this.array;\r\n\r\n if (array.length !== 3)\r\n this.setLength(3);\r\n\r\n array[0].set(p1.x, p1.y, z);\r\n array[1].set(p2.x, p2.y, z);\r\n array[2].set(p1.x + p1.x - p2.x, p2.y, z);\r\n }\r\n\r\n setAsThickLine(pts: { x: number, y: number, z?: number }[], width: number) {\r\n //if (!pts || width < 0)\r\n // return;\r\n\r\n //var precision = 100,\r\n // c = new ClipperLib.ClipperOffset();\r\n //c.AddPath(spt.ThreeJs.utils.PointsToPath(pts, precision), ClipperLib.JoinType.jtRound, ClipperLib.EndType.etOpenButt);\r\n //var expanded = new ClipperLib.PolyTree();\r\n //c.Execute(expanded, width * precision);\r\n\r\n //var newPts = spt.ThreeJs.utils.PathsToPoints(expanded, precision)[0];\r\n\r\n //THREE.ShapeUtils.triangulateShape(poly.array.slice(), [])\r\n\r\n //var array = this.array,\r\n // len = pts.length;\r\n\r\n //if (array.length !== len)\r\n // this.setLength(len);\r\n }\r\n\r\n getBoundingSphere() {\r\n var sphere = new THREE.Sphere(),\r\n box = new THREE.Box3().setFromPoints(this.array);\r\n\r\n box.min.setZ(Math.min(box.min.z, 0));\r\n\r\n var center = box.getCenter(sphere.center);\r\n\r\n var maxRadiusSq = 0;\r\n\r\n this.array.forEach(p => {\r\n maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(p));\r\n });\r\n\r\n sphere.radius = Math.sqrt(maxRadiusSq) + 1;\r\n\r\n return sphere;\r\n }\r\n\r\n }\r\n\r\n export class ClientGenericParamsEntry implements IClientGenericParamsEntry {\r\n name: string = \"\";\r\n value: any;\r\n _value: any = null;\r\n oldValue: any;\r\n displayName: string = null;\r\n displayNameInfo: string = null;\r\n min: number = null;\r\n max: number = null;\r\n precision: number = null;\r\n inputType: string = null;\r\n source: string = null;\r\n enableOn: string = null;\r\n hidden: boolean = false;\r\n disabled: boolean = false;\r\n isOverload: boolean = false;\r\n isAngle: boolean = false;\r\n isArray: boolean = false;\r\n expanded: boolean = false;\r\n subscriptions: KnockoutSubscription[];\r\n subscriptionsNeedsUpdate: boolean;\r\n\r\n constructor(p: IClientGenericParamsEntry) {\r\n\r\n if (p && typeof p === \"object\")\r\n Object.keys(p).filter(k => this.hasOwnProperty(k)).forEach(k => { this[k] = p[k]; });\r\n\r\n if (p && ((p.value && Array.isArray(p.value)) || p.isArray)) {\r\n\r\n this.isArray = true;\r\n\r\n this._value = [] as KnockoutObservable[];\r\n\r\n ko.track(this);\r\n\r\n ko.getObservable(this, '_value').subscribe(this.onArrayChange.bind(this), null, \"arrayChange\");\r\n\r\n ko.defineProperty(this, 'value', {\r\n get: () => {\r\n return this._value;\r\n },\r\n set: (vals: any[]) => {\r\n this._value.removeAll();\r\n if (vals && vals.length)\r\n vals.forEach(val => this._value.push(ko.observable(this.processValue(ko.unwrap(val)))));\r\n }\r\n });\r\n\r\n if (p.value && p.value.length)\r\n this.value = p.value;\r\n\r\n this.onArrayChange();\r\n\r\n } else {\r\n ko.track(this);\r\n\r\n ko.defineProperty(this, 'value', {\r\n get: () => {\r\n return this._value;\r\n },\r\n set: (value) => {\r\n var val = this.processValue(value);\r\n this.oldValue = this._value;\r\n this._value = val;\r\n }\r\n });\r\n\r\n ko.getObservable(this, 'value').extend({ notify: 'always' });\r\n ko.getObservable(this, '_value').extend({ notify: 'always' });\r\n\r\n if (p && p.value !== undefined)\r\n this.value = p.value;\r\n\r\n this.oldValue = this.value;\r\n }\r\n }\r\n\r\n unwrapValue(): any {\r\n return this.isArray ? this.value.map(v => ko.unwrap(v)) : this.value;\r\n }\r\n\r\n onArrayChange() {\r\n if (!this.subscriptionsNeedsUpdate) {\r\n this.subscriptionsNeedsUpdate = true;\r\n setTimeout(this.updateSubscriptions.bind(this), 0);\r\n }\r\n }\r\n\r\n updateSubscriptions() {\r\n if (this.subscriptionsNeedsUpdate) {\r\n\r\n if (this.subscriptions)\r\n this.subscriptions.forEach(s => s.dispose());\r\n\r\n var valueArray = this._value as KnockoutObservable[];\r\n\r\n if (valueArray && valueArray.length)\r\n this.subscriptions = valueArray.map((val, i) => val.subscribe(this.onArrayElementChange.bind(this, i)));\r\n else\r\n this.subscriptions = [];\r\n\r\n this.subscriptionsNeedsUpdate = false;\r\n\r\n if (LS.Client3DEditor && LS.Client3DEditor.Controller && LS.Client3DEditor.Controller.Current)\r\n LS.Client3DEditor.Controller.Current.notifyRefreshView();\r\n }\r\n }\r\n\r\n onArrayElementChange(index: number, val: any) {\r\n this._value[index](this.processValue(val));\r\n ko.valueHasMutated(this, '_value');\r\n }\r\n\r\n processValue(value?: any): any {\r\n var val = value !== undefined ? value : null;\r\n\r\n switch (this.inputType) {\r\n case \"float\":\r\n case \"int\":\r\n {\r\n if (typeof val !== \"number\" && typeof val !== \"string\")\r\n val = 0;\r\n val = spt.Utils.ApplyNumberArithmetic(val, false, true);\r\n if (this.isAngle)\r\n val = spt.Utils.ClampAngle(val);\r\n val = spt.Utils.ApplyNumberconstraints(val, this);\r\n if (this.inputType === \"int\")\r\n val = Math.round(val);\r\n }\r\n break;\r\n case \"select\":\r\n {\r\n\r\n }\r\n break;\r\n case \"checkbox\":\r\n {\r\n val = !!value;\r\n }\r\n break;\r\n case \"string\":\r\n {\r\n if (typeof val !== \"string\")\r\n val = \"\";\r\n }\r\n break;\r\n }\r\n\r\n return val;\r\n }\r\n }\r\n\r\n export interface IEntrySetting {\r\n name: string;\r\n typeName: string;\r\n entries: IClientGenericParamsEntry[];\r\n }\r\n\r\n export class EntrySetting implements IEntrySetting {\r\n constructor(entrySetting?: IEntrySetting) {\r\n\r\n if (entrySetting) {\r\n this.name = entrySetting.name;\r\n this.typeName = entrySetting.typeName;\r\n this.default = entrySetting.entries;\r\n this.entries = entrySetting.entries.map(e => new ClientGenericParamsEntry(e));\r\n }\r\n\r\n ko.track(this);\r\n }\r\n\r\n name: string = \"\";\r\n\r\n typeName: string = \"\";\r\n\r\n entries: ClientGenericParamsEntry[] = [];\r\n\r\n default: IClientGenericParamsEntry[] = [];\r\n\r\n getSettingsObject() {\r\n var s = {};\r\n for (var i = this.entries.length; i--;) {\r\n var e = this.entries[i];\r\n if (!e.isOverload)\r\n s[e.name] = e.unwrapValue();\r\n }\r\n return s;\r\n }\r\n\r\n getDefaultSettingsObject() {\r\n var s = {};\r\n for (var i = this.default.length; i--;) {\r\n var e = this.default[i];\r\n s[e.name] = e.value;\r\n }\r\n return s;\r\n }\r\n }\r\n\r\n export class GenericParamsObject implements IEventManager {\r\n\r\n constructor() {\r\n ko.track(this);\r\n\r\n ko.getObservable(this, \"entrySetting\").subscribe((pe: EntrySetting) => {\r\n if (pe) {\r\n this.setEntries(pe.entries);\r\n if (!this.lock) {\r\n if (this.objs.length)\r\n this.applyEntrySettingDefault(pe);\r\n else\r\n this.updateEntries();\r\n }\r\n } else\r\n this.setEntries();\r\n });\r\n\r\n ko.defineProperty(this, \"selectedElements\", () => {\r\n return this.overrideElementsCount >= 0 ? this.overrideElementsCount : this.objs.length;\r\n });\r\n }\r\n\r\n applyEntrySettingDefault(pe: EntrySetting) {\r\n if (this.objs.length) {\r\n var so = pe.getDefaultSettingsObject();\r\n\r\n this.objs.forEach(obj => {\r\n if (obj[\"_myDirectedArea\"]) {\r\n var da = obj[\"_myDirectedArea\"] as spt.ThreeJs.utils.DirectedAreaDefinition;\r\n da.userData = so;\r\n }\r\n });\r\n\r\n applyEntryEvent.data = this.objs;\r\n applyEntryEvent.source = \"TypeName\";\r\n\r\n this.dispatchEvent(applyEntryEvent);\r\n //this.dispatchEvent({ type: 'applyEntry', data: this.objs as any, source: \"TypeName\" });\r\n }\r\n }\r\n\r\n private possibleEntrySettings: EntrySetting[] = [];\r\n entrySetting: EntrySetting = null;\r\n private subscriptions: KnockoutSubscription[];\r\n private overloadSubscriptions: KnockoutSubscription[];\r\n private entries: ClientGenericParamsEntry[] = [];\r\n private objs: LS.Client3DEditor.IParameterObject[] = [];\r\n private lock = false;\r\n overrideElementsCount: number = -1;\r\n selectedElements: number;\r\n\r\n resetToDefault() {\r\n if (this.entrySetting && this.objs.length)\r\n this.applyEntrySettingDefault(this.entrySetting);\r\n }\r\n\r\n getCurrentEntrySetting() {\r\n if (this.entrySetting)\r\n return this.entrySetting;\r\n if (this.possibleEntrySettings.length)\r\n return this.possibleEntrySettings[0];\r\n return null;\r\n }\r\n\r\n getEntrySettingByTypeName(typeName: string) {\r\n for (var i = 0, j = this.possibleEntrySettings.length; i < j; i++) {\r\n var pe = this.possibleEntrySettings[i];\r\n if (pe.typeName === typeName)\r\n return pe;\r\n }\r\n return null;\r\n }\r\n\r\n bindObject(obj: any) {\r\n this.objs.push(obj);\r\n if (this.objs.length <= 1)\r\n this.updateEntries();\r\n }\r\n\r\n unbindObject(obj: any) {\r\n var countBefore = this.objs.length;\r\n var doUpdate = countBefore < 1 || this.objs[0] === obj;\r\n this.objs.remove(obj);\r\n if (doUpdate && countBefore !== this.objs.length)\r\n this.updateEntries();\r\n }\r\n\r\n bindObjects(objs: any[]) {\r\n this.objs.splice.apply(this.objs, [0, 0].concat(objs));\r\n this.updateEntries();\r\n }\r\n\r\n unbindAll() {\r\n this.objs.removeAll();\r\n this.updateEntries();\r\n }\r\n\r\n updateEntries() {\r\n this.lock = true;\r\n\r\n var obj = this.objs.length ? this.objs[0] : null;\r\n\r\n if (obj) {\r\n if (obj.TypeName && (!this.entrySetting || this.entrySetting.typeName !== obj.TypeName))\r\n this.entrySetting = this.getEntrySettingByTypeName(obj.TypeName);\r\n\r\n this.entries.forEach(e => {\r\n var val = e.isOverload ? obj.getParameter(e.name) : obj[e.name];\r\n\r\n if (val !== undefined && val !== null) {\r\n e.disabled = false;\r\n e.value = val;\r\n } else\r\n e.disabled = true;\r\n });\r\n } else\r\n this.entries.forEach(e => {\r\n e.disabled = true;\r\n e.expanded = false;\r\n });\r\n\r\n ko.tasks.runEarly();\r\n\r\n this.lock = false;\r\n }\r\n\r\n applyEntries(entries: ClientGenericParamsEntry[]) {\r\n if (this.lock || !entries || !entries.length)\r\n return;\r\n\r\n entries = entries.filter(entry => !(entry.disabled || entry.hidden || !entry.name));\r\n\r\n if (!entries.length)\r\n return;\r\n\r\n this.objs.forEach(obj => {\r\n entries.forEach(entry => {\r\n if (obj[entry.name] !== undefined)\r\n obj[entry.name] = entry.unwrapValue();\r\n });\r\n });\r\n\r\n applyEntryEvent.data = this.objs.slice();\r\n applyEntryEvent.source = \"TypeName\";\r\n\r\n this.dispatchEvent(applyEntryEvent);\r\n //this.dispatchEvent({ type: 'applyEntry', data: this.objs.slice(), source: \"TypeName\" });\r\n }\r\n\r\n applyEntry(entry: ClientGenericParamsEntry) {\r\n if (this.lock || entry.disabled || entry.hidden || !entry.name)\r\n return;\r\n\r\n var objs: any[];\r\n\r\n if (entry.isOverload)\r\n objs = this.objs.slice();\r\n else {\r\n objs = [];\r\n\r\n this.objs.forEach(obj => {\r\n if (obj[entry.name] !== undefined) {\r\n obj[entry.name] = entry.unwrapValue();\r\n objs.push(obj);\r\n }\r\n });\r\n }\r\n\r\n applyEntryEvent.data = objs;\r\n applyEntryEvent.source = entry;\r\n\r\n this.dispatchEvent(applyEntryEvent);\r\n //this.dispatchEvent({ type: 'applyEntry', data: objs, source: entry });\r\n }\r\n\r\n setOverloadEntries(entries: IClientGenericParamsEntry[]) {\r\n this.entries.removeAll(this.entries.filter(e => e.isOverload));\r\n\r\n if (this.overloadSubscriptions && this.overloadSubscriptions.length)\r\n this.overloadSubscriptions.forEach(s => { s.dispose(); });\r\n\r\n this.overloadSubscriptions = [];\r\n\r\n if (entries) {\r\n var newEntries = entries.map(e => {\r\n var ne = e instanceof ClientGenericParamsEntry ? e : new ClientGenericParamsEntry(e);\r\n ne.isOverload = true;\r\n return ne;\r\n });\r\n\r\n newEntries.forEach(e => {\r\n this.overloadSubscriptions.push(ko.getObservable(e, \"_value\").subscribe(this.applyEntry.bind(this, e)));\r\n });\r\n\r\n this.entries.splice.apply(this.entries, [0, 0].concat(newEntries as any[]));\r\n }\r\n }\r\n\r\n setEntries(entries?: IClientGenericParamsEntry[]) {\r\n this.entries.removeAll(this.entries.filter(e => !e.isOverload));\r\n\r\n if (this.subscriptions && this.subscriptions.length)\r\n this.subscriptions.forEach(s => { s.dispose(); });\r\n\r\n this.subscriptions = [];\r\n\r\n if (entries && entries.length) {\r\n var newEntries = entries.map(e => new ClientGenericParamsEntry(e));\r\n\r\n newEntries.forEach(e => {\r\n this.subscriptions.push(ko.getObservable(e, \"_value\").subscribe(this.applyEntry.bind(this, e)));\r\n });\r\n\r\n this.entries.push.apply(this.entries, newEntries);\r\n }\r\n\r\n }\r\n\r\n setPossibleEntrySettings(entrySettings: IEntrySetting[]) {\r\n this.unbindAll();\r\n\r\n if (this.entrySetting)\r\n this.entrySetting = null;\r\n\r\n this.possibleEntrySettings.removeAll();\r\n\r\n if (entrySettings && entrySettings.length)\r\n this.possibleEntrySettings.push.apply(this.possibleEntrySettings, entrySettings.map(es => new EntrySetting(es)));\r\n\r\n if (this.possibleEntrySettings.length)\r\n this.entrySetting = this.possibleEntrySettings[0];\r\n\r\n this.updateEntries();\r\n }\r\n\r\n GetByName(name: string) {\r\n for (var i = this.entries.length; i--;) {\r\n var e = this.entries[i];\r\n if (e.name === name)\r\n return e;\r\n }\r\n return null;\r\n }\r\n\r\n GetValueByName(name: string) {\r\n for (var i = this.entries.length; i--;) {\r\n var e = this.entries[i];\r\n if (e.name === name)\r\n return e.value;\r\n }\r\n return null;\r\n }\r\n\r\n ToggleValueVisibleBtnClick(d: any) {\r\n var entry = d.data as ClientGenericParamsEntry;\r\n entry.expanded = !entry.expanded;\r\n }\r\n\r\n AddValueBtnClick(d: any) {\r\n var entry = d.data as ClientGenericParamsEntry;\r\n if (entry.isArray) {\r\n var arr = entry.value as any[];\r\n var newVal = arr.length ? ko.unwrap(arr[arr.length - 1]) : entry.processValue();\r\n arr.push(ko.observable(newVal));\r\n //this.applyEntry(entry);\r\n }\r\n }\r\n\r\n RemoveValueBtnClick(index: number, d: any) {\r\n var entry = d.data as ClientGenericParamsEntry;\r\n if (entry.isArray && index >= 0 && index < entry.value.length) {\r\n var arr = entry.value as any[];\r\n arr.splice(index, 1);\r\n //this.applyEntry(entry);\r\n }\r\n }\r\n\r\n addListener(type: string, listener: (event: IEventManagerEvent) => void): EventManager { return this; }\r\n\r\n hasListener(type: string, listener: (event: IEventManagerEvent) => void): boolean { return false; }\r\n\r\n removeListener(type?: string, listener?: (event: IEventManagerEvent) => void): void { }\r\n\r\n dispatchEvent(event: IEventManagerEvent): void { }\r\n }\r\n\r\n EventManager.apply(GenericParamsObject.prototype);\r\n\r\n export class ModuleMetaEdit {\r\n\r\n constructor() {\r\n ko.track(this);\r\n }\r\n\r\n moduleIds: string[] = [];\r\n genericParams: GenericParamsObject = new GenericParamsObject();\r\n metaType: string = null;\r\n params: any = null;\r\n }\r\n}\r\n"]}