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.
10 lines
3.4 KiB
10 lines
3.4 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("exports ../../../geometry/GeometryCursor ../../../geometry/geometryCursorCollectUtils ../../../geometry/support/coordsUtils ../CIMCursor ../enums ../GeometryWalker ../utils".split(" "),function(l,k,g,n,p,d,m,q){class f{static local(){null===f.instance&&(f.instance=new f);return f.instance}execute(a,b,c,e,h){return new r(a,b,c,e)}}f.instance=null;class r extends p.PathEffectCursor{constructor(a,b,c,e){super(a,!0,!0);this._firstCurve=null;this._walker=new m.GeometryWalker;this._walker.updateTolerance(c); |
|
this._endings=b.lineDashEnding;this._customDashPos=-(b.offsetAlongLine??0)*c;this._offsetAtEnd=(b.customEndingOffset??0)*c;this._tileKey=e;a=q.normalizeDashTemplate(b).dashTemplate;null==a&&(a=[]);a.length%2&&(a=[...a,...a]);b=0;for(e=0;e<a.length;e++){let h=Math.abs(a[e]);1E-7>h&&(h=1E-7);b+=h}this._patternLength=b;this._numOfDashesPerPattern=a.length/2;this._pattern=new m.DashPattern;this._pattern.init(a,!0);this._pattern.scale(c)}processPath(a){if(0===this._pattern.length())return this.iteratePath= |
|
!1,a=g.collectPath(a),k.GeometryCursor.fromJSONCIM({paths:[a]});if(!this.iteratePath){var b=!0;switch(this._endings){default:this._pattern.extPtGap=0;break;case d.LineDashEnding.FullPattern:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case d.LineDashEnding.FullGap:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case d.LineDashEnding.NoConstraint:this.isClosed||(b=!1);break;case d.LineDashEnding.Custom:this.isClosed||(this._pattern.extPtGap= |
|
.5*this._offsetAtEnd)}var c=a.pathLength();if(this._pattern.isEmpty()||c<.1*this._pattern.length()||!this._walker.init(a,this._pattern,b))return a=g.collectPath(a),k.GeometryCursor.fromJSONCIM({paths:[a]})}if(this.iteratePath)a=this._pattern.nextValue();else{switch(this._endings){default:b=.5*this._pattern.firstValue();break;case d.LineDashEnding.HalfGap:b=.5*-this._pattern.lastValue();break;case d.LineDashEnding.FullGap:b=-this._pattern.lastValue();break;case d.LineDashEnding.FullPattern:b=0;break; |
|
case d.LineDashEnding.NoConstraint:case d.LineDashEnding.Custom:b=-this._customDashPos}a=b/this._pattern.length();a-=Math.floor(a);b=a*this._pattern.length();this._pattern.reset();a=this._pattern.nextValue();for(c=!1;b>=a;)b-=a,a=this._pattern.nextValue(),c=!c;a-=b;c?(this._walker.nextPosition(a),a=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(a),a=this._pattern.nextValue(),this._walker.nextPosition(a),a=this._pattern.nextValue())}if(b=this._walker.nextCurve(a))if(this._walker.isPathEnd()){if(this.iteratePath= |
|
!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)b.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else a=this._pattern.nextValue(),!this._walker.nextPosition(a)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(b.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,b=this._firstCurve,this._firstCurve=null;b?.reset();return b}isClippingRequired(a){a=g.collectMultipath(a);let b=0;for(const c of a)b+= |
|
n.getPathLength(c);return 1E3<Math.round(b/this._patternLength*this._numOfDashesPerPattern)}}l.EffectDashes=f;Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}); |