bmh_cesium/public/sensors/cesium-sensor-volumes.min.js

31 lines
44 KiB
JavaScript
Raw Normal View History

2025-03-09 23:23:50 +00:00
/**
* Cesium Sensor Volumes - https://github.com/jlouns/cesium-sensor-volumes
*
* Copyright 2016 Jonathan Lounsbury
* Copyright 2011-2014 Analytical Graphics Inc. and Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Portions licensed separately.
* See https://github.com/jlouns/cesium-sensor-volumes/blob/master/LICENSE.md for full licensing details.
*
* Derived from Cesium Sensors - https://github.com/AnalyticalGraphicsInc/cesium-sensors
*/
/**
* @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
* Released under MIT license, http://github.com/requirejs/almond/LICENSE
*/
!function(){var e,i,r;!function(t){function o(e,i){return y.call(e,i)}function n(e,i){var r,t,o,n,s,a,u,l,c,m,d,h,C=i&&i.split("/"),f=g.map,p=f&&f["*"]||{};if(e){for(e=e.split("/"),s=e.length-1,g.nodeIdCompat&&A.test(e[s])&&(e[s]=e[s].replace(A,"")),"."===e[0].charAt(0)&&C&&(h=C.slice(0,C.length-1),e=h.concat(e)),c=0;c<e.length;c++)if("."===(d=e[c]))e.splice(c,1),c-=1;else if(".."===d){if(0===c||1===c&&".."===e[2]||".."===e[c-1])continue;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((C||p)&&f){for(r=e.split("/"),c=r.length;c>0;c-=1){if(t=r.slice(0,c).join("/"),C)for(m=C.length;m>0;m-=1)if((o=f[C.slice(0,m).join("/")])&&(o=o[t])){n=o,a=c;break}if(n)break;!u&&p&&p[t]&&(u=p[t],l=c)}!n&&u&&(n=u,a=l),n&&(r.splice(0,a,n),e=r.join("/"))}return e}function s(e,i){return function(){var r=w.call(arguments,0);return"string"!=typeof r[0]&&1===r.length&&r.push(null),C.apply(t,r.concat([e,i]))}}function a(e){return function(i){return n(i,e)}}function u(e){return function(i){_[e]=i}}function l(e){if(o(v,e)){var i=v[e];delete v[e],S[e]=!0,h.apply(t,i)}if(!o(_,e)&&!o(S,e))throw new Error("No "+e);return _[e]}function c(e){var i,r=e?e.indexOf("!"):-1;return r>-1&&(i=e.substring(0,r),e=e.substring(r+1,e.length)),[i,e]}function m(e){return e?c(e):[]}function d(e){return function(){return g&&g.config&&g.config[e]||{}}}var h,C,f,p,_={},v={},g={},S={},y=Object.prototype.hasOwnProperty,w=[].slice,A=/\.js$/;f=function(e,i){var r,t=c(e),o=t[0],s=i[1];return e=t[1],o&&(o=n(o,s),r=l(o)),o?e=r&&r.normalize?r.normalize(e,a(s)):n(e,s):(e=n(e,s),t=c(e),o=t[0],e=t[1],o&&(r=l(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:r}},p={require:function(e){return s(e)},exports:function(e){var i=_[e];return void 0!==i?i:_[e]={}},module:function(e){return{id:e,uri:"",exports:_[e],config:d(e)}}},h=function(e,i,r,n){var a,c,d,h,C,g,y,w=[],A=typeof r;if(n=n||e,g=m(n),"undefined"===A||"function"===A){for(i=!i.length&&r.length?["require","exports","module"]:i,C=0;C<i.length;C+=1)if(h=f(i[C],g),"require"===(c=h.f))w[C]=p.require(e);else if("exports"===c)w[C]=p.exports(e),y=!0;else if("module"===c)a=w[C]=p.module(e);else if(o(_,c)||o(v,c)||o(S,c))w[C]=l(c);else{if(!h.p)throw new Error(e+" missing "+c);h.p.load(h.n,s(n,!0),u(c),{}),w[C]=_[c]}d=r?r.apply(_[e],w):void 0,e&&(a&&a.exports!==t&&a.exports!==_[e]?_[e]=a.exports:d===t&&y||(_[e]=d))}else e&&(_[e]=r)},e=i=C=function(e,i,r,o,n){if("string"==typeof e)return p[e]?p[e](i):l(f(e,m(i)).f);if(!e.splice){if(g=e,g.deps&&C(g.deps,g.callback),!i)return;i.splice?(e=i,i=r,r=null):e=t}return i=i||function(){},"function"==typeof r&&(r=o,o=n),o?h(t,e,i,r):setTimeout(function(){h(t,e,i,r)},4),C},C.config=function(e){return C(e)},e._defined=_,r=function(e,i,r){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");i.splice||(r=i,i=[]),o(_,e)||o(v,e)||(v[e]=[e,i,r])},r.amd={jQuery:!0}}(),r("conic/conic-sensor-graphics",["require","Cesium/Core/defaultValue","Cesium/Core/defined","Cesium/Core/defineProperties","Cesium/Core/DeveloperError","Cesium/Core/Event","Cesium/DataSources/createMaterialPropertyDescriptor","Cesium/DataSources/createPropertyDescriptor"],function(e){"use strict";var i=e("Cesium/Core/defaultValue"),r=e("Cesium/Core/defined"),t=e("Cesium/Core/defineProperties"),o=e("Cesium/Core/DeveloperError"),n=e("Cesium/Core/Event"),s=e("Cesium/DataSources/createMaterialPropertyDescriptor"),a=e("Cesium/DataSources/createPropertyDescriptor"),u=function(e){this._minimumClockAngle=void 0,this._minimumClockAngleSubscription=void 0,this._maximumClockAngle=void 0,this._maximumClockAngleSubscription=void 0,this._innerHalfAngle=void 0,this._innerHalfAngleSubscription=void 0,this._outerHalfAngle=void 0,this._outerHalfAngleSubscription=void 0,this._lateralSurfaceMaterial=void 0,this._lateralSurfaceMaterialSubscription=void 0,this._intersectionColor=void 0,this._intersectionColorSubscription=void 0,this._intersectionWidth=void 0,this._intersectionWidthSubscription=void 0,this._showIntersection=void 0,this._showIntersectionSubscription=void 0,this._radius=void 0,this._radiusSubscription=void 0,this._show=void 0,this.
set:function(e){this._customSensor.showIntersection=e}},showThroughEllipsoid:{get:function(){return this._customSensor.showThroughEllipsoid},set:function(e){this._customSensor.showThroughEllipsoid=e}},modelMatrix:{get:function(){return this._customSensor.modelMatrix},set:function(e){this._customSensor.modelMatrix=e}},radius:{get:function(){return this._customSensor.radius},set:function(e){this._customSensor.radius=e}},lateralSurfaceMaterial:{get:function(){return this._customSensor.lateralSurfaceMaterial},set:function(e){this._customSensor.lateralSurfaceMaterial=e}},intersectionColor:{get:function(){return this._customSensor.intersectionColor},set:function(e){this._customSensor.intersectionColor=e}},intersectionWidth:{get:function(){return this._customSensor.intersectionWidth},set:function(e){this._customSensor.intersectionWidth=e}},id:{get:function(){return this._customSensor.id},set:function(e){this._customSensor.id=e}}}),d.prototype.update=function(e){this._customSensor.update(e)},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this._customSensor=this._customSensor&&this._customSensor.destroy(),a(this)},d}),r("rectangular/rectangular-sensor-visualizer",["require","Cesium/Core/AssociativeArray","Cesium/Core/Cartesian3","Cesium/Core/Color","Cesium/Core/defined","Cesium/Core/destroyObject","Cesium/Core/DeveloperError","Cesium/Core/Math","Cesium/Core/Matrix3","Cesium/Core/Matrix4","Cesium/Core/Quaternion","Cesium/DataSources/MaterialProperty","Cesium/DataSources/Property","./rectangular-pyramid-sensor-volume","../util/remove-primitive"],function(e){"use strict";var i=e("Cesium/Core/AssociativeArray"),r=e("Cesium/Core/Cartesian3"),t=e("Cesium/Core/Color"),o=e("Cesium/Core/defined"),n=e("Cesium/Core/destroyObject"),s=e("Cesium/Core/DeveloperError"),a=e("Cesium/Core/Math"),u=e("Cesium/Core/Matrix3"),l=e("Cesium/Core/Matrix4"),c=e("Cesium/Core/Quaternion"),m=e("Cesium/DataSources/MaterialProperty"),d=e("Cesium/DataSources/Property"),h=e("./rectangular-pyramid-sensor-volume"),C=e("../util/remove-primitive"),f=t.WHITE,p=Number.POSITIVE_INFINITY,_=new u,v=new r,g=new c,S=function(e,r){if(!o(e))throw new s("scene is required.");if(!o(r))throw new s("entityCollection is required.");r.collectionChanged.addEventListener(S.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=r,this._hash={},this._entitiesToVisualize=new i,this._onCollectionChanged(r,r.values,[],[])};return S.prototype.update=function(e){if(!o(e))throw new s("time is required.");for(var i=this._entitiesToVisualize.values,t=this._hash,n=this._primitives,C=0,S=i.length;C<S;C++){var y,w,A=i[C],M=A._rectangularSensor,x=t[A.id],E=A.isShowing&&A.isAvailable(e)&&d.getValueOrDefault(M._show,e,!0);if(E&&(y=d.getValueOrUndefined(A._position,e,v),w=d.getValueOrUndefined(A._orientation,e,g),E=o(y)&&o(w)),E){var D=o(x)?x.primitive:void 0;o(D)||(D=new h,D.id=A,n.add(D),x={primitive:D,position:void 0,orientation:void 0},t[A.id]=x),r.equals(y,x.position)&&c.equals(w,x.orientation)||(l.fromRotationTranslation(u.fromQuaternion(w,_),y,D.modelMatrix),x.position=r.clone(y,x.position),x.orientation=c.clone(w,x.orientation)),D.show=!0,D.xHalfAngle=d.getValueOrDefault(M._xHalfAngle,e,a.PI_OVER_TWO),D.yHalfAngle=d.getValueOrDefault(M._yHalfAngle,e,a.PI_OVER_TWO),D.radius=d.getValueOrDefault(M._radius,e,p),D.lateralSurfaceMaterial=m.getValue(e,M._lateralSurfaceMaterial,D.lateralSurfaceMaterial),D.intersectionColor=d.getValueOrClonedDefault(M._intersectionColor,e,f,D.intersectionColor),D.intersectionWidth=d.getValueOrDefault(M._intersectionWidth,e,1)}else o(x)&&(x.primitive.show=!1)}return!0},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){for(var e=this._entitiesToVisualize.values,i=this._hash,r=this._primitives,t=e.length-1;t>-1;t--)C(e[t],i,r);return n(this)},S.prototype._onCollectionChanged=function(e,i,r,t){var n,s,a=this._entitiesToVisualize,u=this._hash,l=this._primitives;for(n=i.length-1;n>-1;n--)s=i[n],o(s._rectangularSensor)&&o(s._position)&&o(s._orientation)&&a.set(s.id,