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.
11 lines
4.0 KiB
11 lines
4.0 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
define("../../../geometry ../../../Graphic ../../../core/arrayUtils ../../../core/promiseUtils ../../../core/accessorSupport/ensureType ../../../geometry/Mesh ../../../geometry/projection ../../../geometry/support/MeshVertexAttributes ../../../layers/orientedImagery/core/coverageUtils ../../../layers/orientedImagery/transformations/imageToGroundUtils ../symbols ../../../geometry/Point".split(" "),function(N,q,y,n,A,z,t,B,u,C,r,D){async function E(p,a,d,e){return Float64Array.from((await Promise.all(p.reduce((c, |
|
f,b)=>{b=Math.floor(b/3);c[b]=c[b]??[];c[b].push(f);return c},[]).map(async c=>(await t.projectWithZConversion(new D(c,a),d,e)).toArray()))).flat())}class F{constructor(p){this.viewModel=p;this.createFootprints=async a=>{const {coverageFrustums:d,currentBestFeature:e,isAdditionalCoverageVisible:c,view:f}=this.viewModel;var b=d.filter(y.isSome);for(const l of b){b=l.clone();if(!f.spatialReference.equals(b.spatialReference)){const {components:m,spatialReference:g,origin:v,vertexAttributes:h,vertexSpace:w}= |
|
b;if("local"===w.type){const x=await t.projectWithZConversion(v,f.spatialReference,a);n.throwIfAborted(a);b.centerAt(x)}else b=Float64Array.from(await u.projectVertices([...h.position],g.clone(),f.spatialReference.clone(),a)),n.throwIfAborted(a),b=new z({vertexAttributes:new B.MeshVertexAttributes({position:b}),components:m,spatialReference:f.spatialReference.clone()})}l.imageID===e.attributes.objectId?this.viewModel.bestFeatureFootprint=new q({attributes:{imageID:l.imageID},geometry:b,symbol:r.activeFrustumSymbol.clone(), |
|
visible:!1}):this.viewModel.additionalFootprints.push(new q({attributes:{imageID:l.imageID},geometry:b,symbol:r.additionalFrustumSymbol.clone(),visible:c}))}};this.updateFootprint=async(a,d)=>{const {currentBestFeature:e,imagePointsInView:c,activeViewer:f,footprintExtent:b,view:l}=this.viewModel;var m=A.ensureType(z,this.viewModel.getCurrentBestFeaturePolygon().geometry),g=f?.imageSize;if(e&&m&&c&&g&&b){var {cameraHeight:v,location:h,cameraPitch:w,horizontalFieldOfView:x,verticalFieldOfView:G,cameraRoll:H, |
|
imageRotation:I}=e.attributes,J=h.toArray(),{vertexAttributes:{position:K},spatialReference:L}=m;m=await E(K,L,h.spatialReference);a=await C.transformPoints(a,{feature:e,imageProperties:{width:g[0],height:g[1]},options:d,footprintExtent:b});n.throwIfAborted(d);a=a.filter(y.isSome);a.length&&(a[0].spatialReference.equals(h.spatialReference)||(a=await Promise.all(a.map(async k=>{k=await t.projectWithZConversion(k,h.spatialReference,d);n.throwIfAborted(d);return k}))),g=await u.updateFrustum(c.slice(0, |
|
4).map(({x:k,y:M})=>[k,M]),a.slice(0,4).map(k=>k.toArray()),{cameraHeight:v,cameraLocation:J,cameraPitch:w,frustumVertices:m,horizontalFieldOfView:x,imageHeight:g[1],imageWidth:g[0],inSRS:{wkid:h.spatialReference.wkid},outSRS:{wkid:l.spatialReference.wkid},verticalFieldOfView:G,cameraRoll:H??0,imageRotation:I??0,options:d}),this.viewModel.updateCurrentCoveragePolygon(new q({attributes:{imageID:e.attributes.objectId},geometry:g,symbol:r.activeFrustumSymbol.clone(),visible:this.viewModel.currentCoverageVisible})))}}; |
|
this.updateFootprintPanorama=async(a,d)=>{await n.waitTick(d);const {horizontalFieldOfView:e,pitch:c,verticalFieldOfView:f,yaw:b}=a;if(a=this.viewModel.currentBestFeature?.clone())({attributes:a}=a),a.orientedImageryType=null,a.cameraHeading=(b+a.cameraHeading)%360,a.cameraPitch=c,a.horizontalFieldOfView=e,a.verticalFieldOfView=f,a.cameraRoll=0,{frustum:d}=u.createCoveragePolygon(a),d&&this.viewModel.updateCurrentCoveragePolygon(new q({attributes:{imageID:a.objectId},geometry:d,symbol:r.activeFrustumSymbol.clone(), |
|
visible:this.viewModel.currentCoverageVisible}))}}updateGroundElevation(p,a){const {geometry:d}=this.viewModel.currentBestFeature,e=a.queryElevation(d);p.forEach(c=>{({geometry:c}=c);switch(c?.type){case "mesh":({vertexAttributes:{position:c}}=c);const f=Math.floor(c.length/3);for(let b=0;b<f;b+=1)c[3*b+2]+=e?.z??0;break;case "point":c.z=(c.z??0)+(e?.z??0)}})}}return F}); |