Your Name
2022-03-14 f5c7ecb8db935bc07169938869e3260b21fda13a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
 * Cesium - https://github.com/AnalyticalGraphicsInc/cesium
 *
 * Copyright 2011-2017 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
 *
 * 
 *  该版本修改了部分代码,主要是汉化、优化功能、添加接口 等 by 火星科技 http://marsgis.cn
 *  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.
 *
 * Columbus View (Pat. Pend.)
 *
 * Portions licensed separately.
 * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details.
 */
define(["exports","./defined-b9ff0e39","./Check-e6691f86","./defaultValue-199f5aa8","./Cartesian2-8fa798b8","./Transforms-a140c8a7"],function(t,c,e,a,r,d){"use strict";function x(t,e,n,i){this.x=a.defaultValue(t,0),this.y=a.defaultValue(e,0),this.width=a.defaultValue(n,0),this.height=a.defaultValue(i,0)}x.packedLength=4,x.pack=function(t,e,n){return n=a.defaultValue(n,0),e[n++]=t.x,e[n++]=t.y,e[n++]=t.width,e[n]=t.height,e},x.unpack=function(t,e,n){return e=a.defaultValue(e,0),c.defined(n)||(n=new x),n.x=t[e++],n.y=t[e++],n.width=t[e++],n.height=t[e],n},x.fromPoints=function(t,e){if(c.defined(e)||(e=new x),!c.defined(t)||0===t.length)return e.x=0,e.y=0,e.width=0,e.height=0,e;for(var n=t.length,i=t[0].x,h=t[0].y,a=t[0].x,r=t[0].y,d=1;d<n;d++){var u=t[d],f=u.x,o=u.y;i=Math.min(f,i),a=Math.max(f,a),h=Math.min(o,h),r=Math.max(o,r)}return e.x=i,e.y=h,e.width=a-i,e.height=r-h,e};var u=new d.GeographicProjection,f=new r.Cartographic,o=new r.Cartographic;x.fromRectangle=function(t,e,n){if(c.defined(n)||(n=new x),!c.defined(t))return n.x=0,n.y=0,n.width=0,n.height=0,n;var i=(e=a.defaultValue(e,u)).project(r.Rectangle.southwest(t,f)),h=e.project(r.Rectangle.northeast(t,o));return r.Cartesian2.subtract(h,i,h),n.x=i.x,n.y=i.y,n.width=h.x,n.height=h.y,n},x.clone=function(t,e){if(c.defined(t))return c.defined(e)?(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e):new x(t.x,t.y,t.width,t.height)},x.union=function(t,e,n){c.defined(n)||(n=new x);var i=Math.min(t.x,e.x),h=Math.min(t.y,e.y),a=Math.max(t.x+t.width,e.x+e.width),r=Math.max(t.y+t.height,e.y+e.height);return n.x=i,n.y=h,n.width=a-i,n.height=r-h,n},x.expand=function(t,e,n){n=x.clone(t,n);var i=e.x-n.x,h=e.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=e.x),h>n.height?n.height=h:h<0&&(n.height-=h,n.y=e.y),n},x.intersect=function(t,e){var n=t.x,i=t.y,h=e.x,a=e.y;return n>h+e.width||n+t.width<h||i+t.height<a||i>a+e.height?d.Intersect.OUTSIDE:d.Intersect.INTERSECTING},x.equals=function(t,e){return t===e||c.defined(t)&&c.defined(e)&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},x.prototype.clone=function(t){return x.clone(this,t)},x.prototype.intersect=function(t){return x.intersect(this,t)},x.prototype.equals=function(t){return x.equals(this,t)},t.BoundingRectangle=x});