静态变量
<p>提供的是 <code>BCore.Static</code> 类及其成员的详尽说明。以下是对这些成员的简要总结和示例,方便您理解如何在代码中使用它们。</p>
<h3>BCore.Static</h3>
<p><code>BCore.Static</code> 包含多个子类,主要用于配置3D视图相关的参数,如抗锯齿、相机类型、视图类型等。</p>
<h3>1. 成员变量</h3>
<ul>
<li><strong>AntialiasLevel</strong>:抗锯齿等级</li>
<li><strong>CameraType</strong>:相机类型</li>
<li><strong>CameraOperaType</strong>:相机操作类型</li>
<li><strong>ViewType</strong>:视图类型</li>
<li><strong>RenderThemeType</strong>:渲染风格</li>
<li><strong>DataType</strong>:数据类型</li>
<li><strong>MeasureType</strong>:测量类型</li>
<li><strong>PostilType</strong>:标注类型</li>
</ul>
<h3>2. 示例用法</h3>
<h4>2.1 抗锯齿等级 - AntialiasLevel</h4>
<p>抗锯齿等级为枚举类型,枚举值如下:</p>
<table>
<thead>
<tr>
<th>属性名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>SMOOTH</td>
<td>number</td>
<td>平滑</td>
</tr>
<tr>
<td>EQUILIBRIUM</td>
<td>number</td>
<td>均衡</td>
</tr>
<tr>
<td>HIGHT</td>
<td>number</td>
<td>画质</td>
</tr>
</tbody>
</table>
<pre><code class="language-javascript">//设置抗锯齿等级为:画质
mViewer3D.setAntialiasLevel(BCore.Static.AntialiasLevel.HIGHT);</code></pre>
<p><br></p>
<h4>2.2 相机类型 - CameraType</h4>
<p>相机类型可选择<code>正交</code>或<code>透视</code>,如下所示:</p>
<table>
<thead>
<tr>
<th>属性名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>OrthographicCamera</td>
<td>string</td>
<td>正交相机</td>
</tr>
<tr>
<td>PerspectiveCamera</td>
<td>string</td>
<td>透视相机</td>
</tr>
</tbody>
</table>
<pre><code class="language-javascript">//设置相机类型为正交相机
mViewer3D.setCameraType(BCore.Static.CameraType.OrthographicCamera);</code></pre>
<p><br></p>
<h4>2.3 相机操作类型 - CameraOperaType</h4>
<p>用户可根据操作习惯,切换相机的操作类型(鼠标左键、滚轮及右键对应的响应事件),如下所示:</p>
<table>
<thead>
<tr>
<th>属性名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>DEFAULT</td>
<td>number</td>
<td>默认操作习惯</td>
</tr>
<tr>
<td>REVIT</td>
<td>number</td>
<td>Revit操作习惯</td>
</tr>
</tbody>
</table>
<pre><code class="language-javascript">//设置相机操作类型为:Revit
mViewer3D.setCameraControlType(BCore.Static.CameraOperaType.REVIT);</code></pre>
<p><br></p>
<h4>2.4 视图类型 - ViewType</h4>
<p>图形引擎可通过API设置当前相机的视图类型,目前已支持的视图方向如下所示:</p>
<table>
<thead>
<tr>
<th>属性名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>Home</td>
<td>string</td>
<td>主视图</td>
</tr>
<tr>
<td>Bottom</td>
<td>string</td>
<td>下视图</td>
</tr>
<tr>
<td>Top</td>
<td>string</td>
<td>上视图</td>
</tr>
<tr>
<td>Right</td>
<td>string</td>
<td>右视图</td>
</tr>
<tr>
<td>Left</td>
<td>string</td>
<td>左视图</td>
</tr>
<tr>
<td>Back</td>
<td>string</td>
<td>后视图</td>
</tr>
<tr>
<td>Front</td>
<td>string</td>
<td>前视图</td>
</tr>
<tr>
<td>LeftFrontTop</td>
<td>string</td>
<td>左前上交点视图</td>
</tr>
<tr>
<td>LeftFrontBottom</td>
<td>string</td>
<td>左前下交点视图</td>
</tr>
<tr>
<td>RightFrontTop</td>
<td>string</td>
<td>前视图</td>
</tr>
<tr>
<td>RightFrontBottom</td>
<td>string</td>
<td>右前上交点视图</td>
</tr>
<tr>
<td>LeftBackTop</td>
<td>string</td>
<td>左后上交点视图</td>
</tr>
<tr>
<td>LeftBackBottom</td>
<td>string</td>
<td>左后下交点视图</td>
</tr>
<tr>
<td>RightBackTop</td>
<td>string</td>
<td>左后上交点视图</td>
</tr>
<tr>
<td>RightBackBottom</td>
<td>string</td>
<td>左后下交点视图</td>
</tr>
</tbody>
</table>
<pre><code class="language-javascript">//设置视图为上视图
mViewer3D.setView(BCore.Static.ViewType.Top);</code></pre>
<p><br></p>
<h4>2.5 渲染风格 - RenderThemeType</h4>
<p>图形引擎可通过API设置当前的渲染风格,如下所示:</p>
<table>
<thead>
<tr>
<th>属性名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>Default</td>
<td>string</td>
<td>默认</td>
</tr>
<tr>
<td>Technology</td>
<td>string</td>
<td>科技</td>
</tr>
<tr>
<td>Sketch</td>
<td>string</td>
<td>草图</td>
</tr>
</tbody>
</table>
<pre><code class="language-javascript">//修改渲染风格为科技风
mViewer3D.changeRendererThemeStyle(BCore.Static.RenderThemeType.Technology);</code></pre>
<h4>2.6 数据类型 - DataType</h4>
<table>
<thead>
<tr>
<th>属性名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>External</td>
<td>string</td>
<td>外部模型</td>
</tr>
<tr>
<td>Component</td>
<td>string</td>
<td>BIM构件</td>
</tr>
<tr>
<td>Volume</td>
<td>string</td>
<td>体量模型</td>
</tr>
<tr>
<td>Space</td>
<td>string</td>
<td>空间构件</td>
</tr>
<tr>
<td>FBX</td>
<td>string</td>
<td>FBX模型</td>
</tr>
</tbody>
</table>
<h4>2.7 测量类型 - MeasureType</h4>
<table>
<thead>
<tr>
<th>属性名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>Length</td>
<td>number</td>
<td>直线距离(自由绘制)</td>
</tr>
<tr>
<td>LineLength</td>
<td>number</td>
<td>直线距离(线段捕捉)</td>
</tr>
<tr>
<td>MinLength</td>
<td>number</td>
<td>构件间最短距离</td>
</tr>
<tr>
<td>Angle</td>
<td>number</td>
<td>角度</td>
</tr>
<tr>
<td>Area</td>
<td>number</td>
<td>面积(面片捕捉)</td>
</tr>
<tr>
<td>DrawArea</td>
<td>number</td>
<td>面积(自由绘制)</td>
</tr>
<tr>
<td>Volume</td>
<td>number</td>
<td>体积</td>
</tr>
<tr>
<td>DrawVolume</td>
<td>number</td>
<td>体积(填挖方)</td>
</tr>
<tr>
<td>FaceDistance</td>
<td>number</td>
<td>两面中心法线交点</td>
</tr>
<tr>
<td>Height</td>
<td>number</td>
<td>标高</td>
</tr>
</tbody>
</table>
<h4>2.8 标注类型 - PostilType</h4>
<table>
<thead>
<tr>
<th>属性名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>REACT</td>
<td>string</td>
<td>矩形</td>
</tr>
<tr>
<td>FONT</td>
<td>string</td>
<td>文字</td>
</tr>
<tr>
<td>LINE</td>
<td>string</td>
<td>线条</td>
</tr>
<tr>
<td>ARROWHEAD</td>
<td>string</td>
<td>箭头</td>
</tr>
<tr>
<td>ELLIPSE</td>
<td>string</td>
<td>椭圆</td>
</tr>
<tr>
<td>SELECT</td>
<td>string</td>
<td>选择</td>
</tr>
<tr>
<td>DEL</td>
<td>string</td>
<td>删除</td>
</tr>
</tbody>
</table>
<h3>结论</h3>
<p>通过上述示例,您可以利用 <code>BCore.Static</code> 的不同成员变量来配置自己的3D视图。如果您需要更具体的信息或有其他问题,请联系我们~</p>