166 lines
7.5 KiB
HTML
166 lines
7.5 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Rendering Canvas on Web Service Application | HiAPI-C# 2025 </title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="title" content="Rendering Canvas on Web Service Application | 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 "{query}"">
|
|
<meta name="loc:searchNoResults" content="No results for "{query}"">
|
|
<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="">
|
|
<h1 id="rendering-canvas-on-web-service-application">Rendering Canvas on Web Service Application</h1>
|
|
|
|
<h2 id="overview">Overview</h2>
|
|
<p>In the HiNC-2025-webservice example project, the 3D canvas rendering is handled through a WebSocket-based architecture using SignalR Hub connections.</p>
|
|
<h2 id="core-component">Core Component</h2>
|
|
<p>The primary component for 3D canvas rendering:</p>
|
|
<ul>
|
|
<li><strong>Location</strong>: <code>wwwroot/disp/rendering-canvas.js</code></li>
|
|
<li><strong>Purpose</strong>: Manages all 3D canvas rendering operations</li>
|
|
</ul>
|
|
<h2 id="connection-management">Connection Management</h2>
|
|
<h3 id="signalr-hub-connection">SignalR Hub Connection</h3>
|
|
<ul>
|
|
<li>Components using WebSocket (corresponding to SignalR Hub) receive a unique Hub <code>connectionId</code></li>
|
|
<li>The <code>rendering-canvas</code> component maintains a primary <code>connectionId</code></li>
|
|
<li>This ID serves as the index for all canvas data stream operations</li>
|
|
</ul>
|
|
<h3 id="connection-id-naming-convention">Connection ID Naming Convention</h3>
|
|
<p>In other components, the connection ID may be referenced with different naming patterns:</p>
|
|
<ul>
|
|
<li><code>renderingConnectionId</code></li>
|
|
<li><code>rendering-connectionId</code></li>
|
|
<li>Similar variations</li>
|
|
</ul>
|
|
<h3 id="naming-convention-examples">Naming Convention Examples</h3>
|
|
<p>Different components may reference the connection ID with various naming patterns:</p>
|
|
<ul>
|
|
<li><code>player-panel</code> component: uses <code>renderingConnectionId</code> (<code>wwwroot/player/player-panel.js</code>)</li>
|
|
<li>Other components may use similar variations like <code>rendering-connectionId</code></li>
|
|
</ul>
|
|
<h2 id="data-flow-architecture">Data Flow Architecture</h2>
|
|
<h3 id="frontend-responsibilities">Frontend Responsibilities</h3>
|
|
<ul>
|
|
<li>The <code>rendering-canvas</code> component handles data stream transmission via WebSocket</li>
|
|
<li>Manages real-time rendering updates through the connection ID</li>
|
|
</ul>
|
|
<h3 id="backend-integration">Backend Integration</h3>
|
|
<p>Multiple backend controllers can specify content to be rendered on the <code>rendering-canvas</code>. The architecture is designed to be flexible and reusable across different features.</p>
|
|
<h4 id="example-player-controller">Example: Player Controller</h4>
|
|
<p>One example of backend integration:</p>
|
|
<ul>
|
|
<li><strong>File</strong>: <code>Players/PlayerController.cs</code></li>
|
|
<li><strong>Method</strong>: <code>InitializePlayer</code></li>
|
|
<li><strong>Purpose</strong>: Initializes player-specific rendering content</li>
|
|
</ul>
|
|
<p>This is just one example - any controller in the application can interact with the rendering canvas using the same connection ID mechanism to display different types of 3D content</p>
|
|
<h2 id="key-points">Key Points</h2>
|
|
<ul>
|
|
<li>All canvas data stream operations are indexed by the connection ID</li>
|
|
<li>The WebSocket connection enables real-time rendering updates</li>
|
|
<li>The architecture separates rendering logic (frontend) from content specification (backend)</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>
|