UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.46 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import e from"../../../../Color.js";import"../../../../core/has.js";import{pt2px as n}from"../../../../core/screenUtils.js";import{fromValues as r,fromArray as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isExtrudeSymbol3DLayer as o,isFillSymbol3DLayer as i}from"./layerUtils.js";import{Transparency as s}from"../../webgl-engine/lib/edgeRendering/interfaces.js";import{EdgeType as l}from"../../webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js";function c(e){return e&&e.enabled&&(o(e)||i(e))&&null!=e.edges}function u(e){return e&&e.enabled&&e.edges||null}function a(e,n){return f(u(e),n)}function f(o,i){if(null==o)return null;const s=null!=o.color?t(e.toUnitRGBA(o.color)):r(0,0,0,0),l=n(o.size),c=n(o.extensionLength);switch(o.type){case"solid":return g({color:s,size:l,extensionLength:c,...i});case"sketch":return p({color:s,size:l,extensionLength:c,...i});default:return}}function g(e){return{...m,...e,type:l.Solid}}function p(e){return{...d,...e,type:l.Sketch}}const m={color:r(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:s.OPAQUE,hasSlicePlane:!1},d={color:r(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:s.OPAQUE,hasSlicePlane:!1};export{a as createMaterial,f as createMaterialFromEdges,g as createSolidEdgeMaterial,c as hasEdges};