动态流线效果
<h1>动态流线效果</h1>
<h2>类说明</h2>
<p><code>BCore.Extension.StreamLine</code> 动态流线对象。</p>
<p><code>BCore.Extension.StreamLineConfig</code> 流线配置参数。</p>
<p><code>BCore.Extension.StreamLineManager</code> 动态流线管理工具。</p>
<p><code>BCore.Extension.StreamLineManagerConfig</code> 管理工具配置参数。</p>
<hr />
<h2>BCore.Extension.StreamLine</h2>
<h3>构造</h3>
<pre><code class="language-javascript">new BCore.Extension.StreamLine(config)</code></pre>
<h3>参数</h3>
<table>
<thead>
<tr>
<th>参数名</th>
<th></th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>config</td>
<td>BCore.Extension.StreamLineConfig</td>
<td>流线配置参数</td>
</tr>
</tbody>
</table>
<hr />
<h2>BCore.Extension.StreamLineConfig</h2>
<h3>构造</h3>
<pre><code class="language-javascript">new BCore.Extension.StreamLineConfig()</code></pre>
<h3>成员</h3>
<table>
<thead>
<tr>
<th>成员变量</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>String</td>
<td>标签名称,全局唯一</td>
</tr>
<tr>
<td>points</td>
<td>Array</td>
<td>动态流线管道路径点集</td>
</tr>
<tr>
<td>number</td>
<td>number</td>
<td>管道渲染切片数量</td>
</tr>
<tr>
<td>radius</td>
<td>number</td>
<td>动态流线管道半径</td>
</tr>
<tr>
<td>radiusSegments</td>
<td>number</td>
<td>管道半径切片数量</td>
</tr>
<tr>
<td>closed</td>
<td>bool</td>
<td>终点是否闭环</td>
</tr>
<tr>
<td>repeatNum</td>
<td>number</td>
<td>颜色重复次数</td>
</tr>
<tr>
<td>offsetspeed</td>
<td>number</td>
<td>流线移动速度,正负分别为不同方向</td>
</tr>
<tr>
<td>color1</td>
<td>String</td>
<td>渐变颜色1</td>
</tr>
<tr>
<td>color2</td>
<td>String</td>
<td>渐变颜色2</td>
</tr>
</tbody>
</table>
<h3>示例</h3>
<pre><code class="language-javascript">var streamConfig = new BCore.Extension.StreamLineConfig();
streamConfig.points = [{x:0,y:0,z:9},{x:0,y:12,z:9},{x:0,y:12,z:12},{x:-2,y:12,z:12}];
streamConfig.number = 100;
streamConfig.radius = 0.2;
streamConfig.radiusSegments = ;
streamConfig.closed = false;
streamConfig.repeatNum = 4streamConfig.offsetspeed = -0.01;
streamConfig.color1 = '#0FCAFF';
streamConfig.color2 = '#0F0CD5';
var streamline = new BCore.Extension.StreamLine(streamConfig);</code></pre>
<hr />
<h2>BCore.Extension.StreamLineManagerConfig</h2>
<h3>构造</h3>
<pre><code class="language-javascript">new BCore.Extension.StreamLineManagerConfig(Viewer3D)</code></pre>
<h3>参数</h3>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>viewer3D</td>
<td>BCore.Viewer.Viewer3D</td>
<td>三维模型视图对象</td>
</tr>
</tbody>
</table>
<hr />
<h2>BCore.Extension.StreamLineManager</h2>
<h3>构造</h3>
<pre><code class="language-javascript">new BCore.Extension.StreamLineManager(config)</code></pre>
<h3>参数</h3>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>config</td>
<td>BCore.Extension.StreamLineManagerConfig</td>
<td>管理工具配置参数</td>
</tr>
</tbody>
</table>
<h3>功能接口</h3>
<h4>添加动态流线</h4>
<ul>
<li><strong>简要描述</strong>:添加动态流线</li>
<li><strong>接口</strong>:<code>addStreamLine(name, streamline)</code></li>
</ul>
<table>
<thead>
<tr>
<th>参数</th>
<th>必选</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>是</td>
<td>string</td>
<td>名称</td>
</tr>
<tr>
<td>streamline</td>
<td>是</td>
<td>BCore.Extension.StreamLine</td>
<td>动态流线对象</td>
</tr>
</tbody>
</table>
<h5>示例</h5>
<pre><code class="language-javascript">var streamConfig1 = new BCore.Extension.StreamLineConfig();
streamConfig1.points = [{x:0,y:0,z:9},{x:0,y:3,z:9},{x:0,y:3,z:12},{x:-2,y:3,z:12},{x:-2,y:10,z:12}];
var streamline1 = new BCore.Extension.StreamLine(streamConfig1);
var streamLineManagerConfig = new BCore.Extension.StreamLineManagerConfig(mViewer3D);
var StreamLineManager= new BCore.Extension.StreamLineManager();
StreamLineManager.addStreamLine(&quot;SL1&quot;,streamline1);</code></pre>
<h4>移除动态流线</h4>
<ul>
<li><strong>简要描述</strong>:移除动态流线</li>
<li><strong>接口</strong>:<code>removeStreamLine(name)</code></li>
</ul>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>是</td>
<td>string</td>
<td>名称</td>
</tr>
</tbody>
</table>
<h5>示例</h5>
<pre><code class="language-javascript">var streamConfig2 = new BCore.Extension.StreamLineConfig();
streamConfig2.points= [{x:0,y:0,z:5},{x:0,y:3,z:5},{x:0,y:3,z:8},{x:-2,y:3,z:8},{x:-2,y:10,z:8}];
var streamline2 = new BCore.Extension.StreamLine(streamConfig2);
StreamLineManager.addStreamLine(&quot;SL2&quot;,streamline2);
StreamLineManager.removeStreamLine(&quot;SL2&quot;);</code></pre>
<h4>清除所有动态流线</h4>
<ul>
<li><strong>简要描述</strong>:清除所有动态流线</li>
<li><strong>接口</strong>:<code>clearAllStreamLine()</code></li>
</ul>
<h5>示例</h5>
<pre><code class="language-javascript">StreamLineManager.addStreamLine(&quot;SL1&quot;,streamline);
StreamLineManager.addStreamLine(&quot;SL2&quot;,streamline2);
StreamLineManager.clearAllStreamLine();</code></pre>
<hr />
<p>以上文档概述了 <code>动态流线</code> 及其相关类的使用方法和示例。通过这些构造函数和方法,用户可以轻松创建、管理和操作动态流线对象。</p>