PclViewer.WpfControl 1.0.2

dotnet add package PclViewer.WpfControl --version 1.0.2
                    
NuGet\Install-Package PclViewer.WpfControl -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PclViewer.WpfControl" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PclViewer.WpfControl" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="PclViewer.WpfControl" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PclViewer.WpfControl --version 1.0.2
                    
#r "nuget: PclViewer.WpfControl, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PclViewer.WpfControl@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PclViewer.WpfControl&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=PclViewer.WpfControl&version=1.0.2
                    
Install as a Cake Tool

PclViewer.WpfControl

一个基于原生渲染的点云查看 WPF 控件库,支持多路点云渲染和交互操作。

功能特性

  • 高性能渲染:基于原生 C++ 渲染引擎,支持大规模点云实时渲染
  • 多路点云支持:可同时渲染多个点云,每个点云独立管理
  • 交互操作:支持鼠标旋转、平移、缩放等相机控制
  • 灵活的数据接口:支持托管数组(XYZ+RGBA)和非托管指针(Strided)两种数据上传方式
  • 方向指示器:内置 3D 方向指示器,方便空间定位
  • WPF 集成:纯 WPF 控件,易于集成到现有 WPF 应用中

安装

通过 NuGet 包管理器安装:

dotnet add package PclViewer.WpfControl

API 概述

方法 说明
LoadExampleScene() 加载示例场景
AddGeneratedCloud() 添加随机生成的点云
AddCloudStrided(...) 添加 strided 格式点云(适用于原生指针数据),返回 cloudId
AddCloudXYZRGBA(...) 添加 XYZ+RGBA 数组点云(适用于托管数组),返回 cloudId
RemoveCloud(cloudId) 移除指定 ID 的点云
ClearClouds() 清除所有点云
ResetCamera() 重置相机视角
SetOrientationWidgetVisible(bool) 设置方向指示器可见性

示例程序

完整的示例程序请参考:PclViewer.PclSharpExample

注意事项

  • 本控件依赖原生 DLL(PclViewer.Native.dll),请确保该 DLL 在应用程序输出目录或系统路径中
  • 控件仅支持 Windows 平台(WPF)

双显卡电脑特别注意

在双显卡(NVIDIA 独显 + 集成显卡)的电脑上,为确保渲染正确,需要在 App.xaml.cs 中添加以下代码来强制加载 NVIDIA API:

using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;

public partial class App : Application
{
    [DllImport("nvapi64.dll", EntryPoint = "fake")]
    static extern int LoadNvApi64();

    [DllImport("nvapi32.dll", EntryPoint = "fake")]
    static extern int LoadNvApi32();

    protected override void OnStartup(StartupEventArgs e)
    {
        try
        {
            if (Environment.Is64BitProcess)
            {
                LoadNvApi64();
            }
            else
            {
                LoadNvApi32();
            }
        }
        catch (Exception ex)
        {
            Debug.WriteLine(ex);
        }
        base.OnStartup(e);
    }
}

许可证

MIT License

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 104 4/28/2026
1.0.1 100 4/26/2026
1.0.1-preview.1 59 4/16/2026
1.0.0 113 4/13/2026