Unify viewport glass and professional BIM controls
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
MousePointer2,
|
||||
Ruler,
|
||||
Slice,
|
||||
Focus,
|
||||
createLucideIcon,
|
||||
Glasses,
|
||||
Cuboid,
|
||||
Move,
|
||||
CirclePlus,
|
||||
Box,
|
||||
@@ -73,13 +73,25 @@ import {
|
||||
type LucideProps,
|
||||
} from "lucide-react";
|
||||
|
||||
// CAD vocabulary: dimension line, cutting plane and unframed information glyph.
|
||||
const DimensionLine = createLucideIcon('DimensionLine', [
|
||||
['path', {d:'M4 5v14M20 5v14M4 12h16M8 9l-4 3 4 3M16 9l4 3-4 3',key:'dimension'}],
|
||||
]);
|
||||
const SectionPlane = createLucideIcon('SectionPlane', [
|
||||
['path', {d:'m5 7 7-4 7 4v10l-7 4-7-4V7m0 0 7 4 7-4M12 11v10',key:'model'}],
|
||||
['path', {d:'m2 12 10-5 10 5-10 5-10-5Z',key:'plane'}],
|
||||
]);
|
||||
const InformationPlain = createLucideIcon('InformationPlain', [
|
||||
['path', {d:'M12 4h.01M10 9h2v11M9 20h6',key:'information'}],
|
||||
]);
|
||||
const icons = {
|
||||
"add-point": CirclePlus,
|
||||
ruler: Ruler,
|
||||
section: Slice,
|
||||
isolate: Focus,
|
||||
perspective: Box,
|
||||
orthographic: Scan,
|
||||
ruler: DimensionLine,
|
||||
section: SectionPlane,
|
||||
isolate: Glasses,
|
||||
perspective: Cuboid,
|
||||
orthographic: Box,
|
||||
"fit-view": Scan,
|
||||
select: MousePointer2,
|
||||
move: Move,
|
||||
pen: PenTool,
|
||||
@@ -116,6 +128,7 @@ const icons = {
|
||||
image: Image,
|
||||
inbox: Inbox,
|
||||
info: Info,
|
||||
"info-plain": InformationPlain,
|
||||
key: KeyRound,
|
||||
layers: Layers,
|
||||
list: ListChecks,
|
||||
|
||||
@@ -4,7 +4,7 @@ export interface NavigationCubeProps {
|
||||
/** Camera world quaternion, Y up. Directions point from target toward camera. */
|
||||
quaternion: readonly [number,number,number,number];
|
||||
onSelect: (direction:CubeDirection)=>void;
|
||||
size?:number; face?:string; text?:string; edge?:string; hover?:string; hoverText?:string; opacity?:number; edgeOpacity?:number;
|
||||
size?:number; face?:string; text?:string; edge?:string; hover?:string; hoverText?:string; opacity?:number; edgeOpacity?:number; faceOpacity?:number;
|
||||
disabled?:boolean;
|
||||
label?:string;
|
||||
}
|
||||
@@ -42,9 +42,9 @@ export function cubeRegions(quaternion:NavigationCubeProps["quaternion"]) {
|
||||
});
|
||||
}
|
||||
/** BIM-style face / edge / corner navigation, independent of the scene engine. */
|
||||
export function NavigationCube({quaternion,onSelect,disabled=false,label="Навигационный куб",size=66,face,text,edge,hover:highlight,hoverText,opacity=1,edgeOpacity=1}:NavigationCubeProps) {
|
||||
export function NavigationCube({quaternion,onSelect,disabled=false,label="Навигационный куб",size=66,face,text,edge,hover:highlight,hoverText,opacity=1,edgeOpacity=1,faceOpacity=1}:NavigationCubeProps) {
|
||||
const [hover,setHover]=useState<string|null>(null);
|
||||
return <svg className="nodedc-navigation-cube" style={{width:size,height:size,opacity,"--cube-face":face,"--cube-text":text,"--cube-edge":edge,"--cube-edge-opacity":edgeOpacity,"--cube-hover":highlight,"--cube-hover-text":hoverText} as CSSProperties} viewBox="0 0 120 120" role="group" aria-label={label}>
|
||||
return <svg className="nodedc-navigation-cube" style={{width:size,height:size,opacity,"--cube-face":face,"--cube-face-opacity":faceOpacity,"--cube-text":text,"--cube-edge":edge,"--cube-edge-opacity":edgeOpacity,"--cube-hover":highlight,"--cube-hover-text":hoverText} as CSSProperties} viewBox="0 0 120 120" role="group" aria-label={label}>
|
||||
{cubeRegions(quaternion).map(r=><g key={r.id} role="button" aria-label={`Ракурс: ${r.label}`} aria-disabled={disabled}
|
||||
tabIndex={disabled?-1:0} className={hover===r.label?"is-hovered":""}
|
||||
onPointerEnter={()=>setHover(r.label)} onPointerLeave={()=>setHover(null)}
|
||||
|
||||
Reference in New Issue
Block a user