You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
375 KiB
1 line
375 KiB
|
3 years ago
|
!function(){"use strict";var e,t=window.Glodon=window.Glodon||{};t.Version="2022-3-2-17-50",function(){function e(e,t){let n=t.split("."),a=e,i=n.length;for(let e=0;e<i;e++)void 0===a[n[e]]&&(a[n[e]]={}),a=a[n[e]];return a}e(t,"Web.Lang.Utility.Namespace").ensureNamespace=e}(),function(){let e=t.Web.Lang.Utility.Namespace.ensureNamespace(t,"Web.Common"),n=function(e){"string"==typeof e&&(e=JSON.parse(res)),this.code=e.code,this.message=e.message};n.prototype={getErrorCode:function(){return this.code},getErrorMessage:function(){return this.message}},e.Error=n}();class n{constructor(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}clone(){return new this.constructor(this.x,this.y,this.z)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}distanceToSquared(e){var t=this.x-e.x,n=this.y-e.y,a=this.z-e.z;return t*t+n*n+a*a}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}}class a{constructor(e,t){this.min=e||new n(1/0,1/0,1/0),this.max=t||new n(-1/0,-1/0,-1/0)}getSize(){return new n(this.max.x-this.min.x,this.max.y-this.min.y,this.max.z-this.min.z)}setFromCenterAndSize(e,t){let a=new n(t.x,t.y).multiplyScalar(.5);return this.min.copy(e).sub(a),this.max.copy(e).add(a),this}getCenter(){return new n(this.min.x+this.max.x,this.min.y+this.max.y,this.min.z+this.max.z).multiplyScalar(.5)}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}union(e){return this.min.min(e.min),this.max.max(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}expandByPoint(e){return this.min.min(e),this.max.max(e),this}setFromPoints(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}}!function(){let e=t.Web.Lang.Utility.Namespace.ensureNamespace(t,"Web.Algorithm");e.MeanShift=class{constructor(e,t){this.points=e,this.searchRangeSquared=t**2,this.EPSILON_SQR=.1,this.clusters=[]}setSearchRange(e){this.searchRangeSquared=e**2}setPoints(e){this.points=e}meanShift(e){let t=e.clone(),n=[];for(;;){let e=this.rangeSearch(t);n=this.connect(n,e);let a=this.mean(e);if(t.distanceToSquared(a)<=this.EPSILON_SQR)break;t=a}return n}mean(e){let t=new n;for(const n of e)t.add(n);return t.multiplyScalar(1/e.length),t}rangeSearch(e){let t=[];for(const n of this.points)e.distanceToSquared(n)<=this.searchRangeSquared&&t.push(n);return t}clustering(e,t){0===this.clusters.length?this.clusteringPrepare():this.clusteringAfter(e,t),this.clusters.forEach((e=>{this.resetPointStatus(e.points)}))}clusteringPrepare(){for(const e of this.points){if(e.stopMoving)continue;const t=this.meanShift(e),n=t.length,a=`${t[0].index}_${n}`;this.mergeClusters({points:t,center:this.mean(t),id:a,parent:null,children:[]})}}clusteringAfter(e,t){this.tmpPoints=this.points,this.points=[];let n=[...this.clusters];if(this.clusters=[],!1!==e){for(let e=0;e<n.length;e++){const a=n[e];let i=[];t||this.resetClusterPoints(a.points),this.points=a.points,this.clusteringZoomIn(a,i),this.clusters.push.apply(this.clusters,i)}this.clusters.forEach((e=>{this.resetPointStatus(e.points)}))}else this.clusteringZoomOut(n,t)}clusteringZoomIn(e,t){for(const n of e.points){if(n.stopMoving)continue;const a=this.meanShift(n),i=a.length,o=`${a[0].index}_${i}`;this.mergeClustersInTarget({points:a,center:this.mean(a),id:o,parent:e.id,children:[]},t)}}clusteringZoomOut(e,t){for(let n=0;n<e.length;n++){const a=e[n];t||this
|