@arcgis/core 5.2.0-next.20 → 5.2.0-next.21
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/057d288d795b853295f1.js +2 -0
- package/assets/esri/core/workers/chunks/{595bc41ff36c77324d01.js → 19493c9c7e1d2ac0f80f.js} +8 -8
- package/assets/esri/core/workers/chunks/2ef80e003b4f0393ac2e.js +1 -0
- package/assets/esri/core/workers/chunks/{4fdd38d7362bf09a994b.js → 33866e6e6de1bab64599.js} +1 -1
- package/assets/esri/core/workers/chunks/360fd810d70d21c092d9.js +1 -0
- package/assets/esri/core/workers/chunks/{4517630bf869205bab87.js → 38a76bc4ef5c10ab0488.js} +1 -1
- package/assets/esri/core/workers/chunks/5468a65698931603656d.js +1 -0
- package/assets/esri/core/workers/chunks/{c9e5d3f496cefb8e3934.js → 5aa375b0c6a205134703.js} +1 -1
- package/assets/esri/core/workers/chunks/{db26cf2c2735183294b8.js → 6649acaceab00ad30e7f.js} +1 -1
- package/assets/esri/core/workers/chunks/7175f0c6a6e56b685d20.js +680 -0
- package/assets/esri/core/workers/chunks/{501fa9b029df2e7b73c3.js → 754f7ed62afc4e0a1972.js} +2 -2
- package/assets/esri/core/workers/chunks/{6ac09f4e85c664a17365.js → 8331e04ebe0a54b04ab6.js} +1 -1
- package/assets/esri/core/workers/chunks/{72edd08a2ff08970ba38.js → 87011d2fe14c54e296af.js} +1 -1
- package/assets/esri/core/workers/chunks/{5216dd0544e901039c84.js → 8c64c6b8d7376a9d1c91.js} +1 -1
- package/assets/esri/core/workers/chunks/{8ce4fe00328173224ed2.js → 909e67dee8c30e391d69.js} +1 -1
- package/assets/esri/core/workers/chunks/93b40245378ced43ca08.js +1 -0
- package/assets/esri/core/workers/chunks/98dfe31e8ed9b522eaff.js +1 -0
- package/assets/esri/core/workers/chunks/{4104a0585969f8cd524c.js → a40ede4d3375184f21fe.js} +1 -1
- package/assets/esri/core/workers/chunks/a533d066cac26124c5ce.js +1 -0
- package/assets/esri/core/workers/chunks/a536904fe6f3b16fdbdc.js +1 -0
- package/assets/esri/core/workers/chunks/a8167ab9fd846d699be5.js +1 -0
- package/assets/esri/core/workers/chunks/{dd0c1cf921369e2bc48b.js → a90619adff41658f8057.js} +1 -1
- package/assets/esri/core/workers/chunks/{6e8b9c03240ec372b587.js → c30ca771dd3f7198142b.js} +1 -1
- package/assets/esri/core/workers/chunks/{e8d65900eefff1152207.js → c593539c2cce7a2b9d44.js} +1 -1
- package/assets/esri/core/workers/chunks/da47fdffb5969694a2ae.js +1 -0
- package/assets/esri/core/workers/chunks/{764c8ba14ab74b66b391.js → e5fcd8e7a4a660ef6ad6.js} +1 -1
- package/assets/esri/core/workers/chunks/f0519b06987471456b69.js +1 -0
- package/assets/esri/core/workers/chunks/{5f63077ec5ba3560491b.js → f1ff33584680d8718400.js} +1 -1
- package/assets/esri/core/workers/chunks/f47319d36f1527277923.js +1 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Pattern.glsl.js +17 -17
- package/chunks/RibbonLine.glsl.js +45 -43
- package/chunks/bundle2.js +1 -1
- package/config.js +1 -1
- package/geometry/support/geometryUtils.js +1 -1
- package/geometry/support/intersects.js +1 -1
- package/geometry/support/intersectsBase.js +1 -1
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +43 -0
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +39 -0
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/DimensionLayer.d.ts +1 -0
- package/layers/FeatureLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.d.ts +9 -1
- package/layers/ParquetLayer.d.ts +6 -10
- package/layers/graphics/data/attributeSupport.js +1 -1
- package/layers/graphics/data/queryValidationUtils.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/raster/datasets/WCSRaster.js +1 -1
- package/layers/support/AnnotationFeatureSublayer.d.ts +5 -3
- package/layers/support/SymbolLayerDrawing.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/views/2d/engine/transitions/FadeTransition.js +1 -1
- package/views/2d/engine/webgl/FeatureTile.js +1 -1
- package/views/2d/engine/webgl/TileCpuState.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightInteractionVisuals.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
- package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayerConstants.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +11 -11
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +6 -9
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +46 -46
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +46 -18
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +22 -22
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertexInfo.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferUtils.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTextureBuffer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js +2 -0
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +10 -10
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/support/panConstraint.js +2 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Print/CustomTemplate.d.ts +7 -0
- package/widgets/Search/LayerSearchSource.d.ts +3 -0
- package/assets/esri/core/workers/chunks/0a259137932211b80f0e.js +0 -1
- package/assets/esri/core/workers/chunks/35a508a9311689d8df52.js +0 -1
- package/assets/esri/core/workers/chunks/74922daaedb479ec6f03.js +0 -1
- package/assets/esri/core/workers/chunks/912a8743a02f467b63b0.js +0 -2
- package/assets/esri/core/workers/chunks/9def4619d102f1d41578.js +0 -1
- package/assets/esri/core/workers/chunks/a0876a52a3c2ad849370.js +0 -1
- package/assets/esri/core/workers/chunks/a3c5b754a6fa0f4250bf.js +0 -1
- package/assets/esri/core/workers/chunks/a98905bf6050ad3b8721.js +0 -633
- package/assets/esri/core/workers/chunks/bf67e0f6064fb9d94ac8.js +0 -1
- package/assets/esri/core/workers/chunks/cd892f429d5ffe8de99e.js +0 -1
- package/assets/esri/core/workers/chunks/d34d41a350facfa9b7c0.js +0 -1
- package/assets/esri/core/workers/chunks/d5a0e3a73df827dc7b06.js +0 -1
- package/assets/esri/core/workers/chunks/e5471373f89fd7cb9844.js +0 -1
- /package/assets/esri/core/workers/chunks/{912a8743a02f467b63b0.js.LICENSE.txt → 057d288d795b853295f1.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{501fa9b029df2e7b73c3.js.LICENSE.txt → 754f7ed62afc4e0a1972.js.LICENSE.txt} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{freeze as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumRoundCapExtrusionSubdivisions as t}from"../../../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{PathVertexInfo as
|
|
2
|
+
import{freeze as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumRoundCapExtrusionSubdivisions as t}from"../../../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{PathVertexInfo as r}from"./PathVertexInfo.glsl.js";import{PiUtils as o}from"../shading/PiUtils.glsl.js";import{Float2sPassUniform as a}from"../../shaderModules/Float2sPassUniform.js";import{Float4sPassUniform as i}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as l}from"../../shaderModules/FloatPassUniform.js";import{glsl as n,If as s}from"../../shaderModules/glsl.js";import{IntegerPassUniform as f}from"../../shaderModules/IntegerPassUniform.js";import{IntegersPassUniform as p}from"../../shaderModules/IntegersPassUniform.js";import{pathProfileUniformLayout as c}from"../../../lib/PathProfile.js";function d(e,d){const{vertex:m}=e;e.include(r,d);const u=1===d.upVectorAlignment;m.uniforms.add(new l("angleCutoff",e=>e.cutoffAngle)),m.code.add(n`float reciprocalClamped(float value) {
|
|
3
3
|
float signValue = value < 0.0 ? -1.0 : 1.0;
|
|
4
4
|
return signValue / max(abs(value), 1e-6);
|
|
5
|
-
}`),u?m.code.add(
|
|
5
|
+
}`),u?m.code.add(n`vec2 applyMiterStretch(vec2 vertex, float rotationAngle, vec2 rotationRight) {
|
|
6
6
|
if (rotationAngle == 0.0) {
|
|
7
7
|
return vertex;
|
|
8
8
|
}
|
|
@@ -14,13 +14,13 @@ mat2 miterStretch = mat2(
|
|
|
14
14
|
1. + (k - 1.) * rotationRight.y * rotationRight.y
|
|
15
15
|
);
|
|
16
16
|
return miterStretch * vertex;
|
|
17
|
-
}`):m.code.add(
|
|
17
|
+
}`):m.code.add(n`vec2 applyMiterStretch(vec2 vertex, float rotationAngle) {
|
|
18
18
|
if (rotationAngle == 0.0) {
|
|
19
19
|
return vertex;
|
|
20
20
|
}
|
|
21
21
|
float k = reciprocalClamped(cos(0.5 * rotationAngle));
|
|
22
22
|
return vec2(k, 1.) * vertex;
|
|
23
|
-
}`);const{vertexCount:v,indexCount:h,poleCount:g}=d
|
|
23
|
+
}`);const{vertexCount:v,indexCount:h,poleCount:g}=c[d.pathProfileType];switch(m.uniforms.add(new a("pathProfileVertices",v,e=>e.profile.vertices.flat()),new a("pathProfileNormals",v,e=>e.profile.normals.flat())),m.code.add(n`mat3 mat3FromRotation(float angle, vec3 axis) {
|
|
24
24
|
float x = axis.x;
|
|
25
25
|
float y = axis.y;
|
|
26
26
|
float z = axis.z;
|
|
@@ -32,7 +32,7 @@ x * x * t + c, y * x * t + z * s, z * x * t - y * s,
|
|
|
32
32
|
x * y * t - z * s, y * y * t + c, z * y * t + x * s,
|
|
33
33
|
x * z * t + y * s, y * z * t - x * s, z * z * t + c
|
|
34
34
|
);
|
|
35
|
-
}`),m.code.add(
|
|
35
|
+
}`),m.code.add(n`struct ExtrusionFrame {
|
|
36
36
|
vec3 up;
|
|
37
37
|
vec3 right;
|
|
38
38
|
};
|
|
@@ -45,20 +45,20 @@ float maxDistance;
|
|
|
45
45
|
float capPositionOffset;
|
|
46
46
|
float capNormalOffset;
|
|
47
47
|
bool isCap;
|
|
48
|
-
};`),u?m.code.add(
|
|
48
|
+
};`),u?m.code.add(n`vec2 getPathRotationRight(ExtrusionFrame frame) {
|
|
49
49
|
vec3 rotationUp = getFrameRotationUp();
|
|
50
50
|
float a = dot(rotationUp, frame.up);
|
|
51
51
|
float b = dot(rotationUp, frame.right);
|
|
52
52
|
vec3 vertex = normalize(frame.up * -b + frame.right * a);
|
|
53
53
|
return vec2(dot(vertex, frame.right), dot(vertex, frame.up));
|
|
54
|
-
}`):m.code.add(
|
|
54
|
+
}`):m.code.add(n`vec2 getPathRotationRight() {
|
|
55
55
|
return vec2(1., 0.);
|
|
56
|
-
}`),m.
|
|
57
|
-
ExtrudedVertex evaluateJoinVertex(
|
|
58
|
-
vec2 profileVertex = pathProfileVertices[
|
|
59
|
-
vec2 profileNormal = pathProfileNormals[
|
|
56
|
+
}`),m.uniforms.add(new f("numJoinSubdivisions",e=>e.numJoinSubdivisions)),m.code.add(n`
|
|
57
|
+
ExtrudedVertex evaluateJoinVertex(PathVertexDescriptor vertexDescriptor, ExtrusionFrame frame) {
|
|
58
|
+
vec2 profileVertex = pathProfileVertices[vertexDescriptor.sourceIndex];
|
|
59
|
+
vec2 profileNormal = pathProfileNormals[vertexDescriptor.sourceIndex];
|
|
60
60
|
float profileRotation = getProfileRotation();
|
|
61
|
-
vec2 rotationRight = getPathRotationRight(${
|
|
61
|
+
vec2 rotationRight = getPathRotationRight(${s(u,n`frame`)});
|
|
62
62
|
bool isBevel = abs(profileRotation) >= angleCutoff;
|
|
63
63
|
|
|
64
64
|
// determine if the current profile vertex is on the inside or outside of the rotationAxis
|
|
@@ -69,20 +69,20 @@ return vec2(1., 0.);
|
|
|
69
69
|
bool isBevelBend = isBevel && isBend;
|
|
70
70
|
|
|
71
71
|
if (isBevelBend) {
|
|
72
|
-
float k =
|
|
72
|
+
float k = vertexDescriptor.subdivision;
|
|
73
73
|
// rotate half rotation angle backwards to where the rotation starts
|
|
74
74
|
// and then rotate a couple of times depending on the current subdivision segment
|
|
75
75
|
float bendRotation = -profileRotation * 0.5 + (k * profileRotation) / float(numJoinSubdivisions);
|
|
76
76
|
if (bendRotation != 0.) {
|
|
77
77
|
vec3 rotationUp = getFrameRotationUp();
|
|
78
78
|
mat3 transform = mat3FromRotation(bendRotation, rotationUp);
|
|
79
|
-
${
|
|
79
|
+
${s(u,n`frame.up = normalize(transform * frame.up);`)}
|
|
80
80
|
frame.right = normalize(transform * frame.right);
|
|
81
81
|
}
|
|
82
82
|
} else {
|
|
83
83
|
profileVertex = applyMiterStretch(
|
|
84
84
|
profileVertex,
|
|
85
|
-
profileRotation${
|
|
85
|
+
profileRotation${s(u,n`,
|
|
86
86
|
rotationRight`)}
|
|
87
87
|
);
|
|
88
88
|
}
|
|
@@ -103,12 +103,12 @@ return vec2(1., 0.);
|
|
|
103
103
|
false
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
|
-
`),m.
|
|
107
|
-
ExtrudedVertex evaluateConnectingVertex(
|
|
108
|
-
vec2 profileVertex = pathProfileVertices[
|
|
109
|
-
vec2 profileNormal = pathProfileNormals[
|
|
106
|
+
`),m.code.add(n`
|
|
107
|
+
ExtrudedVertex evaluateConnectingVertex(PathVertexDescriptor vertexDescriptor, ExtrusionFrame frame) {
|
|
108
|
+
vec2 profileVertex = pathProfileVertices[vertexDescriptor.sourceIndex];
|
|
109
|
+
vec2 profileNormal = pathProfileNormals[vertexDescriptor.sourceIndex];
|
|
110
110
|
|
|
111
|
-
float profilePlaneVertexOffset = ${
|
|
111
|
+
float profilePlaneVertexOffset = ${s(2===d.pathCapType,n`vertexDescriptor.isEnd ? 0.5 : -0.5`,n`0.`)};
|
|
112
112
|
|
|
113
113
|
return ExtrudedVertex(
|
|
114
114
|
frame,
|
|
@@ -121,12 +121,12 @@ return vec2(1., 0.);
|
|
|
121
121
|
true
|
|
122
122
|
);
|
|
123
123
|
}
|
|
124
|
-
`),
|
|
125
|
-
ExtrudedVertex evaluateFlatCapVertex(
|
|
126
|
-
vec2 profileVertex = pathProfileVertices[
|
|
127
|
-
bool isEnd =
|
|
124
|
+
`),d.pathCapType){case 1:case 2:m.code.add(n`
|
|
125
|
+
ExtrudedVertex evaluateFlatCapVertex(PathVertexDescriptor vertexDescriptor, ExtrusionFrame frame) {
|
|
126
|
+
vec2 profileVertex = pathProfileVertices[vertexDescriptor.sourceIndex];
|
|
127
|
+
bool isEnd = vertexDescriptor.isEnd;
|
|
128
128
|
float normalOffset = isEnd ? 1. : -1.;
|
|
129
|
-
float profilePlaneOffset = ${
|
|
129
|
+
float profilePlaneOffset = ${s(2===d.pathCapType,n`isEnd ? 0.5 : -0.5`,n`0.0`)};
|
|
130
130
|
vec2 normal = vec2(0.);
|
|
131
131
|
|
|
132
132
|
return ExtrudedVertex(
|
|
@@ -140,11 +140,11 @@ return vec2(1., 0.);
|
|
|
140
140
|
true
|
|
141
141
|
);
|
|
142
142
|
}
|
|
143
|
-
`);break;case 3:m.uniforms.add(new
|
|
144
|
-
bool isEnd =
|
|
143
|
+
`);break;case 3:m.uniforms.add(new i("pathProfilePoles",g,e=>e.profile.poles.flatMap(({position:e,normal:t})=>[...e,...t??x]),{supportsNaN:!0}),new p("pathProfilePoleIndices",h,e=>e.profile.poleIndices)),m.include(o),m.constants.add("pathNumRoundCapExtrusionSubdivisions","float",t),m.code.add(n`ExtrudedVertex evaluateRoundCapPoleVertex(PathVertexDescriptor vertexDescriptor, ExtrusionFrame frame) {
|
|
144
|
+
bool isEnd = vertexDescriptor.isEnd;
|
|
145
145
|
float capSign = isEnd ? 1. : -1.;
|
|
146
146
|
float offsetScale = capSign * 0.5;
|
|
147
|
-
vec4 pole = pathProfilePoles[
|
|
147
|
+
vec4 pole = pathProfilePoles[vertexDescriptor.sourceIndex];
|
|
148
148
|
vec2 polePosition = pole.xy;
|
|
149
149
|
bool hasPoleNormal = !isnan(pole.z);
|
|
150
150
|
vec2 poleNormal = hasPoleNormal ? pole.zw : vec2(0.);
|
|
@@ -160,20 +160,20 @@ normalOffset,
|
|
|
160
160
|
true
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
|
-
ExtrudedVertex evaluateRoundCapInnerVertex(
|
|
164
|
-
bool isEnd =
|
|
163
|
+
ExtrudedVertex evaluateRoundCapInnerVertex(PathVertexDescriptor vertexDescriptor, ExtrusionFrame frame) {
|
|
164
|
+
bool isEnd = vertexDescriptor.isEnd;
|
|
165
165
|
float capSign = isEnd ? 1. : -1.;
|
|
166
166
|
float offsetScale = capSign * 0.5;
|
|
167
|
-
float subdivision =
|
|
167
|
+
float subdivision = vertexDescriptor.subdivision;
|
|
168
168
|
float t = 1. - (subdivision + 1.) / pathNumRoundCapExtrusionSubdivisions;
|
|
169
169
|
float theta = t * HALF_PI;
|
|
170
170
|
float t1 = sin(theta);
|
|
171
171
|
float t2 = cos(theta);
|
|
172
|
-
int poleIndex = pathProfilePoleIndices[
|
|
172
|
+
int poleIndex = pathProfilePoleIndices[vertexDescriptor.sourceIndex];
|
|
173
173
|
vec4 pole = pathProfilePoles[poleIndex];
|
|
174
174
|
vec2 polePosition = pole.xy;
|
|
175
175
|
bool hasPoleNormal = !isnan(pole.z);
|
|
176
|
-
vec2 profileVertex = pathProfileVertices[
|
|
176
|
+
vec2 profileVertex = pathProfileVertices[vertexDescriptor.sourceIndex];
|
|
177
177
|
vec2 poleOffsetScaled = (profileVertex - polePosition) * t1;
|
|
178
178
|
vec2 poleVertex = poleOffsetScaled + polePosition;
|
|
179
179
|
vec2 profileNormal = hasPoleNormal
|
|
@@ -190,31 +190,31 @@ offsetScale * t2,
|
|
|
190
190
|
normalOffset,
|
|
191
191
|
true
|
|
192
192
|
);
|
|
193
|
-
}`)}m.code.add(
|
|
193
|
+
}`)}m.code.add(n`
|
|
194
194
|
ExtrudedVertex evaluateVertex() {
|
|
195
|
-
|
|
195
|
+
PathVertexDescriptor vertexDescriptor = getDescriptor();
|
|
196
196
|
ExtrusionFrame frame = ExtrusionFrame(
|
|
197
197
|
getFrameUp(),
|
|
198
198
|
getFrameRight()
|
|
199
199
|
);
|
|
200
200
|
|
|
201
|
-
switch (
|
|
201
|
+
switch (vertexDescriptor.type) {
|
|
202
202
|
case pathVertexTypeJoin:
|
|
203
|
-
return evaluateJoinVertex(
|
|
203
|
+
return evaluateJoinVertex(vertexDescriptor, frame);
|
|
204
204
|
|
|
205
205
|
case pathVertexTypeCapConnectingProfile:
|
|
206
|
-
return evaluateConnectingVertex(
|
|
206
|
+
return evaluateConnectingVertex(vertexDescriptor, frame);
|
|
207
207
|
|
|
208
|
-
${
|
|
209
|
-
case
|
|
210
|
-
return evaluateFlatCapVertex(
|
|
208
|
+
${s(1===d.pathCapType||2===d.pathCapType,n`
|
|
209
|
+
case pathVertexTypeCapProfile:
|
|
210
|
+
return evaluateFlatCapVertex(vertexDescriptor, frame);
|
|
211
211
|
`)}
|
|
212
212
|
|
|
213
|
-
${
|
|
214
|
-
case
|
|
215
|
-
return evaluateRoundCapPoleVertex(
|
|
213
|
+
${s(3===d.pathCapType,n`
|
|
214
|
+
case pathVertexTypeCapProfile:
|
|
215
|
+
return evaluateRoundCapPoleVertex(vertexDescriptor, frame);
|
|
216
216
|
case pathVertexTypeRoundCapInnerProfile:
|
|
217
|
-
return evaluateRoundCapInnerVertex(
|
|
217
|
+
return evaluateRoundCapInnerVertex(vertexDescriptor, frame);
|
|
218
218
|
`)}
|
|
219
219
|
|
|
220
220
|
default:
|
|
@@ -230,4 +230,4 @@ true
|
|
|
230
230
|
);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
`)}const
|
|
233
|
+
`)}const x=e(NaN,NaN);export{d as PathEvaluate};
|
|
@@ -1,19 +1,47 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{glsl as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
uint
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
import{If as t,glsl as e}from"../../shaderModules/glsl.js";import{sourceIndexMask as a,descriptorDataShift as r,descriptorDataMask as i,descriptorTypeShift as n,descriptorCapSideShift as p,descriptorCapSubdivisionMask as s,descriptorShift as o,frameIndexMask as d}from"../../../lib/PathVertexInfo.js";function c(c,h){const{attributes:x,vertex:u}=c;x.add("pathVertexInfo","uint"),u.constants.add("pathVertexDescriptorSourceIndexMask","uint",a),u.constants.add("pathVertexDescriptorDataShift","uint",r),u.constants.add("pathVertexDescriptorDataMask","uint",i),u.constants.add("pathVertexDescriptorTypeShift","uint",n),u.constants.add("pathVertexDescriptorCapSideShift","uint",p),u.constants.add("pathVertexDescriptorCapSubdivisionMask","uint",s),u.constants.add("pathVertexInfoDescriptorShift","uint",o),u.constants.add("pathVertexInfoFrameIndexMask","uint",d),u.constants.add("pathVertexCapSideEnd","uint",1),u.constants.add("pathVertexTypeJoin","uint",0),u.constants.add("pathVertexTypeCapConnectingProfile","uint",1),u.constants.add("pathVertexTypeCapProfile","uint",2),3===h.pathCapType&&u.constants.add("pathVertexTypeRoundCapInnerProfile","uint",3),u.code.add(e`
|
|
3
|
+
struct PathVertexDescriptor {
|
|
4
|
+
uint sourceIndex;
|
|
5
|
+
float subdivision;
|
|
6
|
+
uint type;
|
|
7
|
+
bool isEnd;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
uint getFrameIndex() {
|
|
11
|
+
return pathVertexInfo & pathVertexInfoFrameIndexMask;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
PathVertexDescriptor getDescriptor() {
|
|
15
|
+
uint descriptor = pathVertexInfo >> pathVertexInfoDescriptorShift;
|
|
16
|
+
uint sourceIndex = descriptor & pathVertexDescriptorSourceIndexMask;
|
|
17
|
+
uint descriptorData = (descriptor >> pathVertexDescriptorDataShift) & pathVertexDescriptorDataMask;
|
|
18
|
+
uint type = descriptor >> pathVertexDescriptorTypeShift;
|
|
19
|
+
float subdivision = 0.;
|
|
20
|
+
bool isEnd = false;
|
|
21
|
+
|
|
22
|
+
switch (type) {
|
|
23
|
+
case pathVertexTypeJoin:
|
|
24
|
+
subdivision = float(descriptorData);
|
|
25
|
+
break;
|
|
26
|
+
|
|
27
|
+
${t(3===h.pathCapType,e`
|
|
28
|
+
case pathVertexTypeRoundCapInnerProfile:
|
|
29
|
+
subdivision = float(descriptorData & pathVertexDescriptorCapSubdivisionMask);
|
|
30
|
+
`)}
|
|
31
|
+
case pathVertexTypeCapConnectingProfile:
|
|
32
|
+
${t(0!==h.pathCapType,e`
|
|
33
|
+
case pathVertexTypeCapProfile:
|
|
34
|
+
`)}
|
|
35
|
+
isEnd = (descriptorData >> pathVertexDescriptorCapSideShift) == pathVertexCapSideEnd;
|
|
36
|
+
break;
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return PathVertexDescriptor(
|
|
41
|
+
sourceIndex,
|
|
42
|
+
subdivision,
|
|
43
|
+
type,
|
|
44
|
+
isEnd
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
`)}export{c as PathVertexInfo};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{TextureBackedBufferModule as t}from"../TextureBackedBuffer.glsl.js";import{PathEvaluate as r}from"./PathEvaluate.glsl.js";import{PiUtils as o}from"../shading/PiUtils.glsl.js";import{Float2PassUniform as i}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as l}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as s}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as v}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as c}from"../../shaderModules/FloatsPassUniform.js";import{glsl as
|
|
2
|
+
import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{TextureBackedBufferModule as t}from"../TextureBackedBuffer.glsl.js";import{PathEvaluate as r}from"./PathEvaluate.glsl.js";import{PiUtils as o}from"../shading/PiUtils.glsl.js";import{Float2PassUniform as i}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as l}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as s}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as v}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as c}from"../../shaderModules/FloatsPassUniform.js";import{glsl as n,If as u}from"../../shaderModules/glsl.js";import{Texture2DUintDrawUniform as f}from"../../shaderModules/Texture2DUintDrawUniform.js";import{circleProfiles as d}from"../../../lib/PathProfile.js";import{getTextureLayout as p}from"../../../materials/PathLayouts.js";import{VisualVariablePassParameters as m,vvColorNumber as x}from"../../../materials/VisualVariablePassParameters.js";const g=8;function h(e,d){const{vertex:m}=e,h=new f("componentTextureBuffer",e=>e.textureBuffer),y=new t({layout:p(d),itemIndexExpression:"getFrameIndex()",bufferUniform:h}).createBuilder(e,d);m.uniforms.add(new i("size",e=>e.size));const{hasVVSize:V,hasVVColor:b,hasVVOpacity:z}=d;V?(m.uniforms.add(new a("vvSizeMinSize",e=>e.vvSize.minSize),new a("vvSizeMaxSize",e=>e.vvSize.maxSize),new a("vvSizeOffset",e=>e.vvSize.offset),new a("vvSizeFactor",e=>e.vvSize.factor),new a("vvSizeFallback",e=>e.vvSize.fallback)),m.code.add(n`
|
|
3
3
|
vec2 getSize() {
|
|
4
|
-
float value = ${
|
|
4
|
+
float value = ${y.getTextureAttribute("sizeFeatureAttribute")};
|
|
5
5
|
if (isnan(value)) {
|
|
6
6
|
return vvSizeFallback.xz;
|
|
7
7
|
}
|
|
8
8
|
return size * clamp(vvSizeOffset + value * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz;
|
|
9
9
|
}
|
|
10
|
-
`)):
|
|
10
|
+
`)):m.code.add(n`vec2 getSize(){
|
|
11
11
|
return size;
|
|
12
|
-
}`),
|
|
12
|
+
}`),z?(m.constants.add("vvOpacityNumber","int",g),m.uniforms.add(new c("vvOpacityValues",g,e=>e.vvOpacity.values),new c("vvOpacityOpacities",g,e=>e.vvOpacity.opacityValues),new v("vvOpacityFallback",e=>e.vvOpacity.fallback,{supportsNaN:!0})),m.code.add(n`
|
|
13
13
|
vec4 applyOpacity(vec4 color) {
|
|
14
14
|
// if we encounter NaN in the color it means the color is in the fallback case where the symbol color
|
|
15
15
|
// is not defined and there is no valid color visual variable override. In this case just return a fully
|
|
@@ -18,11 +18,11 @@ return size;
|
|
|
18
18
|
return vec4(0);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
float value = ${
|
|
21
|
+
float value = ${y.getTextureAttribute("opacityFeatureAttribute")};
|
|
22
22
|
|
|
23
23
|
if (isnan(value)) {
|
|
24
24
|
// If there is a color vv then it will already have taken care of applying the fallback
|
|
25
|
-
return ${
|
|
25
|
+
return ${u(b,"color","vec4(color.rgb, vvOpacityFallback)")};
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
if (value <= vvOpacityValues[0]) {
|
|
@@ -38,11 +38,11 @@ return size;
|
|
|
38
38
|
|
|
39
39
|
return vec4( color.rgb, vvOpacityOpacities[vvOpacityNumber - 1]);
|
|
40
40
|
}
|
|
41
|
-
`)):
|
|
41
|
+
`)):m.code.add(n`vec4 applyOpacity(vec4 color){
|
|
42
42
|
return color;
|
|
43
|
-
}`),
|
|
43
|
+
}`),b?(m.constants.add("vvColorNumber","int",x),m.uniforms.add(new c("vvColorValues",x,e=>e.vvColor.values),new s("vvColorColors",x,e=>e.vvColor.colors),new l("vvColorFallback",e=>e.vvColor.fallback)),m.code.add(n`
|
|
44
44
|
vec4 getColor() {
|
|
45
|
-
float value = ${
|
|
45
|
+
float value = ${y.getTextureAttribute("colorFeatureAttribute")};
|
|
46
46
|
if (isnan(value)) {
|
|
47
47
|
return applyOpacity(vvColorFallback);
|
|
48
48
|
}
|
|
@@ -60,48 +60,48 @@ return color;
|
|
|
60
60
|
|
|
61
61
|
return applyOpacity(vvColorColors[vvColorNumber - 1]);
|
|
62
62
|
}
|
|
63
|
-
`)):
|
|
63
|
+
`)):m.code.add(n`vec4 getColor(){
|
|
64
64
|
return applyOpacity(vec4(1, 1, 1, 1));
|
|
65
|
-
}`),
|
|
65
|
+
}`),m.include(o),m.code.add(n`
|
|
66
66
|
vec3 decompressAxis(vec2 axis) {
|
|
67
67
|
float z = 1.0 - abs(axis.x) - abs(axis.y);
|
|
68
68
|
return normalize(vec3(axis + sign(axis) * min(z, 0.0), z));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
float getProfileRotation() {
|
|
72
|
-
return PI * ${
|
|
72
|
+
return PI * ${y.getTextureAttribute("profileRotation")};
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
float getMaxStretchDistance() {
|
|
76
|
-
return ${
|
|
76
|
+
return ${y.getTextureAttribute("pathMaxStretchDistance")};
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
vec3 getFrameUp() {
|
|
80
|
-
return decompressAxis(${
|
|
80
|
+
return decompressAxis(${y.getTextureAttribute("profileUp")});
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
vec3 getFrameRight() {
|
|
84
|
-
return decompressAxis(${
|
|
84
|
+
return decompressAxis(${y.getTextureAttribute("profileRight")});
|
|
85
85
|
}
|
|
86
|
-
`),
|
|
86
|
+
`),m.code.add(n`
|
|
87
87
|
vec3 getFrameRotationUp() {
|
|
88
|
-
return ${1===d.upVectorAlignment?
|
|
88
|
+
return ${1===d.upVectorAlignment?n`decompressAxis(${y.getTextureAttribute("pathRotationUp")})`:n`getFrameUp()`};
|
|
89
89
|
}
|
|
90
|
-
`),e.include(r,d),
|
|
90
|
+
`),e.include(r,d),m.code.add(n`
|
|
91
91
|
vec3 calculateVPos(ExtrudedVertex extrudedVertex) {
|
|
92
92
|
vec2 size = getSize();
|
|
93
|
-
vec3 origin = ${
|
|
93
|
+
vec3 origin = ${y.getTextureAttribute("position")};
|
|
94
94
|
vec3 right = extrudedVertex.frame.right;
|
|
95
95
|
vec3 up = extrudedVertex.frame.up;
|
|
96
96
|
vec2 profileVertex = extrudedVertex.profileVertex * size;
|
|
97
|
-
`),
|
|
97
|
+
`),m.code.add(n`if(extrudedVertex.isCap) {
|
|
98
98
|
float positionOffsetAlongProfilePlaneNormal = extrudedVertex.capPositionOffset * size[0];
|
|
99
99
|
vec3 forward = cross(up, right);
|
|
100
100
|
vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positionOffsetAlongProfilePlaneNormal;
|
|
101
101
|
return origin + offset;
|
|
102
102
|
}
|
|
103
103
|
vec2 rotationRight = extrudedVertex.rotationRight;
|
|
104
|
-
float maxDistance = extrudedVertex.maxDistance;`),
|
|
104
|
+
float maxDistance = extrudedVertex.maxDistance;`),m.code.add(n`rotationRight *= size;
|
|
105
105
|
rotationRight = length(rotationRight) > 0.0 ? normalize(rotationRight) : vec2(0, 0);
|
|
106
106
|
float rx = dot(profileVertex, rotationRight);
|
|
107
107
|
if (abs(rx) > maxDistance) {
|
|
@@ -111,7 +111,7 @@ profileVertex = rotationRight * maxDistance * sign(rx) + rotationUp * ry;
|
|
|
111
111
|
}
|
|
112
112
|
vec3 offset = right * profileVertex.x + up * profileVertex.y;
|
|
113
113
|
return origin + offset;
|
|
114
|
-
}`),
|
|
114
|
+
}`),m.code.add(n`vec3 localNormal(ExtrudedVertex extrudedVertex) {
|
|
115
115
|
vec3 right = extrudedVertex.frame.right;
|
|
116
116
|
vec3 up = extrudedVertex.frame.up;
|
|
117
117
|
vec2 profileNormal = extrudedVertex.profileNormal;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o,cast as l,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as d}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeVisualizerNode as h,getAttachmentName as a}from"./RenderNodeVisualizerNode.js";import c from"../../../../../widgets/Widget.js";import{tsx as p}from"../../../../../widgets/support/widget.js";let u=class extends c{constructor(){super(...arguments),this.clearColor=d,this.previewSize=
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o,cast as l,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as d}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeVisualizerNode as h,getAttachmentName as a}from"./RenderNodeVisualizerNode.js";import c from"../../../../../widgets/Widget.js";import{tsx as p}from"../../../../../widgets/support/widget.js";let u=class extends c{constructor(){super(...arguments),this.clearColor=d,this.previewSize=w,this.filter=["color"],this.node=null,this.active=!0,this._previews=new Map,this._allPreviews=new Set,this._dirty=!0}castPreviewSize(e){return Math.max(e,w)}get _namedFilters(){const e=this.filter?.filter(e=>"color"!==e&&"depth"!==e);return e&&e.length>0?e:null}initialize(){this.node||(this.node=new h({view:this.view,destroyedCB:()=>{this.node=null,this.destroy()},clearColor:this.clearColor}));const e=this.node;this._updateInterval=setInterval(()=>this._updatePreviews()),this.addHandles([r(()=>this.active,i=>{this.view.stage.renderer.fboCache.debugCallback=i?(i,r)=>{if(null==i||null==r||!this.view.stage.renderView.renderingContext)return this._previews.forEach(([e])=>e.release()),void this._previews.clear();if("fbo visualizer"===i||!this._matchesFilter(i)||r&&0===r.colorAttachments.length&&null==r.depthStencilTexture)return;const{width:s,height:o}=r,l=o>this.previewSize?Math.round(s*this.previewSize/o):s,n=o>this.previewSize?this.previewSize:o;if(l/n>4)return void t.getLogger(this).warnOnce(`Skipping preview of wide ${i} FBO (${l}x${n}px)`);r.level&&(i+=` ${r.level}`);const d=e.getDownscaledFBO(r,i,l,n,this._focusedAttachment,this._focusedAttachmentType),h=null!=r.depthStencilTexture,c=this.filter?.includes("color")||!this.filter?.includes("depth"),p=this.filter?.includes("depth")||!this.filter?.includes("color");d.fbo?.colorAttachments.forEach((e,t)=>{const l=d.getAttachment(e);if(l){const n=h&&t===r.colorAttachments.length;if(n&&!p||!n&&!c)return;l.retain();const d=a(i,r,e,n),u=this._previews.get(d);u?.[0]?.release(),this._previews.set(d,[l,s,o]),this._allPreviews.add(d)}}),d.detachAllColors(),d.release(),this._dirty=!0}:null},s)])}destroy(){this.removeHandles(),this.view.stage?.renderer&&(this.view.stage.renderer.fboCache.debugCallback=null),this._removeUpdate(),this.node&&(this.node.destroyedCB=()=>{},this.node=i(this.node)),this._previews.forEach(([e])=>e.release()),this._previews.clear()}_matchesFilter(e){return this._namedFilters?.some(t=>e.includes(t))??!0}_updatePreviews(){if(!this._dirty)return;this._dirty=!1,this.renderNow();const e=this._focusedAttachment&&Array.from(this._previews.keys()).includes(this._focusedAttachment);this._focusedAttachment&&!e&&this._deselectFocusFBO(),this._allPreviews.forEach((e,t)=>{const i=this._getElement(t);if(!i)return;i.getContext("2d").clearRect(0,0,i.width,i.height)}),this._previews.forEach(([e,t,i],r)=>{const s=this._getElement(r);if(!s)return;const o=i>this.previewSize?Math.round(t*this.previewSize/i):t,l=i>this.previewSize?this.previewSize:i;s.style.width=`${o}px`,s.style.height=`${l}px`;const n=s.width,d=s.height,h=this._getElement(`label-${r}`);h&&(h.innerText=`${r} (${t}x${i})`);const a=this.node?.getPreviewContent(n,d,e,r),c=s.getContext("2d");c.clearRect(0,0,n,d),a&&c.putImageData(a,0,0)})}_getElement(e){return document.querySelector("arcgis-scene")?.shadowRoot?.getElementById(e)??document.getElementById(e)}_fboPreviewStyle(e){return{width:"1px",height:"1px",background:e?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",transform:"rotateX(180deg)"}}_removeUpdate(){null!=this._updateInterval&&(clearInterval(this._updateInterval),this._updateInterval=null)}_selectFocusFBO(e,t){this._focusedAttachment=e,this._focusedAttachmentType=0===t?null:9,this.view.stage.renderView.requestRender()}_deselectFocusFBO(){this._focusedAttachment=null,this.node?.clearFocusedFBO(),this.view.stage.renderView.requestRender()}_renderFBOPreviews(){const e=this._allPreviews.size>0?Array.from(this._allPreviews.keys()).sort().map(e=>this._renderFBOPreview(e)):p("div",null);return p("div",{styles:{display:"flex",flexFlow:"row wrap",justifyContent:"flex-end",gap:"2px"}},e)}_renderFBOPreview(e){const t=this._previews.has(e);return p("div",{key:e,styles:{display:"flex",flexFlow:"column nowrap",alignItems:"center"},onmousedown:t=>this._selectFocusFBO(e,t.button)},p("canvas",{id:e,styles:this._fboPreviewStyle(t)}),p("div",{id:e,styles:{display:"flex",justifyContent:"center"}},p("p",{id:`label-${e}`,styles:{fontSize:"12px",color:"white",margin:"1px",textShadow:"-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000"}})))}render(){return p("div",{class:"esri-widget debug-widget",styles:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-end",background:"rgba(255, 255, 255, 0)"}},this._renderFBOPreviews(),p("button",{type:"button",onclick:()=>this._deselectFocusFBO()},"Reset focus"))}};e([o({constructOnly:!0})],u.prototype,"view",void 0),e([o({constructOnly:!0})],u.prototype,"clearColor",void 0),e([o()],u.prototype,"previewSize",void 0),e([l("previewSize")],u.prototype,"castPreviewSize",null),e([o()],u.prototype,"filter",void 0),e([o()],u.prototype,"_namedFilters",null),e([o()],u.prototype,"node",void 0),e([o()],u.prototype,"active",void 0),u=e([n("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizer")],u);const w=140;export{u as RenderNodeVisualizer,w as minimumPreviewSize};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{property as t,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeOutput as i}from"../../../webgl.js";import s from"../../../webgl/RenderNode.js";import{If as a,glsl as c}from"../../core/shaderModules/glsl.js";import{Pos2Locations as u}from"../../lib/DefaultVertexBufferLayouts.js";import{floatBlendReductionFactor as l}from"../../shaders/oitResolution.glsl.js";import{checkWebGLError as h}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as p,SizedPixelFormat as f,DataType as d}from"../../../../webgl/enums.js";let m=class extends s{constructor(e){super(e),this.destroyedCB=null,this.produces=i.FINAL,this.consumes={required:[i.FINAL]},this.clearColor=n,this._focusedFBOType=7,this._programs=new Map}destroy(){this._programs.clear(),this.destroyedCB()}render(e){const r=e.find(({name:e})=>e===i.FINAL);if(!this._focusedTexture)return r;const t=this.renderingContext,o=t.boundFramebuffer;t.bindFramebuffer(r.fbo),t.setClearColor(0,0,0,0),t.clear(16384);const n=this._focusedTexture.attachment,s=[v(n)],a=this._ensureProgram(t,!1,s);return t.useProgram(a),t.bindTexture(n,0),a.setUniform1i("colorTex0",0),a.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&a.setUniform2fv("nearFar",this.camera.nearFar),t.setDrawBuffers([p]),t.screen.draw(),t.bindFramebuffer(o),r}getDownscaledFBO(e,r,t,o,n){if(
|
|
2
|
+
import{__decorate as e}from"tslib";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{property as t,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeOutput as i}from"../../../webgl.js";import s from"../../../webgl/RenderNode.js";import{If as a,glsl as c}from"../../core/shaderModules/glsl.js";import{Pos2Locations as u}from"../../lib/DefaultVertexBufferLayouts.js";import{floatBlendReductionFactor as l}from"../../shaders/oitResolution.glsl.js";import{checkWebGLError as h}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as p,SizedPixelFormat as f,DataType as d}from"../../../../webgl/enums.js";let m=class extends s{constructor(e){super(e),this.destroyedCB=null,this.produces=i.FINAL,this.consumes={required:[i.FINAL]},this.clearColor=n,this._focusedFBOType=7,this._programs=new Map}destroy(){this._programs.clear(),this.destroyedCB()}render(e){const r=e.find(({name:e})=>e===i.FINAL);if(!this._focusedTexture)return r;const t=this.renderingContext,o=t.boundFramebuffer;t.bindFramebuffer(r.fbo),t.setClearColor(0,0,0,0),t.clear(16384);const n=this._focusedTexture.attachment,s=[v(n)],a=this._ensureProgram(t,!1,s);return t.useProgram(a),t.bindTexture(n,0),a.setUniform1i("colorTex0",0),a.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&a.setUniform2fv("nearFar",this.camera.nearFar),t.setDrawBuffers([p]),t.screen.draw(),t.bindFramebuffer(o),r}getDownscaledFBO(e,r,t,o,n,i){if(n?.startsWith(`${r}\n`)??!1){const r=1/2**e.level;t=e.width*r,o=e.height*r}else i=null;const s="linear depth"===r||r.includes("shadow"),a="overlay highlight"===r||"highlights"===r||"highlight mix"===r,c="highlight coverage"===r,u=e.colorTexture?.descriptor,l=u?.internalFormat,d=[],m=new Array,g=new Array;e.colorAttachments.forEach((r,t)=>{const o=e.getColorTexture(r);if(o){const e=v(o);d.push(e);const{descriptor:r}=o;"float"!==e||r.hasMipmap||r.isImmutable||(o.generateMipmap(),m[t]=!0)}if(t>0){const e=o?.descriptor.internalFormat;return void(e===f.RGBA8&&(o?.debugName?.indexOf("emissive")??-1)>=0?g.push(8):g.push(F(e)))}g.push(s?0:a?1:c?2:i??F(l))});const x=this.renderingContext,{depthStencilTexture:$}=e,b=this._ensureProgram(x,null!=$,d,e.level),C=this.fboCache.acquire(t,o,"fbo visualizer");x.useProgram(b);const R=x.boundFramebuffer;x.bindFramebuffer(C.fbo);const y=new Array;e.colorAttachments.forEach((r,t)=>{const o=`colorTex${t.toFixed()}`;x.bindTexture(e.getColorTexture(r),t),b.setUniform1i(o,t),t>0&&C.acquireColor(p+t,5,"fbo visualizer"),y.push(r)});const w=$?.descriptor.linearFilterDepth??!1;if($){const r=e.colorAttachments.length;$.setShadowFiltering(!1),x.bindTexture($,r),b.setUniform1i("depthTex",r);const t=p+r;t>p&&C.acquireColor(t,5,"fbo visualizer"),y.push(t)}x.gl.drawBuffers(y),h(x.gl);const B=x.getViewport();return x.setViewport(0,0,t,o),x.setClearColor(0,0,0,0),x.clear(16384),x.setBlendingEnabled(!0),x.setBlendFunction(1,771),b.setUniform1iv("inputTypes",g.length>0?g:[7]),b.setUniform2fv("nearFar",this.camera.nearFar),x.screen.draw(),h(x.gl),x.bindFramebuffer(R),x.setViewport(B.x,B.y,B.width,B.height),e.colorAttachments.forEach((t,o)=>{const i=e.getColorTexture(t);m[o]&&i?.clearMipmap(),n===T(r,e,t,!1)&&(this._focusedTexture?.release(),this._focusedTexture=C.getAttachment(t),this._focusedTexture?.retain(),this._focusedFBOType=9===g[o]?F(i?.descriptor.internalFormat):g[o])}),$&&$.setShadowFiltering(w),C}clearFocusedFBO(){this._focusedTexture=r(this._focusedTexture)}getPreviewContent(e,r,t,o){const n=this.renderingContext,i=o.includes("\ndepth"),s=this.fboCache.acquire(e,r,"fbo visualizer"),a=n.boundFramebuffer;n.bindFramebuffer(s?.fbo);const c=n.getViewport();n.setViewport(0,0,e,r),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const u=t.attachment,l=this._ensureProgram(n,!1,[v(u)]);n.useProgram(l),n.bindTexture(u,0),l.setUniform1i("colorTex0",0),l.setUniform1iv("inputTypes",[i||u.descriptor.internalFormat!==f.RGBA16F?7:5]),n.screen.draw();const p=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,6408,d.UNSIGNED_BYTE,new Uint8Array(p.data.buffer)),h(n.gl),n.bindFramebuffer(a),n.setViewport(c.x,c.y,c.width,c.height),s?.release(),p}_ensureProgram(e,r,t,o=0){const n=x({hasDepthAttachment:r,colorSamplerTypes:t}),i=this._programs.get(n);if(i)return i;const s="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",h=e=>{let r="";for(let t=0;t<e.length;++t){const o=e[t];r+=`layout(location = ${c.int(t)}) out vec4 fragColor${c.int(t)};\n uniform ${g(o)} colorTex${c.int(t)};`}return r},p=e=>e.reduce((e,r,t)=>e+`{\n int inputType = inputTypes[${t}];\n if (inputType == ${3..toFixed()}) {\n fragColor${t} = vec4(vec3(texture(colorTex${t}, uv, ${o}.0).r), 1.0);\n } else if (inputType == ${4..toFixed()}) {\n fragColor${t} = vec4(texture(colorTex${t}, uv, ${o}.0).rg, 0.0, 1.0);\n } else if (inputType == ${(0).toFixed()}) {\n float depth = 1.0 - ((-linearDepthFromTexture(colorTex${t}, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]));\n fragColor${t} = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if (inputType == ${5..toFixed()}) {\n fragColor${t} = vec4(texture(colorTex${t}, uv, ${o}.0).rgb, 1.0);\n } else if (inputType == ${1..toFixed()}) {\n fragColor${t} = vec4(texture(colorTex${t}, uv, ${o}.0)) * 255.0;\n fragColor${t} = vec4(fragColor${t}.rgb / fragColor${t}.a, fragColor${t}.a);\n } else if(inputType == ${2..toFixed()}) {\n vec2 texDim = vec2(textureSize(colorTex${t}, 0));\n ivec2 iuv = ivec2(uv * texDim);\n uvec2 hh = uvec2(texelFetch(colorTex${t}, iuv, 0).rg);\n fragColor${t} = vec4(\n ((hh & uvec2(0x55u)) != uvec2(0u)) ? 1.0 : 0.0,\n ((hh & uvec2(0xaau)) != uvec2(0u)) ? 1.0 : 0.0,\n 0.0,\n 1.0);\n } else if(inputType == ${8..toFixed()}) {\n fragColor${t} = vec4(texture(colorTex${t}, uv, ${o}.0));\n fragColor${t}.rgb *= ${l.toFixed(1)};\n } else if (inputType == ${9..toFixed()}) {\n fragColor${t} = vec4(vec3(texture(colorTex${t}, uv, ${o}.0).a), 1.0);\n } else {\n fragColor${t} = vec4(texture(colorTex${t}, uv, ${o}.0));\n }\n }`,""),f=t.length,d=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${h(t)}\n ${a(r,`layout(location = ${c.int(f)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputTypes[${t.length||1}];\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaToFloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaToFloat(depth));\n }\n\n ${"float"===t[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${p(t)}\n ${a(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n }`,m=e.programCache.get(s,d,u);return this._programs.set(n,m),m}};function g(e){switch(e){case"float":return"sampler2D";case"uint":return"usampler2D";case"int":return"isampler2D"}}function v(e){if(!e)return"float";const{internalFormat:r}=e.descriptor;switch(r){case f.R8I:case f.R16I:case f.R32I:case f.RG8I:case f.RG16I:case f.RG32I:case f.RGB8I:case f.RGB16I:case f.RGB32I:case f.RGBA8I:case f.RGBA16I:case f.RGBA32I:return"int";case f.R8UI:case f.R16UI:case f.R32UI:case f.RG8UI:case f.RG16UI:case f.RG32UI:case f.RGB8UI:case f.RGB16UI:case f.RGB32UI:case f.RGBA8UI:case f.RGBA16UI:case f.RGBA32UI:return"uint";default:return"float"}}function x(e){const{hasDepthAttachment:r,colorSamplerTypes:t}=e;return`${r?"Depth":""}${t.reduceRight((e,r)=>e+`|C${r}`,"")}`}function F(e){switch(e){case f.R16F:case f.R32F:case f.R8:return 3;case f.RG8:return 4;case f.RGBA16F:return 5;case f.RG8UI:return 6;default:return 7}}function T(e,r,t,o){return o?`${e}\ndepth`:`${e}\n${$(r,t)}`}function $(e,r){return`${e.getColorTexture(r)?.debugName??"color"+(r-p)}`}e([t()],m.prototype,"destroyedCB",void 0),e([t()],m.prototype,"produces",void 0),e([t()],m.prototype,"consumes",void 0),e([t()],m.prototype,"clearColor",void 0),m=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],m);export{m as RenderNodeVisualizerNode,T as getAttachmentName};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{O as e}from"../../../../../chunks/OITBlendEmission.glsl.js";import{OITBlendEmissionTechnique as i}from"./OITBlendEmissionTechnique.js";import{OITBlendFragmentTechniqueConfiguration as s}from"./OITBlendFragmentTechniqueConfiguration.js";import{OITBlendTechnique as t}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as n}from"./OITBlendTechniqueConfiguration.js";import{OITDimOpaqueTechnique as
|
|
2
|
+
import{O as e}from"../../../../../chunks/OITBlendEmission.glsl.js";import{OITBlendEmissionTechnique as i}from"./OITBlendEmissionTechnique.js";import{OITBlendFragmentTechniqueConfiguration as s}from"./OITBlendFragmentTechniqueConfiguration.js";import{OITBlendTechnique as t}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as n}from"./OITBlendTechniqueConfiguration.js";import{OITDimOpaqueTechnique as o}from"./OITDimOpaqueTechnique.js";import{OITResolutionConfiguration as r}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as a,ColorAttachment2 as u,DrawBufferNone as h}from"../../../../webgl/enums.js";class m{constructor(i){this._techniques=i,this._parameters=new e,this._blendConfiguration=new n,this._dimOpaqueConfiguration=new s,this._blendEmissionConfiguration=new r}precompile(e,s,n){this._updateConfigurations(e,s,n);const{hasTransparentEmission:r,hasOpaqueEmission:a}=e;a&&1!==n&&this._techniques.precompile(o,this._dimOpaqueConfiguration),this._techniques.precompile(t,this._blendConfiguration),r&&0===n&&this._techniques.precompile(i,this._blendEmissionConfiguration)}blend(e,s,n,r,m,f,p){this._updateConfigurations(r,m,f),this._parameters.colorTexture=s.getTexture(),this._parameters.alphaTexture=s.getTexture(a),this._parameters.emissionTexture=s.getTexture(u),this._parameters.frontFaceTexture=n.getTexture(),this._parameters.frontFaceEmissionTexture=n.getTexture(a);const c=e.drawBuffers,{hasOpaqueEmission:l,hasTransparentEmission:d}=r;if(l&&1!==f){const i=this._techniques.get(o,this._dimOpaqueConfiguration);e.bindTechnique(i,r,this._parameters),e.setDrawBuffers([h,a]),e.screen.draw(),p?.("oit opaque emission color",e.boundFramebuffer)}const _=this._techniques.get(t,this._blendConfiguration);if(e.bindTechnique(_,r,this._parameters),!l&&d){const i=c.slice();i[1]=h,e.setDrawBuffers(i),e.screen.draw()}else e.setDrawBuffers(c),e.screen.draw();if(p?.("oit composited",e.boundFramebuffer),d&&0===f){const s=this._techniques.get(i,this._blendEmissionConfiguration);e.bindTechnique(s,r,this._parameters),e.setDrawBuffers([h,a]),e.screen.draw(),p?.("oit transparent emission",e.boundFramebuffer)}e.setDrawBuffers(c)}_updateConfigurations(e,i,s){this._blendConfiguration.useFloatBlend=this._dimOpaqueConfiguration.useFloatBlend=this._blendEmissionConfiguration.useFloatBlend=e.useFloatBlend.value,this._blendConfiguration.computeHudOcclusion=i,this._blendConfiguration.hasOpaqueEmission=0===s&&e.hasOpaqueEmission,this._blendConfiguration.frontFaceMask=1===s}}export{m as OITBlend};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{floatSubArray as t}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as e}from"../../../../geometry/support/HalfFloatArray.js";import{newIndexArray as i,compactIndices as s}from"../../../../geometry/support/Indices.js";import{newShortArray as r}from"../../../../geometry/support/ShortArray.js";import{compressNormal as o,encodeInt16 as n}from"./Normals.js";import{PathEvaluator as h}from"./PathEvaluator.js";import{encodePathVertexInfo as
|
|
2
|
+
import{floatSubArray as t}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as e}from"../../../../geometry/support/HalfFloatArray.js";import{newIndexArray as i,compactIndices as s}from"../../../../geometry/support/Indices.js";import{newShortArray as r}from"../../../../geometry/support/ShortArray.js";import{compressNormal as o,encodeInt16 as n}from"./Normals.js";import{PathEvaluator as h}from"./PathEvaluator.js";import{encodePathVertexInfo as a}from"./PathVertexInfo.js";class u{constructor(s,o,n,a,u){this.path=s,this.profile=o,this.extruder=n,this.cap=a,this._extrusionVertexCount=0,this._extrusionFrameCount=0;const p=this.path.vertices.length-2;this.numExtrusionProfiles=n.numProfilesPerJoin()*p+2,this.numVerticesTotal=o.vertices.length*this.numExtrusionProfiles,this.numExtrusionFrames=this.path.vertices.length;const m=this.cap.numVertices;this.startCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=m,this.endCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=m,this.profileRightAxes=r(2*this.numExtrusionFrames),this.profileUpAxes=r(2*this.numExtrusionFrames);const l=1===u;this.profileRotationFrameUpAxes=l?r(2*this.numExtrusionFrames):null,this.pathMaxStretchDistances=e(this.numExtrusionFrames),this.profileRotations=r(this.numExtrusionFrames),this.framePositionIndices=i(this.numExtrusionFrames),this.pathVertexInfos=new Uint32Array(this.numVerticesTotal),this.positions=t(s.positions,s.offset,3*s.vertices.length),this._rebuildGeometry(),this._buildTopology(),this.evaluator=new h(this,o,this.extruder.numBendSubdivisions,a.type,n.cutoffAngle,u)}emitVertexDescriptor(t){const e=this._extrusionVertexCount;this.pathVertexInfos[e]=a(t),++this._extrusionVertexCount}emitExtrusionFrame(t,e){const{frame:i,rotationFrameUp:s,rotationAngle:r,maxStretchDistance:h}=t,a=this._extrusionFrameCount;return o(this.profileRightAxes,a,i.right[0],i.right[1],i.right[2]),o(this.profileUpAxes,a,i.up[0],i.up[1],i.up[2]),this.profileRotations[a]=n(r/Math.PI),this.profileRotationFrameUpAxes&&o(this.profileRotationFrameUpAxes,a,s[0],s[1],s[2]),this.pathMaxStretchDistances[a]=h,this.framePositionIndices[a]=e,this._extrusionFrameCount++}_rebuildGeometry(){this._extrusionVertexCount=0,this._extrusionFrameCount=0;const{positions:e,offset:i,vertices:s}=this.path,{profile:r}=this;this.positions=t(e,i,3*s.length);for(let t=0;t<s.length;++t)this.emitExtrusionFrame(s[t],t);for(let t=0;t<r.vertices.length;++t)this.emitVertexDescriptor({frameIndex:0,sourceIndex:t,subdivision:0,type:1,capSide:0});const o=(t,e,i)=>{this.emitVertexDescriptor({frameIndex:t,sourceIndex:e,subdivision:i,type:0,capSide:0})};for(let t=1;t<s.length-1;++t)this.extruder.extrude(t,this.profile,o);const n=s.length-1;for(let t=0;t<r.vertices.length;++t)this.emitVertexDescriptor({frameIndex:n,sourceIndex:t,subdivision:0,type:1,capSide:1});this.cap.rebuildCapGeometry((t,e,i)=>this.emitVertexDescriptor({frameIndex:0,sourceIndex:t,subdivision:e,type:i,capSide:0})),this.cap.rebuildCapGeometry((t,e,i)=>this.emitVertexDescriptor({frameIndex:n,sourceIndex:t,subdivision:e,type:i,capSide:1}))}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1,r=0,o=t*(this.numExtrusionProfiles-1),n=new Array,h=(t,e,i)=>{n.push(t),n.push(e),n.push(i)};for(let s=0;s<e;++s){const e=this.profile.indices[2*s],r=this.profile.indices[2*s+1];for(let s=0;s<i;++s){const i=s*t+e,o=(s+1)*t+r,n=s*t+r;h(i,(s+1)*t+e,o),h(i,o,n)}}this.cap.buildTopology(h,0,this.startCapVertexBufferStart,r),this.cap.buildTopology(h,1,this.endCapVertexBufferStart,o),this.vertexIndices=s(n)}onPathChanged(){this._rebuildGeometry()}}export{u as PathBuilder};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{pathNumRoundCapExtrusionSubdivisions as e}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";class t{constructor(){this.numVertices=0,this.numIndices=0,this.type=0}rebuildCapGeometry(){}buildTopology(){}}class s{constructor(e,t){this._profile=e,this.type=t}get numVertices(){return this._profile.vertices.length}get numIndices(){return 3*this._profile.numSegments}rebuildCapGeometry(e){const t=this._profile;for(let s=0;s<t.vertices.length;++s)e(s,0,2)}buildTopology(e,t,s){const i=this._profile,r=s+i.indices[0],o=1===t;for(let l=1;l<i.numSegments;++l){const t=s+i.indices[2*l],n=s+i.indices[2*l+1];o?e(n,t,r):e(r,t,n)}}}class i{constructor(e,t){this._profile=e,this._breakNormals=t,this.type=3}get numVertices(){let t=this._profile.vertices.length*(e-1)+this._profile.poles.length;return this._breakNormals&&(t+=this._profile.vertices.length),t}get numIndices(){let t=0;const s=this._profile;t+=2*s.numSegments*(e-1);for(let e=0;e<s.numSegments;++e){const i=s.indices[2*e],r=s.indices[2*e+1];s.poleIndices[i]===s.poleIndices[r]?t+=1:t+=2}return 3*t}rebuildCapGeometry(t){const s=this._profile;for(let e=0;e<s.poles.length;++e)t(e,0,
|
|
2
|
+
import{pathNumRoundCapExtrusionSubdivisions as e}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";class t{constructor(){this.numVertices=0,this.numIndices=0,this.type=0}rebuildCapGeometry(){}buildTopology(){}}class s{constructor(e,t){this._profile=e,this.type=t}get numVertices(){return this._profile.vertices.length}get numIndices(){return 3*this._profile.numSegments}rebuildCapGeometry(e){const t=this._profile;for(let s=0;s<t.vertices.length;++s)e(s,0,2)}buildTopology(e,t,s){const i=this._profile,r=s+i.indices[0],o=1===t;for(let l=1;l<i.numSegments;++l){const t=s+i.indices[2*l],n=s+i.indices[2*l+1];o?e(n,t,r):e(r,t,n)}}}class i{constructor(e,t){this._profile=e,this._breakNormals=t,this.type=3}get numVertices(){let t=this._profile.vertices.length*(e-1)+this._profile.poles.length;return this._breakNormals&&(t+=this._profile.vertices.length),t}get numIndices(){let t=0;const s=this._profile;t+=2*s.numSegments*(e-1);for(let e=0;e<s.numSegments;++e){const i=s.indices[2*e],r=s.indices[2*e+1];s.poleIndices[i]===s.poleIndices[r]?t+=1:t+=2}return 3*t}rebuildCapGeometry(t){const s=this._profile;for(let e=0;e<s.poles.length;++e)t(e,0,2);if(this._breakNormals)for(let e=0;e<s.vertices.length;++e)t(e,0,1);for(let i=0;i<e-1;++i)for(let e=0;e<s.vertices.length;++e)t(e,i,3)}buildTopology(t,s,i,r){const o=this._profile,l=this._breakNormals?i+o.poles.length:r,n=this._breakNormals?i+o.poles.length+o.vertices.length:i+o.poles.length,c=1===s;for(let h=0;h<o.numSegments;++h){const s=o.indices[2*h],r=o.indices[2*h+1],p=i+o.poleIndices[s],g=i+o.poleIndices[r];let m=l+s,u=l+r;for(let i=0;i<e-1;++i){const e=n+i*o.vertices.length+s,l=n+i*o.vertices.length+r;c?(t(e,u,m),t(u,e,l)):(t(m,u,e),t(l,e,u)),m=e,u=l}c?(t(p,u,m),p!==g&&t(p,g,u)):(t(m,u,p),p!==g&&t(u,g,p))}}}export{t as NoCapBuilder,i as RoundCapBuilder,s as TriangulationCapBuilder};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as o}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as
|
|
2
|
+
import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as o}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as a,copy as i,length as c,scale as f,set as n,dot as p,add as m,subtract as l,normalize as h,transformMat2 as u}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as x,UNIT_X as d,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as g,set as N,transformQuat as V,dot as I,scale as O,add as v,normalize as P}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as j}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{pathNumRoundCapExtrusionSubdivisions as M}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{compressNormal as y,decodeInt16 as C,decompressNormal as k}from"./Normals.js";import{PathFrame2D as A}from"./PathFrame2D.js";import{decodePathVertexInfo as D}from"./PathVertexInfo.js";class R{constructor(e,t,r,o,s,a){this.builder=e,this.profile=t,this.numJoinSubdivisions=r,this.capType=o,this.miterCutoffAngle=s,this.upVectorAlignment=a}evaluateBakedVertices(e,t,r){const{numVerticesTotal:o,framePositionIndices:s,positions:l}=this.builder;for(let h=0;h<o;++h){const o=W;this._evaluateExtrudedVertex(o,h);const u=B;let x=0,d=0;const b=o.frameIndex,V=o.frame.right,I=o.frame.up,O=3*s[b],v=a(G,o.profileVertex,r);if(o.isCap)g(u,I,V),x=o.capPositionOffset*r[0],d=o.capNormalOffset;else{const e=L,t=H;i(e,o.rotationRight);const s=o.maxDistance;a(e,e,r);const l=c(e);l>0?f(e,e,1/l):n(e,0,0);const h=p(v,e);if(Math.abs(h)>s){n(t,-e[1],e[0]);const r=p(v,t);f(e,e,s*Math.sign(h)),f(t,t,r),m(v,e,t)}N(u,0,0,0)}const P=V[0]*v[0]+I[0]*v[1],j=V[1]*v[0]+I[1]*v[1],M=V[2]*v[0]+I[2]*v[1],C=3*h;e[C]=l[O]+P+u[0]*x,e[C+1]=l[O+1]+j+u[1]*x,e[C+2]=l[O+2]+M+u[2]*x;const k=o.profileNormal[0],A=o.profileNormal[1];y(t,h,V[0]*k+I[0]*A+u[0]*d,V[1]*k+I[1]*A+u[1]*d,V[2]*k+I[2]*A+u[2]*d)}}_evaluateExtrudedVertex(e,t){const{profileRotations:r,profileUpAxes:s,profileRightAxes:a,profileRotationFrameUpAxes:c,pathMaxStretchDistances:n,pathVertexInfos:u}=this.builder,{miterCutoffAngle:b,profile:g,upVectorAlignment:N}=this,I=S[N],O=1===this.upVectorAlignment,v=D(u[t]),P=v.frameIndex;e.frameIndex=P;const j=C(r[P])*Math.PI,y=n[P];switch(k(e.frame.right,a,P),k(e.frame.up,s,P),e.maxDistance=0,v.type){case 0:{e.isCap=!1;const t=g.vertices[v.sourceIndex],r=g.normals[v.sourceIndex],s=Math.abs(j)>=b,a=O?k(K,c,P):e.frame.up,f=null!=c?w(J,e.frame,a):d,n=p(t,f)*j>=0;if(s&&n){i(e.profileVertex,t);const r=.5*-j+v.subdivision*j/this.numJoinSubdivisions;0!==r&&(o(Q,a,r),O&&V(e.frame.up,e.frame.up,Q),V(e.frame.right,e.frame.right,Q))}else{const r=I(E,t,j,f);i(e.profileVertex,r)}i(e.profileNormal,r),i(e.rotationRight,n?x:f),e.maxDistance=n?0:y;break}case 1:{e.isCap=!0;const t=g.vertices[v.sourceIndex],r=g.normals[v.sourceIndex];switch(i(e.profileVertex,t),i(e.profileNormal,r),this.capType){case 0:case 1:case 3:e.capPositionOffset=0,e.capNormalOffset=0;break;case 2:e.capPositionOffset=T(v)?.5:-.5,e.capNormalOffset=0}break}case 2:{e.isCap=!0;const t=T(v)?1:-1;switch(this.capType){case 1:case 2:{const r=g.vertices[v.sourceIndex],o=2===this.capType?.5*t:0,s=x;i(e.profileVertex,r),i(e.profileNormal,s),e.capPositionOffset=o,e.capNormalOffset=t;break}case 3:{const r=.5*t,o=g.poles[v.sourceIndex],s=o.position,a=o.normal;a?(i(e.profileVertex,s),i(e.profileNormal,a),e.capPositionOffset=r,e.capNormalOffset=0):(i(e.profileVertex,s),i(e.profileNormal,x),e.capPositionOffset=r,e.capNormalOffset=t);break}}break}case 3:{e.isCap=!0;const t=T(v)?1:-1,r=.5*t,o=(1-(v.subdivision+1)/M)*Math.PI*.5,s=Math.sin(o),a=Math.cos(o),c=g.poleIndices[v.sourceIndex],n=g.poles[c],p=n.position,u=n.normal,x=g.vertices[v.sourceIndex];l(E,x,p),f(E,E,s),u?(m(E,E,p),i(e.profileVertex,E),i(e.profileNormal,u),e.capPositionOffset=r*a,e.capNormalOffset=0):(h(q,E),f(q,q,s),m(E,E,p),i(e.profileVertex,E),i(e.profileNormal,q),e.capPositionOffset=r*a,e.capNormalOffset=t*a);break}default:v.type}}}const S={0:(t,r,o)=>{if(Math.abs(o)<=0)return r;const s=e(Math.cos(.5*o));return n(t,(s-1+1)*r[0],r[1])},1:(r,o,s,a)=>{if(0===Math.abs(s))return o;const i=e(Math.cos(.5*s)),c=t(F,1+(i-1)*a[0]*a[0],(i-1)*a[0]*a[1],(i-1)*a[0]*a[1],1+(i-1)*a[1]*a[1]);return u(r,o,c)}};function T(e){return 1===e.capSide}function w(e,t,r){const o=I(r,t.up),s=I(r,t.right);return O(_,t.up,-s),O(z,t.right,o),v(_,_,z),P(_,_),U(e,t,_),e}function U(e,t,r){n(e,I(r,t.right),I(r,t.up))}const q=b(),E=b(),F=r(),J=b(),_=j(),z=j(),B=j(),G=b(),L=b(),H=b(),K=j(),Q=s(),W={profileVertex:b(),profileNormal:b(),rotationRight:b(),maxDistance:0,capPositionOffset:0,capNormalOffset:0,isCap:!1,frame:new A,frameIndex:0};export{R as PathEvaluator};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{Geometry as t}from"./Geometry.js";class e extends t{constructor(t,e,
|
|
2
|
+
import{Geometry as t}from"./Geometry.js";import{getPathVertexFrameIndex as i}from"./PathVertexInfo.js";class e extends t{constructor(t,i,e,s,r,n){super(t,i,null,0,n),this.path=e,this.geometrySR=s,this.stencilWidth=r}_computePrimitivePositionIndices(){const t=this.attributes.get("pathVertexInfo"),e=this.attributes.get("position");if(t&&e){const s=e.indices,r=t.indices,n=t.data;return r.map(e=>s[i(n[t.stride*e])])}return e?.indices??null}}function s(t){return"path"in t}export{e as PathGeometry,s as isPathGeometry};
|