@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.64 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{d as e,f as t,q as i}from"../../../../chunks/vec32.js";import{clone as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{VerticalPlaneConstraint as s}from"../../sketch/constraints.js";import{fromVec3 as n}from"../../sketch/normalizedPoint.js";import{SnappingDomain as a}from"../SnappingDomain.js";import{LineSegmentHintType as f}from"../snappingUtils.js";import{SnappingCandidate as o}from"./SnappingCandidate.js";import{LineSnappingHint as d}from"../hints/LineSnappingHint.js";import{ParallelSnappingHint as h}from"../hints/ParallelSnappingHint.js";class g extends o{constructor({referenceLine:i,lineStart:f,targetPoint:o,isDraped:d}){const h=r(f),{left:g,right:p}=i;e(h,t(h,h,p),g),super(o,new s(f,n(h)),d,a.SELF),this._referenceLines=[{edge:i,fadeLeft:!0,fadeRight:!0}]}get hints(){return[new d(f.TARGET,this.constraint.start,this.targetPoint,this.isDraped,this.domain),new h(this.constraint.start,this.targetPoint,this.isDraped,this.domain),...this._referenceLines.map((e=>new d(f.REFERENCE,e.edge.left,e.edge.right,this.isDraped,this.domain,e.fadeLeft,e.fadeRight)))]}addReferenceLine(e){const t={edge:e,fadeLeft:!0,fadeRight:!0};this._referenceLines.forEach((r=>{i(e.right,r.edge.left)&&(r.fadeLeft=!1,t.fadeRight=!1),i(e.right,r.edge.right)&&(r.fadeRight=!1,t.fadeRight=!1),i(e.left,r.edge.right)&&(r.fadeRight=!1,t.fadeLeft=!1),i(e.left,r.edge.left)&&(r.fadeLeft=!1,t.fadeLeft=!1)})),this._referenceLines.push(t)}}export{g as ParallelLineSnappingCandidate};