Integrate compact BIM inspector, measurement editing and shared tooltips
This commit is contained in:
@@ -45,8 +45,8 @@ export function PlannerExperience({worldId,worldSha,runtime,viewport,onVisibilit
|
||||
{visible&&memory?createPortal(<svg className="ai-local-editor__markers" viewBox="0 0 1280 720" preserveAspectRatio="none" aria-label="Память проездов">
|
||||
{memory.attempts.map((attempt,i)=>{const p=projected[i];if(!p)return null;
|
||||
const label=attemptLabel(attempt),color=URBAN_COLORS[attempt.status==="unresolved"?"attempt":"revisited"];
|
||||
return <g key={attempt.id} role="img" aria-label={label} tabIndex={0} style={{pointerEvents:"auto"}}>
|
||||
<title>{label}</title><circle cx={p[0]*1280} cy={p[1]*720} r="7" fill={`rgb(${color.join(",")})`}/>
|
||||
return <g key={attempt.id} role="img" data-nodedc-tooltip={label} aria-label={label} tabIndex={0} style={{pointerEvents:"auto"}}>
|
||||
<circle cx={p[0]*1280} cy={p[1]*720} r="7" fill={`rgb(${color.join(",")})`}/>
|
||||
</g>;
|
||||
})}
|
||||
</svg>,viewport):null}
|
||||
|
||||
@@ -38,21 +38,20 @@ export function SemanticEditOverlay(props:SemanticOverlayProps) {
|
||||
{props.editing&&!props.blocked&&base&&g?<g aria-label="Пивот перемещения">
|
||||
{(["x","y","z"] as const).map(axis=>{const end=g[axis];if(!end)return null;const p=[end[0]*rect.width,end[1]*rect.height],d=Math.hypot(p[0]-base[0],p[1]-base[1]);if(d<12)return null;
|
||||
const ux=(p[0]-base[0])/d,uy=(p[1]-base[1])/d;
|
||||
return <g key={axis} data-semantic-axis={axis} style={{pointerEvents:"stroke",cursor:"move"}}>
|
||||
<title>{`Переместить по ${axis.toUpperCase()}`}</title>
|
||||
return <g key={axis} data-nodedc-tooltip={`Переместить по ${axis.toUpperCase()}`} aria-label={`Переместить по ${axis.toUpperCase()}`} data-semantic-axis={axis} style={{pointerEvents:"stroke",cursor:"move"}}>
|
||||
<line x1={base[0]} y1={base[1]} x2={p[0]} y2={p[1]} stroke="transparent" strokeWidth={18}/>
|
||||
<line x1={base[0]} y1={base[1]} x2={p[0]} y2={p[1]} stroke={g.colors[axis]} strokeWidth={3}/>
|
||||
<path d={`M${p[0]},${p[1]} L${p[0]-ux*12-uy*5},${p[1]-uy*12+ux*5} L${p[0]-ux*12+uy*5},${p[1]-uy*12-ux*5} Z`} fill={g.colors[axis]}/>
|
||||
<text x={p[0]+7} y={p[1]-7} fill={g.colors[axis]} fontSize={12}>{axis.toUpperCase()}</text>
|
||||
</g>;
|
||||
})}
|
||||
<rect data-semantic-axis={props.axis} x={base[0]-7} y={base[1]-7} width={14} height={14} fill={color} stroke="var(--nodedc-glass-panel-bg)" strokeWidth={2} style={{pointerEvents:"all",cursor:"move"}}><title>{`Переместить: ${props.axis.toUpperCase()}`}</title></rect>
|
||||
{chosen[0]&&(isRigidMarking(chosen[0])||selected?.object)?<circle data-semantic-axis="rotate" cx={base[0]} cy={base[1]} r={48} fill="none" stroke={color} strokeWidth={3} style={{pointerEvents:"stroke",cursor:"grab"}}><title>Повернуть элемент в плоскости</title></circle>:null}
|
||||
<rect data-nodedc-tooltip={`Переместить: ${props.axis.toUpperCase()}`} aria-label={`Переместить: ${props.axis.toUpperCase()}`} data-semantic-axis={props.axis} x={base[0]-7} y={base[1]-7} width={14} height={14} fill={color} stroke="var(--nodedc-glass-panel-bg)" strokeWidth={2} style={{pointerEvents:"all",cursor:"move"}}/>
|
||||
{chosen[0]&&(isRigidMarking(chosen[0])||selected?.object)?<circle data-nodedc-tooltip="Повернуть элемент в плоскости" aria-label="Повернуть элемент в плоскости" data-semantic-axis="rotate" cx={base[0]} cy={base[1]} r={48} fill="none" stroke={color} strokeWidth={3} style={{pointerEvents:"stroke",cursor:"grab"}}/>:null}
|
||||
</g>:null}
|
||||
{props.editing&&node&&props.selection.length===1?(["incoming","outgoing"] as const).map(key=>{
|
||||
const a=project(node.point),b=project(curveControlPoint(node,key,handleScale));
|
||||
if(!a||!b||!node[key].some(Boolean))return null;
|
||||
return <g key={key} data-semantic-handle-scale={handleScale}><line x1={a[0]} y1={a[1]} x2={b[0]} y2={b[1]} stroke="var(--nodedc-glass-panel-bg)" strokeWidth={4}/><line x1={a[0]} y1={a[1]} x2={b[0]} y2={b[1]} stroke={color} strokeWidth={1.5}/><circle data-semantic-handle={key} cx={b[0]} cy={b[1]} r={6} fill="var(--nodedc-text-primary)" stroke={color} strokeWidth={2} style={{pointerEvents:"all",cursor:"move"}}><title>Ручка кривой</title></circle></g>;
|
||||
return <g key={key} data-semantic-handle-scale={handleScale}><line x1={a[0]} y1={a[1]} x2={b[0]} y2={b[1]} stroke="var(--nodedc-glass-panel-bg)" strokeWidth={4}/><line x1={a[0]} y1={a[1]} x2={b[0]} y2={b[1]} stroke={color} strokeWidth={1.5}/><circle data-nodedc-tooltip="Ручка кривой" aria-label="Ручка кривой" data-semantic-handle={key} cx={b[0]} cy={b[1]} r={6} fill="var(--nodedc-text-primary)" stroke={color} strokeWidth={2} style={{pointerEvents:"all",cursor:"move"}}/></g>;
|
||||
}):null}
|
||||
</svg>,viewport);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user