模型洞
<h1>模型洞</h1>
<h2>概述</h2>
<p>该文档描述了模型洞的各种功能,用于管理和显示3D模型中的洞信息,包括构件的颜色、透明度等自定义属性。</p>
<h2>类及说明</h2>
<h3>1. HoleModelConfig</h3>
<p><strong>描述</strong>: 模型洞配置类</p>
<ul>
<li><strong>构造</strong>: <code>new BCore.Extension.Hole.HoleModelConfig(viewer3D)</code></li>
<li><strong>参数</strong>:
<ul>
<li><code>viewer3D</code>: BCore.Viewer.Viewer3D 实例</li>
</ul></li>
</ul>
<h3>2. HoleModelManager</h3>
<p><strong>描述</strong>: 模型洞管理类</p>
<ul>
<li><strong>构造</strong>: <code>new BCore.Extension.Hole.HoleModelManager(HoleModelConfig)</code></li>
<li><strong>参数</strong>:
<ul>
<li><code>HoleModelConfig</code>: BCore.Extension.Hole.HoleModelConfig 实例</li>
</ul></li>
</ul>
<h3>方法总览</h3>
<p><code>showAllHoleModelByFileID(fileId: string)</code> 显示模型洞信息
<code>hideAllHoleModelByFileID(fileId: string)</code> 隐藏模型洞信息
<code>showComponentsByUuids(elementKeys: Array)</code> 显示构件洞信息
<code>hideComponentsByUuids(elementKeys: Array)</code> 隐藏构件洞信息
<code>setComponentsColorByUuids(elementKeys: Array, color: string)</code> 设置构件颜色
<code>clearComponentsColorByUuids(elementKeys: Array)</code> 恢复构件颜色
<code>setComponentsOpacityByUuids(elementKeys: Array, opacity: number)</code> 设置构件透明度
<code>clearComponentsOpacityByUuids(elementKeys: Array)</code> 恢复构件透明度
<code>clearAllComponentsCustoms()</code>
<code>getAllHideComponents()</code>
<code>getComponentsCustomsColor()</code>
<code>getComponentsCustomsOpacity()</code></p>
<hr />
<h3>方法示例</h3>
<h4>1. 显示/隐藏模型洞信息</h4>
<p><strong>简介</strong>: 根据提供的fileID显示/隐藏对应模型的洞信息</p>
<ul>
<li><strong>接口</strong>:
<code>showAllHoleModelByFileID(fileId: string)</code> 显示模型洞信息
<code>hideAllHoleModelByFileID(fileId: string)</code> 隐藏模型洞信息</li>
<li><strong>参数</strong>:
<ul>
<li><code>fileId</code>: 模型文件ID</li>
</ul></li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">let mHoleConfig = new BCore.Extension.Hole.HoleModelConfig(mViewer3D);
let mHoleModelManger = new BCore.Extension.Hole.HoleModelManager(mHoleConfig);
mHoleModelManger.showAllHoleModelByFileID(fileId);
mHoleModelManger.hideAllHoleModelByFileID(fileId);</code></pre></li>
</ul>
<h4>2. 显示/隐藏构件洞信息</h4>
<p><strong>简介</strong>: 根据构件Uuid列表显示相应构件的洞信息</p>
<ul>
<li><strong>接口</strong>:
<code>showComponentsByUuids(elementKeys: Array)</code> 显示构件洞信息
<code>hideComponentsByUuids(elementKeys: Array)</code> 隐藏构件洞信息</li>
<li><strong>参数</strong>:
<ul>
<li><code>elementKeys</code>: 构件Uuid数组</li>
</ul></li>
<li>
<p><strong>示例</strong>:</p>
<pre><code class="language-javascript">let mHoleConfig = new BCore.Extension.Hole.HoleModelConfig(mViewer3D);
let mHoleModelManger = new BCore.Extension.Hole.HoleModelManager(mHoleConfig);
let uuids = [uuid];
mHoleModelManger.showComponentsByUuids(uuids); //显示构件洞信息
mHoleModelManger.hideComponentsByUuids(uuids); //隐藏构件洞信息</code></pre>
</li>
</ul>
<h4>3. 设置/恢复构件颜色</h4>
<p><strong>简介</strong>: 修改对应构件的显示颜色</p>
<ul>
<li><strong>接口</strong>:
<code>setComponentsColorByUuids(elementKeys: Array, color: string)</code>
根据提供的构件Uuid列表与颜色值,修改对应的构件显示颜色
<code>clearComponentsColorByUuids(elementKeys: Array)</code>
根据提供的构件Uuid列表,恢复构件颜色为默认颜色</li>
<li><strong>参数</strong>:
<ul>
<li><code>elementKeys</code>: 构件Uuid数组</li>
<li><code>color</code>: 构件颜色</li>
</ul></li>
<li>
<p><strong>示例</strong>:</p>
<pre><code class="language-javascript">let mHoleConfig = new BCore.Extension.Hole.HoleModelConfig(mViewer3D);
let mHoleModelManger = new BCore.Extension.Hole.HoleModelManager(mHoleConfig);
let uuids = [uuid];
let color = &#039;#ff0000&#039;; // 示例颜色
mHoleModelManger.setComponentsColorByUuids(uuids, color);
mHoleModelManger.clearComponentsColorByUuids(uuids);</code></pre>
</li>
</ul>
<h3>4. 设置/恢复构件透明度</h3>
<p><strong>简介</strong>: 修改对应构件的显示透明度</p>
<ul>
<li><strong>接口</strong>:
<code>setComponentsOpacityByUuids(elementKeys: Array, opacity: number)</code>
根据提供的构件Uuid列表与透明度,修改对应的构件显示透明度
<code>clearComponentsOpacityByUuids(elementKeys: Array)</code>
根据提供的构件Uuid列表,恢复构件透明度为默认透明度</li>
<li><strong>参数</strong>:
<ul>
<li><code>elementKeys</code>: 构件Uuid数组</li>
<li><code>opacity</code>: 透明度值</li>
</ul></li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">let uuids = [uuid];
let opacity = 0.5;
mHoleModelManger.setComponentsOpacityByUuids(uuids, opacity);
mHoleModelManger.clearComponentsOpacityByUuids(uuids);</code></pre></li>
</ul>
<h4>5. 恢复模型默认配置</h4>
<ul>
<li><strong>接口</strong>: <code>clearAllComponentsCustoms()</code></li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">mHoleModelManger.clearAllComponentsCustoms();</code></pre></li>
</ul>
<h4>6.获取已经隐藏的构件Uuid</h4>
<ul>
<li><strong>接口</strong>: <code>getAllHideComponents()</code></li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">let hiddenComponents = mModelManger.getAllHideComponents();</code></pre></li>
</ul>
<h4>7.获取已经自定义颜色的构件Uuid</h4>
<ul>
<li><strong>接口</strong>: <code>getComponentsCustomsColor()</code></li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">let customizedColors = mHoleModelManger.getComponentsCustomsColor();</code></pre></li>
</ul>
<h4>8.获取已经自定义透明度的构件Uuid</h4>
<ul>
<li>**接口: <code>getComponentsCustomsOpacity()</code></li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">let customizedOpacity = mHoleModelManger.getCustomsOpacity();</code></pre></li>
</ul>
<hr />
<p>该文档提供了洞模块的详细信息,您可以根据需求使用相应的方法进行模型洞信息的管理与操作</p>