@arcgis/core 5.2.0-next.91 → 5.2.0-next.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/19ab024f6f732fd6c69b.js +1 -0
- package/assets/esri/core/workers/chunks/{c6ec0e966106f66360d9.js → 349b0c7febc46267441d.js} +3 -3
- package/assets/esri/core/workers/chunks/75b90fb05e4a2d32b7bb.js +1 -0
- package/assets/esri/core/workers/chunks/a74182ff402c3a808323.js +1 -0
- package/assets/esri/core/workers/chunks/bb23e670736bcace8b6f.js +1 -0
- package/config.js +1 -1
- package/geometry/support/HalfFloatArray.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/kernel.js +1 -1
- package/package.json +2 -2
- package/smartMapping/symbology/types.d.ts +1 -1
- package/support/revision.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +11 -11
- package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
- package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/widgets/Directions.d.ts +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/assets/esri/core/workers/chunks/07613ecf13c38ad58b79.js +0 -1
- package/assets/esri/core/workers/chunks/48e2d0bfb62e1f4f2ad9.js +0 -1
- package/assets/esri/core/workers/chunks/ad404195107eadf91e16.js +0 -1
- package/assets/esri/core/workers/chunks/bf11319138facf44752c.js +0 -1
- package/geometry/support/float16.js +0 -2
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let r,s=e;function i(o){r=o}function t(e){const s=r?.findCredential(e);return s?.token?o(e,"token",s.token):e}s="5.2.0-next.
|
|
2
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let r,s=e;function i(o){r=o}function t(e){const s=r?.findCredential(e);return s?.token?o(e,"token",s.token):e}s="5.2.0-next.93",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,s as fullVersion,r as id,i as setId,e as version};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.93",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.20.3",
|
|
23
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
23
|
+
"@arcgis/toolkit": "5.2.0-next.93",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
25
25
|
"@esri/calcite-components": "^5.2.0-next.52",
|
|
26
26
|
"@vaadin/grid": "~25.2.9",
|
|
@@ -523,7 +523,7 @@ export interface SizeSchemeForPolygon {
|
|
|
523
523
|
*/
|
|
524
524
|
marker: SizeSchemeForPoint;
|
|
525
525
|
/**
|
|
526
|
-
* The schema defining the
|
|
526
|
+
* The schema defining the background symbol of the feature. This is a fill symbol.
|
|
527
527
|
*
|
|
528
528
|
* @since 5.0
|
|
529
529
|
*/
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const c="
|
|
2
|
+
const c="20260831",f="5e0cf952a325fa7823d9c47b12dffe65c39750b0";export{c as buildDate,f as revision};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{BufferViewVec2f16 as e,BufferViewVec2f as t,BufferViewVec2f64 as i,BufferViewVec3f16 as s,BufferViewVec3f as r,BufferViewVec3f64 as n,BufferViewVec4f16 as h,BufferViewVec4f as d,BufferViewVec4f64 as u,BufferViewMat3f as f,BufferViewMat3f64 as o,BufferViewMat4f as l,BufferViewMat4f64 as p,BufferViewVec4u8 as c,BufferViewFloat16 as a,BufferViewFloat as _,BufferViewFloat64 as F,BufferViewUint8 as y,BufferViewUint16 as m,BufferViewInt8 as b,BufferViewVec2i8 as g,BufferViewVec2i16 as w,BufferViewVec2u8 as v,BufferViewVec2u16 as E,BufferViewVec4u16 as A,BufferViewVec4i16 as M,BufferViewUint32 as T,BufferViewVec3u8 as U,BufferViewVec3u16 as j,BufferViewVec2u32 as B,BufferViewVec3u32 as L,BufferViewVec4u32 as x,BufferViewVec3i8 as C,BufferViewVec4i8 as z,BufferViewInt16 as V,BufferViewVec3i16 as $,BufferViewInt32 as O,BufferViewVec2i32 as k,BufferViewVec3i32 as q,BufferViewVec4i32 as D}from"../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as G}from"../../../../geometry/support/buffer/types.js";import{glLayout as H}from"./glUtil.js";import{assert as I}from"../../webgl-engine/lib/Util.js";import{fromLayout as J}from"../../../webgl/VertexAttributeLocations.js";class K{constructor(e,t,i=0){this.layout=e,this.byteOffset=i,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const s of e.fields.keys()){const t=e.fields.get(s);this[s]=new t.constructor(this.buffer,i+t.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(e,t){const i=this[e];return i&&i.elementCount===t.ElementCount&&i.elementType===t.ElementType?i:null}slice(e,t){return new K(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,i=0,s=e.count){const r=this.stride;if(r%4==0){const n=new Uint32Array(e.buffer,t*r,s*r/4);new Uint32Array(this.buffer,i*r,s*r/4).set(n)}else{const n=new Uint8Array(e.buffer,t*r,s*r);new Uint8Array(this.buffer,i*r,s*r).set(n)}return this}get usedMemory(){return this.byteLength}dispose(){}}class N{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:W(e[1].constructor)})))}freeze(){return this}get locations(){return J(H(this))}vec2f16(t,i){return this._appendField(t,e,i),this}vec2f(e,i){return this._appendField(e,t,i),this}vec2f64(e,t){return this._appendField(e,i,t),this}vec3f16(e,t){return this._appendField(e,s,t),this}vec3f(e,t){return this._appendField(e,r,t),this}vec3f64(e,t){return this._appendField(e,n,t),this}vec4f16(e,t){return this._appendField(e,h,t),this}vec4f(e,t){return this._appendField(e,d,t),this}vec4f64(e,t){return this._appendField(e,u,t),this}mat3f(e,t){return this._appendField(e,f,t),this}mat3f64(e,t){return this._appendField(e,o,t),this}mat4f(e,t){return this._appendField(e,l,t),this}mat4f64(e,t){return this._appendField(e,p,t),this}vec4u8(e,t){return this._appendField(e,c,t),this}f16(e,t){return this._appendField(e,a,t),this}f32(e,t){return this._appendField(e,_,t),this}f64(e,t){return this._appendField(e,F,t),this}u8(e,t){return this._appendField(e,y,t),this}u16(e,t){return this._appendField(e,m,t),this}i8(e,t){return this._appendField(e,b,t),this}vec2i8(e,t){return this._appendField(e,g,t),this}vec2i16(e,t){return this._appendField(e,w,t),this}vec2u8(e,t){return this._appendField(e,v,t),this}vec2u16(e,t){return this._appendField(e,E,t),this}vec4u16(e,t){return this._appendField(e,A,t),this}vec4i16(e,t){return this._appendField(e,M,t),this}u32(e,t){return this._appendField(e,T,t),this}_appendField(e,t,i){this._fields.has(e)&&I(!1,`${e} already added to vertex buffer layout`);const s=t.ElementCount*G(t.ElementType),r=this._stride;this._fields.set(e,{constructor:t,size:s,offset:r,optional:i}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(i=>{const s=G(i.constructor.ElementType);e=Math.floor((e+s-1)/s)*s,i.offset=e,e+=i.size,t=Math.max(t,s)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new K(this,e)}createView(e,t){return new K(this,e,t)}clone(){const e=new N;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,i)=>e._fields.set(i,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function P(){return new N}class Q{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const i={...e,constructor:S(e.constructor)};this.fields.push([t,i])}),this.stride=e.stride}}const R=[_,t,r,d,f,l,F,i,n,u,o,p,y,v,U,c,m,E,j,A,T,B,L,x,b,g,C,z,V,w,$,M,O,k,q,D];function S(e){return`${e.ElementType}_${e.ElementCount}`}function W(e){return X.get(e)}const X=new Map;R.forEach(e=>X.set(S(e),e));export{K as InterleavedBuffer,N as InterleavedLayout,Q as PackedLayout,P as newLayout};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{maxUint8 as n}from"../../../../../core/typedArrayUtil.js";import{
|
|
2
|
+
import{__decorate as t}from"tslib";import{maxUint8 as n}from"../../../../../core/typedArrayUtil.js";import{FloatBindUniform as e}from"../shaderModules/FloatBindUniform.js";import{glsl as o,If as u}from"../shaderModules/glsl.js";import{ShaderTechniqueConfiguration as i,parameter as a}from"../shaderTechnique/ShaderTechniqueConfiguration.js";function r(t){switch(t.elementType){case"float":switch(t.elementCount){case 1:return o`float`;case 2:return o`vec2`;case 3:return o`vec3`;case 4:return o`vec4`;case 9:return o`mat3`;default:t.elementCount}break;case"int":switch(t.elementCount){case 1:return o`int`;case 2:return o`ivec2`;case 3:return o`ivec3`;case 4:return o`ivec4`;case 9:throw new Error("Invalid element count 9 for type int");default:t.elementCount}break;case"uint":switch(t.elementCount){case 1:return o`uint`;case 2:return o`uvec2`;case 3:return o`uvec3`;case 4:return o`uvec4`;case 9:throw new Error("Invalid element count 9 for type uint");default:t.elementCount}break;default:t.elementType}throw new Error("unsupported field")}const s=new e("constNaN",()=>NaN,{supportsNaN:!0});class c extends i{constructor(t){super(),this.supportNaN=t}}function p(t,n){const e=n?.supportNaN;e&&(t.uniforms.add(s),t.code.add(o`bool bitsEncodeFloat16NaN(highp uint bits) {
|
|
3
3
|
const highp uint nanExponent = 0x00007c00u;
|
|
4
4
|
highp uint exponent = bits & nanExponent;
|
|
5
5
|
highp uint mantissa = bits & 0x000003ffu;
|
|
6
6
|
return exponent == nanExponent && mantissa != 0u;
|
|
7
|
-
}`)),t.code.add(
|
|
7
|
+
}`)),t.code.add(o`
|
|
8
8
|
mediump float unpackHalf1x16(highp uint bits) {
|
|
9
|
-
${
|
|
9
|
+
${u(e,o`
|
|
10
10
|
if (bitsEncodeFloat16NaN(bits)) {
|
|
11
11
|
return constNaN;
|
|
12
12
|
}`)}
|
|
13
13
|
return unpackHalf2x16(bits).x;
|
|
14
|
-
}`),t.code.add(
|
|
14
|
+
}`),t.code.add(o`
|
|
15
15
|
mediump vec2 unpackHalf2x16NaNSupport(highp uint bits) {
|
|
16
16
|
vec2 result = unpackHalf2x16(bits);
|
|
17
|
-
${
|
|
17
|
+
${u(e,o`
|
|
18
18
|
if (bitsEncodeFloat16NaN(bits)) {
|
|
19
19
|
result.x = constNaN;
|
|
20
20
|
}
|
|
21
|
-
if (bitsEncodeFloat16NaN(bits >> ${
|
|
21
|
+
if (bitsEncodeFloat16NaN(bits >> ${o.uint(g[2])})) {
|
|
22
22
|
result.y = constNaN;
|
|
23
23
|
}
|
|
24
24
|
`)}
|
|
25
25
|
return result;
|
|
26
|
-
}`)}function
|
|
26
|
+
}`)}function f(t,n){const e=n?.supportNaN;e&&(t.uniforms.add(s),t.code.add(o`bool bitsEncodeFloat32NaN(highp uint bits) {
|
|
27
27
|
const highp uint nanExponent = 0x7f800000u;
|
|
28
28
|
highp uint exponent = bits & nanExponent;
|
|
29
29
|
highp uint mantissa = bits & 0x007fffffu;
|
|
30
30
|
return exponent == nanExponent && mantissa != 0u;
|
|
31
|
-
}`)),t.code.add(
|
|
31
|
+
}`)),t.code.add(o`
|
|
32
32
|
highp float unpackFloat1x32(highp uint bits) {
|
|
33
|
-
${
|
|
33
|
+
${u(e,o`
|
|
34
34
|
if (bitsEncodeFloat32NaN(bits)) {
|
|
35
35
|
return constNaN;
|
|
36
36
|
}`)}
|
|
37
37
|
return uintBitsToFloat(bits);
|
|
38
|
-
}`)}function
|
|
38
|
+
}`)}function l(t){t.code.add(o`mediump int unpackInt1x16(highp uint bits) {
|
|
39
39
|
highp uint signExtendedBits = (bits & 0x8000u) != 0u ? (bits | 0xffff0000u) : bits;
|
|
40
40
|
return int(signExtendedBits);
|
|
41
|
-
}`)}function
|
|
41
|
+
}`)}function d(t,n){const{fieldType:e}=t;return`${(0,N[e])(b(t,n))}`}function h(t,n){const e=[];for(const u of t){const t=o`unpackFloat1x32(${u})`;e.push(t)}return e.join(n)}t([a()],c.prototype,"supportNaN",void 0);const m=t=>o`${t[0]}`,$=t=>{const n=t[0],e=o`uvec4(${o.uint(g[0])}, ${o.uint(g[1])}, ${o.uint(g[2])}, ${o.uint(g[3])})`,u=o`uvec4(${o.hexuint(y[1])})`;return o`((uvec4(${n}) >> ${e}) & ${u})`},x=t=>o`(float(${m(t)})/${o.float(n)})`,N={u8:m,u32:t=>o`${t[0]}`,vec4u32:t=>o`uvec4(${t.join(", ")})`,unorm8:x,vec4unorm8:t=>o`(vec4(${$(t)})/${o.float(n)})`,snorm16:t=>o`unpackSnorm2x16(${t[0]}).x`,vec2snorm16:t=>o`unpackSnorm2x16(${t[0]})`,f16:t=>o`unpackHalf1x16(${t[0]})`,vec4f16:t=>o`vec4(unpackHalf2x16NaNSupport(${t[0]}), unpackHalf2x16NaNSupport(${t[1]}))`,f32:t=>o`unpackFloat1x32(${t[0]})`,vec4u8:$,vec2f32:t=>o`vec2(${h(t,", ")})`,vec3f32:t=>o`vec3(${h(t,", ")})`,vec4f32:t=>o`vec4(${h(t,", ")})`,mat3f32:t=>o`mat3(${h(t,",\n")})`};function b(t,n){const{byteOffset:e,byteSize:u}=t,i=n.channelByteStride,a=n.byteStride,r=Math.ceil(u/v),s=E[n.channels],c=new Array;for(let p=0;p<r;++p){const t=p*v,n=e+t,r=u-t,f=Math.min(r,v);let l=0;const d=new Array;for(;l<f;){const t=n+l,e=Math.floor(t/a),u=t%a,r=Math.floor(u/i),c=u%i,p=i-c,h=f-l,m=Math.min(p,h),$=o`texel${o.int(e)}${s[r]}`,x=4===m?"":o` & ${o.hexuint(y[m])}`,N=0===c?"":o` >> ${o.uint(g[c])}`,b=o`((${$}${N})${x})`,v=0===l?"":o` << ${o.uint(g[l])}`,E=o`(${b})${v}`;d.push(E),l+=m}c.push(o`(${d.join(" | ")})`)}return c}const v=4,g=[0,8,16,24],y=[0,255,65535,16777215,4294967295],E={1:[o``],2:[o`.x`,o`.y`],4:[o`.x`,o`.y`,o`.z`,o`.w`]};export{c as TextureBufferNaNSupportConfiguration,d as glslDecodeField,r as glslType,f as unpackFloat1x32,p as unpackHalf,l as unpackInt1x16};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{nativeArrayMaxSize as r,isFloat32Array as t,isFloat16Array as
|
|
2
|
+
import{nativeArrayMaxSize as r,isFloat32Array as t,isFloat16Array as a,isUint16Array as o}from"../../../../core/typedArrayUtil.js";function f(f){if(f.length<r)return Array.from(f);if(Array.isArray(f))return Float64Array.from(f);if(!("BYTES_PER_ELEMENT"in f))return Array.from(f);switch(f.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(f);case 2:return a(f)?Float16Array.from(f):o(f)?Uint16Array.from(f):Int16Array.from(f);case 4:return t(f)?Float32Array.from(f):Uint32Array.from(f);default:return Float64Array.from(f)}}export{f as cloneAttributeData};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{DataType as e}from"../../../webgl/enums.js";import{fromLayout as o}from"../../../webgl/VertexAttributeLocations.js";import{VertexElementDescriptor as t}from"../../../webgl/VertexElementDescriptor.js";const i=[],
|
|
2
|
+
import{DataType as e}from"../../../webgl/enums.js";import{fromLayout as o}from"../../../webgl/VertexAttributeLocations.js";import{VertexElementDescriptor as t}from"../../../webgl/VertexElementDescriptor.js";const i=[],r=[new t("position",3,e.FLOAT,0,12)],n=[new t("position",2,e.FLOAT,0,8)],s=o(n),m=[new t("position",2,e.FLOAT,0,12),new t("uv0",2,e.HALF_FLOAT,8,12)];export{i as NoVertex,n as Pos2,s as Pos2Locations,m as Pos2TexF16,r as Pos3};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{BufferViewMat3f as e,BufferViewVec4f as t,BufferViewVec3f as n,BufferViewVec2f as o,BufferViewFloat as f,BufferViewVec4f16 as r,BufferViewFloat16 as u,BufferViewVec2Snorm16 as w,BufferViewSnorm16 as l,BufferViewVec4Unorm8 as s,BufferViewUnorm8 as m,BufferViewVec4u8 as c,BufferViewVec4u32 as i,BufferViewUint32 as a,BufferViewUint8 as p}from"../../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as v}from"../../../../../geometry/support/buffer/types.js";class y{constructor(e,t,n){this.elementCount=e,this.elementType=t,this.bufferViewConstructor=n,this.byteSize=b(n)}}function b(e){return v(e.ElementType)*e.ElementCount}const h={u8:new y(1,"uint",p),u32:new y(1,"uint",a),vec4u32:new y(4,"uint",i),vec4u8:new y(4,"uint",c),unorm8:new y(1,"float",m),vec4unorm8:new y(4,"float",s),snorm16:new y(1,"float",l),vec2snorm16:new y(2,"float",w),f16:new y(1,"float",u),vec4f16:new y(4,"float",r),f32:new y(1,"float",f),vec2f32:new y(2,"float",o),vec3f32:new y(3,"float",n),vec4f32:new y(4,"float",t),mat3f32:new y(9,"float",e)};export{y as FieldCreationInfo,h as typeToCreationInfoMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{Pos2TexF16 as r,Pos2 as e}from"./DefaultVertexBufferLayouts.js";import{VertexArrayObject as t}from"./VertexArrayObject.js";import o from"../../../webgl/Texture.js";import{TextureDescriptor as n}from"../../../webgl/TextureDescriptor.js";import{VertexBuffer as f}from"../../../webgl/VertexBuffer.js";function s(o,n=0,s=-1,m=1){const u=1===n,a=u?new Float32Array([s,s,0,m,s,0,s,m,0,m,m,0]):new Float32Array([s,s,m,s,s,m,m,m]);if(u){const r=new Float16Array(a.buffer);r[10]=r[17]=r[22]=r[23]=1}return new t(o,new f(o,u?r:e,a))}const m=4;function u(r){const e=new n(m);return e.samplingMode=9728,new o(r,e)}export{u as createEmptyTexture,s as createQuadVAO};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{
|
|
2
|
+
import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColor as a,isDepth as s,isColorHighlightOLIDOrDepth as o}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{LineMaterial as h}from"../lib/LineMaterial.js";import{VisualVariablePassParameters as c}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as l}from"./internal/bufferWriterUtils.js";import{getLayout as m,LineMarkerTechnique as p}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as u}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class f extends h{constructor(e,t){super(e,_),this.produces=new Map([[2,e=>10===e||a(e)&&8===this.parameters.renderOccluded],[3,e=>s(e)],[10,e=>o(e)&&8===this.parameters.renderOccluded],[11,e=>o(e)&&8===this.parameters.renderOccluded],[4,e=>a(e)],[18,e=>a(e)||10===e]]),this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this._configuration=new u(t)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.space=18===e.slot?0:this.parameters.worldSpace?2:1,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=0!==this.parameters.cap,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=e.hasOccludees,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective}get visible(){return this.parameters.color[3]>=d}intersectRay(){}intersectScreenPolygon(){return null}createBufferWriter(){return new v(m(this.parameters),this.parameters)}createGLMaterial(e){return new g(e)}}class g extends n{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(p,e)}}class _ extends c{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=0,this.anchor=0,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class v{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,a,s,o){if(null==o)return;const{buffer:n,offset:h}=o,c=s.get("position").data,m=c.length/3;let p=[1,0,0];const u=s.get("normal");this._parameters.worldSpace&&null!=u&&(p=u.data);let d=1,f=0;this._parameters.vvSize?f=s.get("sizeFeatureAttribute").data[0]:s.has("size")&&(d=s.get("size").data[0]);let g=[1,1,1,1],_=0;this._parameters.vvColor?_=s.get("colorFeatureAttribute").data[0]:s.has("color")&&(g=s.get("color").data);let v=0;this._parameters.vvOpacity&&(v=s.get("opacityFeatureAttribute").data[0]);const P=new Float32Array(n.buffer),w=new Float16Array(n.buffer),y=new Uint8Array(n.buffer);let O=h*(this.layout.stride/4);const T=P.BYTES_PER_ELEMENT/w.BYTES_PER_ELEMENT,V=4/T,k=(e,t,r,i)=>{P[O++]=e[0],P[O++]=e[1],P[O++]=e[2],l(t,e,w,O*T),O+=V;let a=O*T;if(w[a++]=r[0],w[a++]=r[1],O=Math.ceil(a/T),this._parameters.vvColor)P[O++]=_;else{const e=Math.min(4*i,g.length-4),t=4*O++;y[t]=255*g[e],y[t+1]=255*g[e+1],y[t+2]=255*g[e+2],y[t+3]=255*g[e+3]}this._parameters.vvOpacity&&(P[O++]=v),a=O*T,this._parameters.vvSize?(P[O++]=f,a+=2):w[a++]=d,this._parameters.worldSpace&&(w[a++]=p[0],w[a++]=p[1],w[a++]=p[2]),O=Math.ceil(a/T)},M=(a,s)=>{const o=e(S,c[3*a],c[3*a+1],c[3*a+2]),n=b;let h=a+s;do{e(n,c[3*h],c[3*h+1],c[3*h+2]),h+=s}while(t(o,n)&&h>=0&&h<m);i&&(r(o,o,i),r(n,n,i)),k(o,n,[-1,-1],a),k(o,n,[1,-1],a),k(o,n,[1,1],a),k(o,n,[-1,-1],a),k(o,n,[1,1],a),k(o,n,[-1,1],a)},j=this._parameters.placement;"begin"!==j&&"begin-end"!==j||M(0,1),"end"!==j&&"begin-end"!==j||M(m-1,-1)}}const S=i(),b=i();export{f as LineMarkerMaterial,_ as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as o,set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as _,transformMat4 as b,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as v}from"../../../../geometry/support/float16.js";import{fromPoints as w,distance2 as E,closestLineSegmentPoint as x,projectPoint as T,projectPointFraction as j,create as L}from"../../../../geometry/support/lineSegment.js";import{fromPoints as z,signedDistance as C,getNormal as A,create as M}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as V,BufferViewFloat as R,BufferViewVec4Unorm8 as F,BufferViewVec4f16 as O,BufferViewUint32 as B}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as U,isColor as I,isDepth as N,isColorHighlightOLIDOrDepth as k,is2DGeometryOutput as W}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as D}from"../effects/geometry/olidUtils.js";import Y from"../lib/GLMaterial.js";import{LineMaterial as J}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as q,screenPolygonIntersectsBufferedSegment as X}from"../lib/screenPolygonOverlapUtils.js";import{Hit as G,DrapedHit as H}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as K}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as Q,assert as Z}from"../lib/Util.js";import{isImagePattern as $}from"./lineStippleUtils.js";import{VisualVariablePassParameters as ee}from"./VisualVariablePassParameters.js";import{writeColor as te}from"./internal/bufferWriterUtils.js";import{n as ie}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as re,getTextureBufferLayout as se}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as ne}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as oe}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class le extends J{constructor(e,t){super(e,pe),this.produces=new Map([[2,e=>U(e)||I(e)&&8===this.parameters.renderOccluded],[3,e=>N(e)],[10,e=>k(e)&&8===this.parameters.renderOccluded],[11,e=>k(e)&&8===this.parameters.renderOccluded],[4,e=>I(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>I(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>W(e)]]),this._configuration=new oe(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=_e(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&ge(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSizedImagePattern=r}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},i,r,s,n,o){if(!i.options.selectionMode)return;const a=this._getLineSize(e,!0),l=r[0],c=r[1],p=fe(a,o);let u=Number.MAX_VALUE,m=0;for(const h of de(ye,ve,this.parameters,e)){const e=l-ye[0],i=c-ye[1],r=ve[0]-ye[0],s=ve[1]-ye[1],n=t((r*e+s*i)/(r*r+s*s),0,1),o=r*n-e,a=s*n-i,p=o*o+a*a;p<u&&(u=p,m=h)}u<p*p&&s(n.distance,n.renderDistance,n.normal,m)}intersectRay(t,i,r,s,n,a){const{options:l,camera:_,rayBegin:b,rayEnd:S}=r;if(!l.selectionMode||!t.visible||!_)return;if(!Q(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,v=this._getLineSize(P),T=Le;o(T,r.point);const j=v*_.pixelRatio,L=Je*_.pixelRatio,M=j/2+L;c(Ie[0],T[0]-M,T[1]+M,0),c(Ie[1],T[0]+M,T[1]+M,0),c(Ie[2],T[0]+M,T[1]-M,0),c(Ie[3],T[0]-M,T[1]-M,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(Ie[e],Ne[e]))return;z(_.eye,Ne[0],Ne[1],ke),z(_.eye,Ne[1],Ne[2],We),z(_.eye,Ne[2],Ne[3],De),z(_.eye,Ne[3],Ne[0],Ye);let V=Number.MAX_VALUE,R=0;for(const e of this._forEachTransformedLineSegment(Se,Pe,y,i,he(this.parameters,P))){if(C(ke,Se)<0&&C(ke,Pe)<0||C(We,Se)<0&&C(We,Pe)<0||C(De,Se)<0&&C(De,Pe)<0||C(Ye,Se)<0&&C(Ye,Pe)<0)continue;const t=_.projectToRenderScreen(Se,ze),i=_.projectToRenderScreen(Pe,Ce);if(null==t||null==i)continue;if(t[2]<0&&i[2]>0){p(Te,Se,Pe);const e=_.frustum,i=-C(e[4],Se)/u(Te,A(e[4]));if(m(Te,Te,i),h(Se,Se,Te),!_.projectToRenderScreen(Se,t))continue}else if(t[2]>0&&i[2]<0){p(Te,Pe,Se);const e=_.frustum,t=-C(e[4],Pe)/u(Te,A(e[4]));if(m(Te,Te,t),h(Pe,Pe,Te),!_.projectToRenderScreen(Pe,i))continue}else if(t[2]<0&&i[2]<0)continue;t[2]=0,i[2]=0;const r=w(t,i,Fe),s=E(r,T);if(!(s>=V)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(r,Se,Pe,T,_,v,L);if(s>=e*e)continue}V=s,f(Ve,Se),f(Re,Pe),R=e}}if(V<M*M){let e=Number.MAX_VALUE;if(x(w(Ve,Re,Fe),w(b,S,Oe),je)){p(je,je,b);const t=d(je);m(je,je,1/t),e=t/g(b,S)}a(e,e,je,R)}}intersectScreenPolygon(t,i,r,s){const{options:n,camera:o,screenPolygonPrimitiveProcessor:a}=r;if(!n.selectionMode||!t.visible)return null;if(!Q(i))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),u=Je,m=u*o.pixelRatio,h=new G(4);for(const e of this._forEachTransformedLineSegment(Se,Pe,c,i,he(this.parameters,l)))for(const[t,i]of a.processLineSegment(qe,Se,Pe)){if(!q(o,t,i,ze,Ce))continue;const r=w(ze,Ce,Fe);let n=p/2+u;this.parameters.screenSizePerspective&&(_(Le,ze,Ce,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(r,t,i,Le,o,p,m)/o.pixelRatio)),o.renderToScreen(ze,Ae),o.renderToScreen(Ce,Me),X(s,Ae,Me,n)&&(T(w(t,i,Oe),o.eye,we),h.updateIfCloserFromValues(g(o.eye,we),e,we,null))}return h}intersectScreenPolygonDraped({attributes:e},t,i,r,s){if(!i.options.selectionMode)return null;const n=fe(this._getLineSize(e,!0),s);for(const o of de(ye,ve,this.parameters,e,t))if(X(r,ye,ve,n))return new H(o);return null}createBufferWriter(){return new ue(re(this.parameters),se(this.parameters),this.parameters)}createGLMaterial(e){return new ce(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,s,n,o){const a=j(e,r);_(we,t,i,a),b(Ee,we,s.viewMatrix);const l=d(Ee),c=this.computeCameraAbsCosAngle(we,s,this._configuration.spherical);be.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return be.apply(n)*s.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,i){return i?S(je,e):c(je,0,0,1),p(xe,e,t.eye),S(xe,xe),Math.abs(u(je,xe))}_getLineSize(e,i=!1){let r=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?i&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(r*=e.get("size").data[0]);return r}*_forEachTransformedLineSegment(e,t,i,r,s){const n=s?i.length-2:i.length-5;for(let o=0;o<n;o+=3){e[0]=i[o]+r[12],e[1]=i[o+1]+r[13],e[2]=i[o+2]+r[14];const s=(o+3)%i.length;t[0]=i[s]+r[12],t[1]=i[s+1]+r[13],t[2]=i[s+2]+r[14],yield o/3}}}class ce extends Y{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(ne,e)}}class pe extends ee{constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return $(this.stipplePattern)&&null!=this.stippleTexture}}class ue{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=_e(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return he(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,i=e.get("position").indices.length/2+1,r=this._isClosed(e);let s=r?2:2*t;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,r,s,n){null!=n&&this._writeTextureBuffer(e,i,n),null!=r&&this._writeVertexBuffer(e,i,r,s)}_writeTextureBuffer(e,t,i){const r=t.get("position"),s=r.data.length/3,n=this._isClosed(t),{buffer:o,offset:a}=i,l=o.getField("position",V),c=o.getField("u0",R),p=o.getField("sizeFeatureAttribute",R),u=o.getField("size",R),m=o.getField("colorFeatureAttribute",R),h=o.getField("color",F),d=o.getField("olidColor",F),_=o.getField("timeStamps",O),b=o.getField("opacityFeatureAttribute",R),S=t.get("sizeFeatureAttribute")?.data,P=t.get("size")?.data,y=t.get("colorFeatureAttribute")?.data,v=t.get("color")?.data,w=t.get("opacityFeatureAttribute")?.data,E=t.get("distanceToStart")?.data,x=t.get("timeStamps");Z(null!==l,"Expected valid position field in texture buffer"),Z(null!==c,"Expected valid u0 field in texture buffer");let T=0;for(let L=0;L<s;++L){this._getTransformedPosition(Ue,r.data,L,e),L>0&&(null!=E?T=E[L]??T:T+=g(Be,Ue));const t=a+L+1;if(l.setVec(t,Ue),c.set(t,T),f(Be,Ue),p&&p.set(t,1===S?.length?S[0]:S?.[L]??0),u&&u.set(t,1===P?.length?P[0]:P?.[L]??1),m&&m.set(t,1===y?.length?y[0]:y?.[L]??0),h)if(null!=v){const e=Math.min(4*L,v.length-4);h.setValues(t,v[e],v[e+1],v[e+2],v[e+3])}else h.setValues(t,1,1,1,1);b&&b.set(t,1===w?.length?w[0]:w?.[L]??0)}if(null!=_&&null!=x){Z(4===x.size);const e=x.data;for(let t=0;t<s;++t){const i=4*t,r=a+t+1;_.set(r,0,e[i]),_.set(r,1,e[i+1]),_.set(r,2,e[i+2]),_.set(r,3,e[i+3])}}if(n){const e=a,t=a+1,i=a+2,r=a+s,n=r+1,p=r+2;o.copyItem(r,e),o.copyItem(t,n),o.copyItem(i,p),l.getVec(r,Be),l.getVec(t,Ue);const u=T+g(Be,Ue);c.set(n,u)}else{const e=a,t=a+1,i=a+s,r=i+1;o.copyItem(t,e),o.copyItem(i,r)}const j=t.get("olidColor");D()&&null!=j&&null!=d&&te(j,4,d,a)}_writeVertexBuffer(e,t,i,r){const{buffer:s,offset:n}=i,{layout:o}=this,a=t.get("position"),l=a.indices,c=a.data.length/3,p=this._isClosed(t),u=c+(p?3:2);l&&l.length!==2*(c-1)&&console.warn("RibbonLineMaterial does not support indices");const m=s.getField("textureElementIndex",B);Z(null!=m,"Missing texture buffer index field"),Z(null!=r,"Using a texture layout, but the texture range for this instance was not provided");const h=r.from;Z(r.numElements===u,"Expected number of elements in TextureBuffer to equal number of points");const f=new Float32Array(s.buffer),d=v(s.buffer),g=new Uint32Array(s.buffer),_=o.stride/4;let b=n*_;const S=b,P=f.BYTES_PER_ELEMENT/d.BYTES_PER_ELEMENT,y=(e,t,i)=>{const r=i+1;g[b]=h+r,b++;let s=b*P;d[s++]=e,d[s++]=t,b=Math.ceil(s/P)};b+=_;let w=0,E=0;p?(w=0,E=c):(y(1,-4,0),y(1,4,0),w=1,E=c-1);for(let v=w;v<E;v++){y(0,-1,v),y(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const i=(t+1)/(e+1);y(i,-1,v),y(i,1,v)}y(1,-2,v),y(1,2,v)}p?(y(0,-1,E),y(0,1,E)):(y(0,-5,E),y(0,5,E)),me(f,S+_,f,S,_);b=me(f,b-_,f,b,_),this._parameters.wireframe&&this._addWireframeVertices(s,S,b,_)}_getTransformedPosition(e,t,i,r){const s=3*i;c(e,t[s+0],t[s+1],t[s+2]),r&&b(e,e,r)}_addWireframeVertices(e,t,i,r){const s=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),o=r*Float32Array.BYTES_PER_ELEMENT;let a=0;const l=e=>a=me(n,e,s,a,o);for(let c=0;c<=n.length-4*o;c+=2*o)l(c),l(c+2*o),l(c+1*o),l(c+2*o),l(c+1*o),l(c+3*o)}}function me(e,t,i,r,s){for(let n=0;n<s;n++)i[r++]=e[t++];return r}function he(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function fe(e,t){return(e/2+Je)*t}function*de(e,t,i,r,s){const n=r.get("position").data,l=he(i,r)?n.length-2:n.length-5,c=s?.[0]??0,p=s?.[1]??0;a(e,n[0]+c,n[1]+p);for(let u=3;u<l+3;u+=3){const i=u%n.length;a(t,n[i]+c,n[i+1]+p),yield u/3,o(e,t)}}function ge(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function _e(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return ie+i}}const be=new K,Se=P(),Pe=P(),ye=l(),ve=l(),we=P(),Ee=P(),xe=P(),Te=P(),je=P(),Le=P(),ze=i(),Ce=i(),Ae=r(),Me=r(),Ve=P(),Re=P(),Fe=L(),Oe=L(),Be=P(),Ue=P(),Ie=[i(),i(),i(),i()],Ne=[P(),P(),P(),P()],ke=M(),We=M(),De=M(),Ye=M(),Je=4,qe=[P(),P()];export{pe as Parameters,le as RibbonLineMaterial};
|
|
2
|
+
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as a,set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as _,transformMat4 as b,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as v,distance2 as w,closestLineSegmentPoint as E,projectPoint as x,projectPointFraction as T,create as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as L,signedDistance as z,getNormal as C,create as A}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as M,BufferViewFloat as V,BufferViewVec4Unorm8 as F,BufferViewVec4f16 as R,BufferViewUint32 as O}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as B,isColor as U,isDepth as I,isColorHighlightOLIDOrDepth as N,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as W}from"../effects/geometry/olidUtils.js";import D from"../lib/GLMaterial.js";import{LineMaterial as Y}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as J,screenPolygonIntersectsBufferedSegment as q}from"../lib/screenPolygonOverlapUtils.js";import{Hit as X,DrapedHit as G}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as H}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as K,assert as Q}from"../lib/Util.js";import{isImagePattern as Z}from"./lineStippleUtils.js";import{VisualVariablePassParameters as $}from"./VisualVariablePassParameters.js";import{writeColor as ee}from"./internal/bufferWriterUtils.js";import{n as te}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as re}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as se}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class oe extends Y{constructor(e,t){super(e,ce),this.produces=new Map([[2,e=>B(e)||U(e)&&8===this.parameters.renderOccluded],[3,e=>I(e)],[10,e=>N(e)&&8===this.parameters.renderOccluded],[11,e=>N(e)&&8===this.parameters.renderOccluded],[4,e=>U(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>U(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new ne(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=ge(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&de(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSizedImagePattern=r}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},i,r,s,n,a){if(!i.options.selectionMode)return;const o=this._getLineSize(e,!0),l=r[0],c=r[1],p=he(o,a);let u=Number.MAX_VALUE,m=0;for(const h of fe(Pe,ye,this.parameters,e)){const e=l-Pe[0],i=c-Pe[1],r=ye[0]-Pe[0],s=ye[1]-Pe[1],n=t((r*e+s*i)/(r*r+s*s),0,1),a=r*n-e,o=s*n-i,p=a*a+o*o;p<u&&(u=p,m=h)}u<p*p&&s(n.distance,n.renderDistance,n.normal,m)}intersectRay(t,i,r,s,n,o){const{options:l,camera:_,rayBegin:b,rayEnd:S}=r;if(!l.selectionMode||!t.visible||!_)return;if(!K(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,x=this._getLineSize(P),T=je;a(T,r.point);const j=x*_.pixelRatio,A=Ye*_.pixelRatio,M=j/2+A;c(Ue[0],T[0]-M,T[1]+M,0),c(Ue[1],T[0]+M,T[1]+M,0),c(Ue[2],T[0]+M,T[1]-M,0),c(Ue[3],T[0]-M,T[1]-M,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(Ue[e],Ie[e]))return;L(_.eye,Ie[0],Ie[1],Ne),L(_.eye,Ie[1],Ie[2],ke),L(_.eye,Ie[2],Ie[3],We),L(_.eye,Ie[3],Ie[0],De);let V=Number.MAX_VALUE,F=0;for(const e of this._forEachTransformedLineSegment(be,Se,y,i,me(this.parameters,P))){if(z(Ne,be)<0&&z(Ne,Se)<0||z(ke,be)<0&&z(ke,Se)<0||z(We,be)<0&&z(We,Se)<0||z(De,be)<0&&z(De,Se)<0)continue;const t=_.projectToRenderScreen(be,Le),i=_.projectToRenderScreen(Se,ze);if(null==t||null==i)continue;if(t[2]<0&&i[2]>0){p(xe,be,Se);const e=_.frustum,i=-z(e[4],be)/u(xe,C(e[4]));if(m(xe,xe,i),h(be,be,xe),!_.projectToRenderScreen(be,t))continue}else if(t[2]>0&&i[2]<0){p(xe,Se,be);const e=_.frustum,t=-z(e[4],Se)/u(xe,C(e[4]));if(m(xe,xe,t),h(Se,Se,xe),!_.projectToRenderScreen(Se,i))continue}else if(t[2]<0&&i[2]<0)continue;t[2]=0,i[2]=0;const r=v(t,i,Fe),s=w(r,T);if(!(s>=V)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(r,be,Se,T,_,x,A);if(s>=e*e)continue}V=s,f(Me,be),f(Ve,Se),F=e}}if(V<M*M){let e=Number.MAX_VALUE;if(E(v(Me,Ve,Fe),v(b,S,Re),Te)){p(Te,Te,b);const t=d(Te);m(Te,Te,1/t),e=t/g(b,S)}o(e,e,Te,F)}}intersectScreenPolygon(t,i,r,s){const{options:n,camera:a,screenPolygonPrimitiveProcessor:o}=r;if(!n.selectionMode||!t.visible)return null;if(!K(i))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),u=Ye,m=u*a.pixelRatio,h=new X(4);for(const e of this._forEachTransformedLineSegment(be,Se,c,i,me(this.parameters,l)))for(const[t,i]of o.processLineSegment(Je,be,Se)){if(!J(a,t,i,Le,ze))continue;const r=v(Le,ze,Fe);let n=p/2+u;this.parameters.screenSizePerspective&&(_(je,Le,ze,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(r,t,i,je,a,p,m)/a.pixelRatio)),a.renderToScreen(Le,Ce),a.renderToScreen(ze,Ae),q(s,Ce,Ae,n)&&(x(v(t,i,Re),a.eye,ve),h.updateIfCloserFromValues(g(a.eye,ve),e,ve,null))}return h}intersectScreenPolygonDraped({attributes:e},t,i,r,s){if(!i.options.selectionMode)return null;const n=he(this._getLineSize(e,!0),s);for(const a of fe(Pe,ye,this.parameters,e,t))if(q(r,Pe,ye,n))return new G(a);return null}createBufferWriter(){return new pe(ie(this.parameters),re(this.parameters),this.parameters)}createGLMaterial(e){return new le(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,s,n,a){const o=T(e,r);_(ve,t,i,o),b(we,ve,s.viewMatrix);const l=d(we),c=this.computeCameraAbsCosAngle(ve,s,this._configuration.spherical);_e.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return _e.apply(n)*s.pixelRatio/2+a}computeCameraAbsCosAngle(e,t,i){return i?S(Te,e):c(Te,0,0,1),p(Ee,e,t.eye),S(Ee,Ee),Math.abs(u(Te,Ee))}_getLineSize(e,i=!1){let r=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?i&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(r*=e.get("size").data[0]);return r}*_forEachTransformedLineSegment(e,t,i,r,s){const n=s?i.length-2:i.length-5;for(let a=0;a<n;a+=3){e[0]=i[a]+r[12],e[1]=i[a+1]+r[13],e[2]=i[a+2]+r[14];const s=(a+3)%i.length;t[0]=i[s]+r[12],t[1]=i[s+1]+r[13],t[2]=i[s+2]+r[14],yield a/3}}}class le extends D{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(se,e)}}class ce extends ${constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return Z(this.stipplePattern)&&null!=this.stippleTexture}}class pe{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=ge(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return me(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,i=e.get("position").indices.length/2+1,r=this._isClosed(e);let s=r?2:2*t;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,r,s,n){null!=n&&this._writeTextureBuffer(e,i,n),null!=r&&this._writeVertexBuffer(e,i,r,s)}_writeTextureBuffer(e,t,i){const r=t.get("position"),s=r.data.length/3,n=this._isClosed(t),{buffer:a,offset:o}=i,l=a.getField("position",M),c=a.getField("u0",V),p=a.getField("sizeFeatureAttribute",V),u=a.getField("size",V),m=a.getField("colorFeatureAttribute",V),h=a.getField("color",F),d=a.getField("olidColor",F),_=a.getField("timeStamps",R),b=a.getField("opacityFeatureAttribute",V),S=t.get("sizeFeatureAttribute")?.data,P=t.get("size")?.data,y=t.get("colorFeatureAttribute")?.data,v=t.get("color")?.data,w=t.get("opacityFeatureAttribute")?.data,E=t.get("distanceToStart")?.data,x=t.get("timeStamps");Q(null!==l,"Expected valid position field in texture buffer"),Q(null!==c,"Expected valid u0 field in texture buffer");let T=0;for(let L=0;L<s;++L){this._getTransformedPosition(Be,r.data,L,e),L>0&&(null!=E?T=E[L]??T:T+=g(Oe,Be));const t=o+L+1;if(l.setVec(t,Be),c.set(t,T),f(Oe,Be),p&&p.set(t,1===S?.length?S[0]:S?.[L]??0),u&&u.set(t,1===P?.length?P[0]:P?.[L]??1),m&&m.set(t,1===y?.length?y[0]:y?.[L]??0),h)if(null!=v){const e=Math.min(4*L,v.length-4);h.setValues(t,v[e],v[e+1],v[e+2],v[e+3])}else h.setValues(t,1,1,1,1);b&&b.set(t,1===w?.length?w[0]:w?.[L]??0)}if(null!=_&&null!=x){Q(4===x.size);const e=x.data;for(let t=0;t<s;++t){const i=4*t,r=o+t+1;_.set(r,0,e[i]),_.set(r,1,e[i+1]),_.set(r,2,e[i+2]),_.set(r,3,e[i+3])}}if(n){const e=o,t=o+1,i=o+2,r=o+s,n=r+1,p=r+2;a.copyItem(r,e),a.copyItem(t,n),a.copyItem(i,p),l.getVec(r,Oe),l.getVec(t,Be);const u=T+g(Oe,Be);c.set(n,u)}else{const e=o,t=o+1,i=o+s,r=i+1;a.copyItem(t,e),a.copyItem(i,r)}const j=t.get("olidColor");W()&&null!=j&&null!=d&&ee(j,4,d,o)}_writeVertexBuffer(e,t,i,r){const{buffer:s,offset:n}=i,{layout:a}=this,o=t.get("position"),l=o.indices,c=o.data.length/3,p=this._isClosed(t),u=c+(p?3:2);l&&l.length!==2*(c-1)&&console.warn("RibbonLineMaterial does not support indices");const m=s.getField("textureElementIndex",O);Q(null!=m,"Missing texture buffer index field"),Q(null!=r,"Using a texture layout, but the texture range for this instance was not provided");const h=r.from;Q(r.numElements===u,"Expected number of elements in TextureBuffer to equal number of points");const f=new Float32Array(s.buffer),d=new Float16Array(s.buffer),g=new Uint32Array(s.buffer),_=a.stride/4;let b=n*_;const S=b,P=f.BYTES_PER_ELEMENT/d.BYTES_PER_ELEMENT,y=(e,t,i)=>{const r=i+1;g[b]=h+r,b++;let s=b*P;d[s++]=e,d[s++]=t,b=Math.ceil(s/P)};b+=_;let v=0,w=0;p?(v=0,w=c):(y(1,-4,0),y(1,4,0),v=1,w=c-1);for(let E=v;E<w;E++){y(0,-1,E),y(0,1,E);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const i=(t+1)/(e+1);y(i,-1,E),y(i,1,E)}y(1,-2,E),y(1,2,E)}p?(y(0,-1,w),y(0,1,w)):(y(0,-5,w),y(0,5,w)),ue(f,S+_,f,S,_);b=ue(f,b-_,f,b,_),this._parameters.wireframe&&this._addWireframeVertices(s,S,b,_)}_getTransformedPosition(e,t,i,r){const s=3*i;c(e,t[s+0],t[s+1],t[s+2]),r&&b(e,e,r)}_addWireframeVertices(e,t,i,r){const s=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),a=r*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=ue(n,e,s,o,a);for(let c=0;c<=n.length-4*a;c+=2*a)l(c),l(c+2*a),l(c+1*a),l(c+2*a),l(c+1*a),l(c+3*a)}}function ue(e,t,i,r,s){for(let n=0;n<s;n++)i[r++]=e[t++];return r}function me(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function he(e,t){return(e/2+Ye)*t}function*fe(e,t,i,r,s){const n=r.get("position").data,l=me(i,r)?n.length-2:n.length-5,c=s?.[0]??0,p=s?.[1]??0;o(e,n[0]+c,n[1]+p);for(let u=3;u<l+3;u+=3){const i=u%n.length;o(t,n[i]+c,n[i+1]+p),yield u/3,a(e,t)}}function de(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function ge(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return te+i}}const _e=new H,be=P(),Se=P(),Pe=l(),ye=l(),ve=P(),we=P(),Ee=P(),xe=P(),Te=P(),je=P(),Le=i(),ze=i(),Ce=r(),Ae=r(),Me=P(),Ve=P(),Fe=j(),Re=j(),Oe=P(),Be=P(),Ue=[i(),i(),i(),i()],Ie=[P(),P(),P(),P()],Ne=A(),ke=A(),We=A(),De=A(),Ye=4,Je=[P(),P()];export{ce as Parameters,oe as RibbonLineMaterial};
|
package/widgets/Directions.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ export interface DirectionsProperties extends WidgetProperties, Partial<Pick<Dir
|
|
|
115
115
|
* |------|------|
|
|
116
116
|
* |  |  |
|
|
117
117
|
*
|
|
118
|
-
* The resulting driving directions are automatically collapsed and can be optionally saved to a new or existing portal item. This can be achieved
|
|
118
|
+
* The resulting driving directions are automatically collapsed and can be optionally saved to a new or existing portal item. This can be achieved programmatically with [save()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Directions/#save) and [saveAs()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Directions/#saveAs).
|
|
119
119
|
* The `Clear` button calls the [DirectionsViewModel.reset()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Directions/DirectionsViewModel/#reset)
|
|
120
120
|
* method, which removes all stops, directions, and the solved route.
|
|
121
121
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{css as e}from"../css.js";import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import{tsx as n}from"../../support/widget.js";function i(){return t({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")})}function o(t){const{uiStrings:i,videoEnhancementToolActive:o,resetTools:
|
|
2
|
+
import{css as e}from"../css.js";import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import{tsx as n}from"../../support/widget.js";function i(){return t({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")})}function o(t){const{uiStrings:i,videoEnhancementToolActive:o,resetTools:a,onClose:s,brightness:l,contrast:r,handleBrightnessChange:m,handleContrastChange:p}=t,{reset:d,videoEnhancement:h}=i;return n("calcite-panel",{class:e.imageEnhancementWrapper,closable:!0,closed:!o,heading:h,key:h,onCalcitePanelClose:s},n("div",{class:e.imageEnhancementTools},c({title:i.brightness,value:l,handleChange:m}),c({title:i.contrast,value:r,handleChange:p})),n("calcite-action",{icon:"reset",slot:"header-actions-end",text:d,onclick:a}))}function c({title:t,tooltip:i,value:o,handleChange:c,max:a=10,min:s=-10,ticks:l=5,step:r=1}){return n("div",{class:e.imageEnhancementToolContainer},n("calcite-label",{title:i},t,n("calcite-slider",{labelTicks:!0,max:a,min:s,step:r,ticks:l,title:i,value:o,onCalciteSliderInput:c})))}export{o as VideoEnhancementTools,i as loadVideoEnhancementComponents,c as renderEnhancementSlider};
|