剖切
<h1>剖切</h1>
<h2>1. 剖切工具类 - BCore.Extension.Section</h2>
<p>该类具有下列子属性类:</p>
<ul>
<li><code>SectionCBoxonfig</code> : 剖切配置参数</li>
<li><code>SectionBox</code> : 剖切盒方法类</li>
</ul>
<h2>2.方法介绍</h2>
<h3>2.1 BCore.Extension.Section.SectionBoxConfig</h3>
<h4>构造函数</h4>
<pre><code class="language-javascript">new BCore.Extension.Section.SectionBoxConfig(viewer)</code></pre>
<h4>成员变量</h4>
<table>
<thead>
<tr>
<th>成员变量</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>viewer</td>
<td>BCore.Viewer.Viewer3D</td>
<td>视图对象</td>
</tr>
</tbody>
</table>
<h3>2.2 BCore.Extension.Section.SectionBox</h3>
<h4>构造函数</h4>
<pre><code class="language-javascript">new BCore.Extension.Section.SectionBox(config)</code></pre>
<h4>参数</h4>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>config</td>
<td>BCore.Extension.Section.SectionBoxConfig</td>
<td>剖切配置参数</td>
</tr>
</tbody>
</table>
<h4>方法示例</h4>
<ol>
<li>
<p><strong>open()</strong></p>
<ul>
<li>开启剖切</li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">var sectionBoxConfig = new BCore.Extension.Section.SectionBoxConfig(viewer3D);
var sectionBox = new BCore.Extension.Section.SectionBox(sectionBoxConfig);
sectionBox.open();</code></pre></li>
</ul>
</li>
<li>
<p><strong>close()</strong></p>
<ul>
<li>关闭剖切</li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">sectionBox.close();</code></pre></li>
</ul>
</li>
<li>
<p><strong>changeSectionBoxVisible(bool)</strong></p>
<ul>
<li>显隐剖切盒子</li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">sectionBox.changeSectionBoxVisible(false);</code></pre></li>
</ul>
</li>
<li>
<p><strong>setSectionBoxRange(box3)</strong></p>
<ul>
<li>设置剖切盒子的最大最小范围</li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">sectionBox.setSectionBoxRange({min:{x:0, y:0, z:0}, max:{x:100, y:100, z:100}});</code></pre></li>
</ul>
</li>
<li>
<p><strong>getSectionBoxRange()</strong></p>
<ul>
<li>获取剖切盒子的最大最小范围</li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">var rangbox = sectionBox.getSectionBoxRange();</code></pre></li>
</ul>
</li>
<li>
<p><strong>setSectionBox(box3)</strong></p>
<ul>
<li>设置剖切范围</li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">sectionBox.setSectionBox({min:{x, y, z}, max:{x, y, z}});</code></pre></li>
</ul>
</li>
<li>
<p><strong>getSectionBox()</strong></p>
<ul>
<li>获取当前剖切范围</li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">var currentRange = sectionBox.getSectionBox();</code></pre></li>
</ul>
</li>
<li><strong>getSectionState()</strong>
<ul>
<li>获取剖切盒子状态</li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">var state = sectionBox.getSectionState();</code></pre></li>
</ul></li>
</ol>
<h3>返回值说明</h3>
<ul>
<li>所有相关方法的返回值通常为 box3 结构,包括 <code>min</code> 和 <code>max</code> 的坐标值。</li>
</ul>
<p>此文档提供了<code>剖切</code>类及其相关配置和方法的详细说明,可以帮助开发者实现剖切功能。</p>