@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 3.85 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{G as e}from"./GeometryCursor.js";import{n as t,G as s,c as i}from"./Geometry.js";import{E as m,n as r}from"./MultiPathImpl.js";import{Envelope2D as o}from"./Envelope2D.js";import{c as h,P as n}from"./Envelope.js";import{h as _,z as p,A as a,v as l,u,w as y,B as c,D as G,C as g,E as d}from"./SpatialReference.js";class f{getOperatorType(){return 10009}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,i=0){return new x(e,t,s,i)}}class x extends e{constructor(e,s,i,o){super(),this.m_shape=new m,this.m_currentGeom=r,this.m_progressCounter=0,this.m_geomIndex=-1,this.m_geomTypeIndex=-1,this.m_index=-1,this.m_bBuilt=!1,this.m_bOutputOnlyModified=!1,this.m_bSimplifyPolygons=!1,this.m_bSnapToSr=!1,this.m_progressTracker=i,this.m_inputGeometries=e,this.m_sr=s,this.m_options=o,1===o||2===o?(this.m_bOutputOnlyModified=!0,this.m_options=0,this.m_bSimplifyPolygons=!0,this.m_bSnapToSr=null!=s&&2===o,this.m_bSnapToSr&&!_()&&t("PE is required for snapping to spatial reference operation")):0===o&&(this.m_bSimplifyPolygons=!0)}progress_(e=!1){}tock(){return!0}getRank(){return 1}moveToNextGeom(){for(;;){if(this.m_bBuilt?this.m_currentGeom=this.m_shape.getNextGeometry(this.m_currentGeom):(this.m_currentGeom=this.m_shape.getFirstGeometry(),this.m_bBuilt=!0),this.m_currentGeom!==r){let e=!1;if(this.m_bSimplifyPolygons&&this.m_shape.getGeometryType(this.m_currentGeom)===s.enumPolygon&&(e=p(this.m_shape,this.m_currentGeom,-1,!1,r,this.m_progressTracker)),this.m_bOutputOnlyModified&&!e&&!this.m_shape.getGeometryModified(this.m_currentGeom))continue}break}}next(){if(this.m_bBuilt)this.moveToNextGeom();else{this.m_geomIndex=this.m_shape.createGeometryUserIndex();const e=new o;for(let r=this.m_inputGeometries.next();null!=r;r=this.m_inputGeometries.next()){this.progress_(),i(r);let t=!1;this.m_bSnapToSr&&(r=r.clone(),t=a(this.m_sr,r));const m=this.m_shape.addGeometry(r);this.m_shape.setGeometryUserIndex(m,this.m_geomIndex,this.m_inputGeometries.getGeometryID());const h=r.getGeometryType();h===s.enumPoint&&(-1===this.m_geomTypeIndex&&(this.m_geomTypeIndex=this.m_shape.createGeometryUserIndex()),this.m_shape.setGeometryUserIndex(m,this.m_geomTypeIndex,h));const n=new o;r.queryLooseEnvelope(n),e.mergeEnvelope2D(n),t&&this.m_shape.setGeometryModified(m,!0)}const t=h(this.m_sr,e,!0),m=h(this.m_sr,e,!1);e.inflate(10*t.total()),this.m_shape.forceSetEnvelope2D(e);let n=null,_=0,f=0;if(this.m_shape.hasCurves()){n=new g;const s=l(t.total(),e);_=u(t.total()),f=d(s,_),y(this.m_shape,s,t.total(),12e3,n,null,this.m_progressTracker)}if(c(this.m_shape,m,this.m_progressTracker)){if(G(this.m_shape,t.add(f),this.m_progressTracker,0===this.m_options,this.m_bOutputOnlyModified),null!==n){if(this.m_bSimplifyPolygons){for(let e=this.m_shape.getFirstGeometry();e!==r;e=this.m_shape.getNextGeometry(e))if(this.m_shape.getGeometryType(e)===s.enumPolygon){p(this.m_shape,e,-1,!1,r,this.m_progressTracker)&&this.m_shape.setGeometryModified(e,!0)}this.m_bSimplifyPolygons=!1}n.stitchCurves(this.m_shape,r,_,!0),n.clearStitcher(this.m_shape)}}else this.m_bSimplifyPolygons=!1,null!==n&&(n.stitchCurves(this.m_shape,r,_,!0),n.clearStitcher(this.m_shape));this.moveToNextGeom()}if(this.m_currentGeom!==r){if(this.m_index=this.m_shape.getGeometryUserIndex(this.m_currentGeom,this.m_geomIndex),-1!==this.m_geomTypeIndex&&this.m_shape.getGeometryUserIndex(this.m_currentGeom,this.m_geomTypeIndex)===s.enumPoint){const e=new n({vd:this.m_shape.getVertexDescription()});return this.m_shape.queryPointGeometryOnly(this.m_currentGeom,e),this.m_bSnapToSr&&a(this.m_sr,e),e}{const e=this.m_shape.getGeometry(this.m_currentGeom);return this.m_bSnapToSr&&a(this.m_sr,e),e}}return null}getGeometryID(){return this.m_index}}export{f as O};