AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
SpatialUnderstandingDllTopology.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using UnityEngine;
5 using System.Collections;
6 using System.Runtime.InteropServices;
7 using System;
8 using System.Collections.Generic;
9 
10 namespace HoloToolkit.Unity
11 {
16  public static class SpatialUnderstandingDllTopology
17  {
22  [StructLayout(LayoutKind.Sequential, Pack = 1)]
23  public struct TopologyResult
24  {
25  public Vector3 position;
26  public Vector3 normal;
27  public float width;
28  public float length;
29  };
30 
31  // Functions
42  // Queries (topology)
43  [DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
44  public static extern int QueryTopology_FindPositionsOnWalls(
45  [In] float minHeightOfWallSpace,
46  [In] float minWidthOfWallSpace,
47  [In] float minHeightAboveFloor,
48  [In] float minFacingClearance,
49  [In] int locationCount, // Pass in the space allocated in locationData
50  [In, Out] IntPtr locationData); // TopologyResult
51 
62  [DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
63  public static extern int QueryTopology_FindLargePositionsOnWalls(
64  [In] float minHeightOfWallSpace,
65  [In] float minWidthOfWallSpace,
66  [In] float minHeightAboveFloor,
67  [In] float minFacingClearance,
68  [In] int locationCount, // Pass in the space allocated in locationData
69  [In, Out] IntPtr locationData); // TopologyResult
70 
76  [DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
77  public static extern int QueryTopology_FindLargestWall(
78  [In, Out] IntPtr wall); // TopologyResult
79 
88  [DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
89  public static extern int QueryTopology_FindPositionsOnFloor(
90  [In] float minLengthOfFloorSpace,
91  [In] float minWidthOfFloorSpace,
92  [In] int locationCount, // Pass in the space allocated in locationData
93  [In, Out] IntPtr locationData); // TopologyResult
94 
101  [DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
102  public static extern int QueryTopology_FindLargestPositionsOnFloor(
103  [In] int locationCount, // Pass in the space allocated in locationData
104  [In, Out] IntPtr locationData); // TopologyResult
105 
115  [DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
116  public static extern int QueryTopology_FindPositionsSittable(
117  [In] float minHeight,
118  [In] float maxHeight,
119  [In] float minFacingClearance,
120  [In] int locationCount, // Pass in the space allocated in locationData
121  [In, Out] IntPtr locationData); // TopologyResult
122 
133  [DllImport("SpatialUnderstanding")]
134  public static extern int QueryTopology_FindLargePositionsSittable(
135  [In] float minHeight,
136  [In] float maxHeight,
137  [In] float minFacingClearance,
138  [In] float minWidth,
139  [In] int locationCount, // Pass in the space allocated in locationData
140  [In, Out] IntPtr locationData); // TopologyResult
141  }
142 
143 }
Encapsulates the topology queries of the understanding DLL. These queries will not be valid until aft...
Result of a topology query. Typically results return an array of these structures.