GetPointDistance
<p><strong>接口名称</strong>:GetPointDistance</p>
<p><strong>接口形式</strong>:DLL</p>
<p><strong>请求方式</strong>:调用<code>WireWrapper</code>的<code>GetPointDistance()</code>方法</p>
<p><strong>接口描述</strong>:无需参数,调用此方法可获取轨迹上不同类型线段之间的平均点间距,单位为毫米(mm)。</p>
<p><strong>返回数据格式</strong>:<code>Dictionary&lt;String, Object&gt;</code></p>
<ul>
<li><strong>ResultFlag</strong> (int):结果标志,用于指示操作是否成功。</li>
<li><strong>ResultMsg</strong> (String):结果消息,包含操作结果的详细描述或错误信息。</li>
<li><strong>Data</strong> (Dictionary<String, Object>):点间距数据字典,包含以下键值对:
<ul>
<li><strong>StraightLinePointDensity</strong> (double):直线段的点间距。</li>
<li><strong>ArcLinePointDensity</strong> (double):圆弧段的点间距。</li>
<li><strong>SharpLinePointDensity</strong> (double):尖角段的点间距。</li>
<li><strong>VerticalLinePointDensity</strong> (double):垂直段的点间距。</li>
<li><strong>TransitionLinePointDensity</strong> (double):过渡段的点间距。</li>
</ul></li>
</ul>
<p><strong>请求参数</strong>:无</p>
<p><strong>调用示例</strong>(伪代码):
```c#
// 假设已经有一个WireWrapper实例wireWrapper,该实例包含轨迹信息
// 调用GetPointDistance方法获取点间距信息
Dictionary<String, Object> pointDistanceInfo = wireWrapper.GetPointDistance();
// 检查返回结果
if ((int)pointDistanceInfo["ResultFlag"] == 1)
{
// 提取点间距数据
Dictionary<String, Object> data = (Dictionary<String, Object>)pointDistanceInfo["Data"];
double straightLineDensity = (double)data["StraightLinePointDensity"];
double arcLineDensity = (double)data["ArcLinePointDensity"];
// ... 处理其他类型的点间距数据 ...
}
else
{
// 处理错误情况
string errorMessage = (string)pointDistanceInfo["ResultMsg"];
Console.WriteLine("获取点间距信息失败: " + errorMessage);
}</p>
<pre><code>
**注意事项**:
* 调用`GetPointDistance()`方法时无需传入任何参数。
* 确保`WireWrapper`实例已经被正确初始化和填充了轨迹数据。
* 返回的`ResultFlag`用于判断操作是否成功。</code></pre>