This commit is contained in:
2026-09-09 17:35:23 +08:00
parent 2a98ae7556
commit 161af68fe3
1271 changed files with 58251 additions and 98639 deletions
@@ -0,0 +1,184 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Box3d Control | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Box3d Control | HiAPI-C# 2025 ">
<link rel="icon" href="../../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../../public/docfx.min.css">
<link rel="stylesheet" href="../../public/main.css">
<meta name="docfx:navrel" content="../../toc.html">
<meta name="docfx:tocrel" content="toc.html">
<meta name="docfx:rel" content="../../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../../index.html">
<img id="logo" class="svg" src="../../img/HiAPI.logo.png" alt="">
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="Anatomy-Box3dControl">
<h1 id="box3d-control">Box3d Control</h1>
<p>The Box3d editor edits an axis-aligned <a class="xref" href="../../api/Hi.Geom.Box3d.html">Box3d</a> through four vector rows — Min, Max,
Dimension and Center — of which an <strong>Edit Mode</strong> selector decides which two are writable. It is
reached wherever a Geometry slot admits the <code>Box3d</code> kind: a Control-Tree kind node under a Geometry
slot, or the geometry switchboard embedded inline.</p>
<h2 id="layout">Layout</h2>
<ul>
<li><strong>Edit Mode</strong> — a selector over three modes. Its internal values are <code>MinMax</code>, <code>MinDimension</code> and
<code>CenterDimension</code>; the web labels them &ldquo;Min / Max&rdquo;, &ldquo;Min + Dimension&rdquo; and &ldquo;Center + Dimension&rdquo;,
the desktop client &ldquo;Min and Max&rdquo;, &ldquo;Min and Dimension&rdquo; and &ldquo;Center and Dimension&rdquo;.</li>
<li><strong>Min</strong>, <strong>Max</strong>, <strong>Dimension</strong>, <strong>Center</strong> — four vector rows, one X / Y / Z input each. The web
captions Dimension &ldquo;Dimension (Max − Min)&rdquo; and Center &quot;Center ((Max + Min) / 2)&quot;; the Min and Max
captions come from the shared label set rather than the geometry one.</li>
</ul>
<p>The mode rules each row read-only or editable rather than showing a different set of rows: Min is
read-only in Center + Dimension, Max in anything but Min / Max, Dimension in Min / Max, and Center
in anything but Center + Dimension.</p>
<h2 id="key-model">Key Model</h2>
<p>Only <a class="xref" href="../../api/Hi.Geom.Box3d.html#Hi_Geom_Box3d_Min">Min</a> and <a class="xref" href="../../api/Hi.Geom.Box3d.html#Hi_Geom_Box3d_Max">Max</a> are settable on the type;
<a class="xref" href="../../api/Hi.Geom.Box3d.html#Hi_Geom_Box3d_Dim">Dim</a> and <a class="xref" href="../../api/Hi.Geom.Box3d.html#Hi_Geom_Box3d_Center">Center</a> are derived and get-only. That is why the
other two modes are arithmetic over the same two stored corners rather than a different storage
shape — and on the web that arithmetic happens in the browser, which then posts the resulting Min
and Max.</p>
<h2 id="behavior">Behavior</h2>
<ul>
<li><strong>A row commits on blur or Enter, not per keystroke.</strong> The vector widget emits only from its blur
handlers, suppresses the emit when the parsed value is unchanged, and reverts an unparseable entry
to its previous value.</li>
<li><strong>The web editor has no read-only variant.</strong> The desktop control additionally carries an
<code>IsInfoMode</code> property that a host sets to turn the whole control into a display: every field goes
read-only and the Edit Mode selector is hidden outright. Two hosts use it, the STL file control and
the geometry combination control. The web equivalent is not this editor — the STL file editor draws
its own read-only bounding-box rows.</li>
<li><strong>Four endpoints ship without a caller.</strong> The controller exposes <code>UpdateByMinDimension</code>,
<code>UpdateByCenterDimension</code>, <code>IndexDimension</code> and <code>IndexCenter</code>; the shipped SPA calls none of them,
because the editor resolves every mode to a plain <code>Update</code>.</li>
</ul>
<h2 id="source-code-path">Source Code Path</h2>
<p>See <a class="xref" href="../index.html">HiNC App Anatomy</a> for git repository links.</p>
<p>HiNC-2025-webservice (Quasar CLI SPA):</p>
<ul>
<li><code>wwwroot-src/src/components/geom/Box3dEditor.vue</code> — the editor: the Edit Mode selector, the four
vector rows and their per-mode read-only rules, and the client-side arithmetic behind the two
derived modes. Its only prop is the IndexService key.</li>
<li><code>wwwroot-src/src/components/widgets/Vec3Input.vue</code> — the X / Y / Z row widget, in standard or
single-field text mode; its <code>readonly</code> prop is what the edit mode drives.</li>
<li><code>wwwroot-src/src/components/geom/geometryEditors.ts</code> — maps the <code>Box3d</code> kind to this editor, the
single map both the switchboard and the Control Tree resolve through.</li>
<li><code>wwwroot-src/src/components/geom/GeometryEditor.vue</code> — the kind picker that creates a Box3d and,
outside selector-only mode, embeds this editor beneath itself.</li>
<li><code>wwwroot-src/src/components/controlTree/itemTypes.ts</code> — registers <code>Box3d</code> against the sole-editor
panel and lists it among the kinds a container may hold.</li>
<li><code>wwwroot-src/src/components/controlTree/SoleEditorPanel.vue</code> — the kind node's panel, resolving
<code>Box3d</code> through the kind map and binding the editor to the node's key.</li>
<li><code>wwwroot-src/src/components/controlTree/GeometrySlotPanel.vue</code> — the Geometry slot's picker, from
which a Box3d is chosen.</li>
<li><code>wwwroot-src/src/api/geometry.ts</code> — <code>getBox3d</code>, <code>indexBox3dMin</code>, <code>indexBox3dMax</code> and the create
entry. There is deliberately no update wrapper here; the editor posts the update itself.</li>
<li><code>wwwroot-src/src/i18n/en/geom.ts</code> — the <code>box.*</code> and <code>bounds.*</code> strings, and
<code>wwwroot-src/src/i18n/en/common.ts</code> — the shared Min and Max row captions.</li>
<li><code>Geom/Box3dController.cs</code> — REST endpoints at <code>/api/Box3d/*</code>: <code>New</code>, <code>NewWithValue</code>, <code>Get</code>,
<code>Update</code>, <code>IndexMin</code>, <code>IndexMax</code>, <code>IndexDimension</code>, <code>IndexCenter</code>, <code>UpdateByMinDimension</code> and
<code>UpdateByCenterDimension</code>.</li>
<li><code>Common/IndexService.cs</code> — the keyed object store every box key resolves against.</li>
</ul>
<h2 id="see-also">See Also</h2>
<ul>
<li><a href="geom-manage-control.html">Geometry Management Panel</a> — the switchboard that offers this kind and
hosts this editor</li>
</ul>
</article>
<div class="contribution d-print-none">
</div>
<div class="next-article d-print-none border-top" id="nextArticle"></div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
</div>
</div>
</footer>
</body>
</html>