AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
HoloToolkit.Unity.SpatialUnderstandingDllShapes Class Reference

Encapsulates the shape detection queries of the understanding DLL. Shapes are defined by the user with AddShape and the analysis is initiated with ActivateShapeAnalysis. These queries will not be valid until after scanning is finalized. More...

Classes

struct  ShapeComponent
 A shape component definition. Contains a list of component constraints. More...
 
struct  ShapeComponentConstraint
 A shape component constraint. This includes its type enum and its type specific parameters. More...
 
struct  ShapeConstraint
 A shape constraint definition. Composed of a type and type specific parameters More...
 
struct  ShapeResult
 Result structure returned by shape queries More...
 

Public Types

enum  ShapeComponentConstraintType {
  ShapeComponentConstraintType.SurfaceNotPartOfShape, ShapeComponentConstraintType.SurfaceHeight_Min, ShapeComponentConstraintType.SurfaceHeight_Max, ShapeComponentConstraintType.SurfaceHeight_Between,
  ShapeComponentConstraintType.SurfaceHeight_Is, ShapeComponentConstraintType.SurfaceCount_Min, ShapeComponentConstraintType.SurfaceCount_Max, ShapeComponentConstraintType.SurfaceCount_Between,
  ShapeComponentConstraintType.SurfaceCount_Is, ShapeComponentConstraintType.SurfaceArea_Min, ShapeComponentConstraintType.SurfaceArea_Max, ShapeComponentConstraintType.SurfaceArea_Between,
  ShapeComponentConstraintType.SurfaceArea_Is, ShapeComponentConstraintType.IsRectangle, ShapeComponentConstraintType.RectangleSize_Min, ShapeComponentConstraintType.RectangleSize_Max,
  ShapeComponentConstraintType.RectangleSize_Between, ShapeComponentConstraintType.RectangleSize_Is, ShapeComponentConstraintType.RectangleLength_Min, ShapeComponentConstraintType.RectangleLength_Max,
  ShapeComponentConstraintType.RectangleLength_Between, ShapeComponentConstraintType.RectangleLength_Is, ShapeComponentConstraintType.RectangleWidth_Min, ShapeComponentConstraintType.RectangleWidth_Max,
  ShapeComponentConstraintType.RectangleWidth_Between, ShapeComponentConstraintType.RectangleWidth_Is, ShapeComponentConstraintType.IsSquare, ShapeComponentConstraintType.SquareSize_Min,
  ShapeComponentConstraintType.SquareSize_Max, ShapeComponentConstraintType.SquareSize_Between, ShapeComponentConstraintType.SquareSize_Is, ShapeComponentConstraintType.IsCircle,
  ShapeComponentConstraintType.CircleRadius_Min, ShapeComponentConstraintType.CircleRadius_Max, ShapeComponentConstraintType.CircleRadius_Between, ShapeComponentConstraintType.CircleRadius_Is
}
 Types of shape component constraints More...
 
enum  ShapeConstraintType {
  ShapeConstraintType.NoOtherSurface, ShapeConstraintType.AwayFromWalls, ShapeConstraintType.RectanglesParallel, ShapeConstraintType.RectanglesPerpendicular,
  ShapeConstraintType.RectanglesAligned, ShapeConstraintType.RectanglesSameLength, ShapeConstraintType.AtFrontOf, ShapeConstraintType.AtBackOf,
  ShapeConstraintType.AtLeftOf, ShapeConstraintType.AtRightOf
}
 Lists the types of shape constraints. Each defines a requirement between shape components. More...
 

Public Member Functions

static int QueryShape_FindPositionsOnShape ([In, MarshalAs(UnmanagedType.LPStr)] string shapeName, [In] float minRadius, [In] int shapeCount, [In, Out] IntPtr shapeData)
 Finds the set of available positions on the set of found shapes of the type specified by shapeName. More...
 
static int QueryShape_FindShapeHalfDims ([In, MarshalAs(UnmanagedType.LPStr)] string shapeName, [In] int shapeCount, [In, Out] IntPtr shapeData)
 Finds the set of found shapes of the type specified by shapeName. Returns the bounding rectangle's half dimensions. More...
 
static int AddShape ([In, MarshalAs(UnmanagedType.LPStr)] string shapeName, [In] int componentCount, [In] IntPtr components, [In] int shapeConstraints, [In] IntPtr constraints)
 Add a shape definition. A shape is defined by a list of components and a set of component constraints. Each component is of type ShapeComponent and is defined by a set of component constraint. More...
 
static void ActivateShapeAnalysis ()
 Runs the shape analysis. This should be called after scanning has been finalized and shapes have been defined with AddShape. More...
 
static void RemoveAllShapes ()
 Removes all shapes defined by AddShape. More...
 

Detailed Description

Encapsulates the shape detection queries of the understanding DLL. Shapes are defined by the user with AddShape and the analysis is initiated with ActivateShapeAnalysis. These queries will not be valid until after scanning is finalized.

Shape definitions are composed of a list of components and a list of shape constraints which defining requirements between the components. Each component is defined by a list of its own shape component constraints.

Definition at line 23 of file SpatialUnderstandingDllShapes.cs.

Member Enumeration Documentation

§ ShapeComponentConstraintType

Types of shape component constraints

Enumerator
SurfaceNotPartOfShape 
SurfaceHeight_Min 
SurfaceHeight_Max 
SurfaceHeight_Between 
SurfaceHeight_Is 
SurfaceCount_Min 
SurfaceCount_Max 
SurfaceCount_Between 
SurfaceCount_Is 
SurfaceArea_Min 
SurfaceArea_Max 
SurfaceArea_Between 
SurfaceArea_Is 
IsRectangle 
RectangleSize_Min 
RectangleSize_Max 
RectangleSize_Between 
RectangleSize_Is 
RectangleLength_Min 
RectangleLength_Max 
RectangleLength_Between 
RectangleLength_Is 
RectangleWidth_Min 
RectangleWidth_Max 
RectangleWidth_Between 
RectangleWidth_Is 
IsSquare 
SquareSize_Min 
SquareSize_Max 
SquareSize_Between 
SquareSize_Is 
IsCircle 
CircleRadius_Min 
CircleRadius_Max 
CircleRadius_Between 
CircleRadius_Is 

Definition at line 38 of file SpatialUnderstandingDllShapes.cs.

§ ShapeConstraintType

Lists the types of shape constraints. Each defines a requirement between shape components.

Enumerator
NoOtherSurface 
AwayFromWalls 
RectanglesParallel 
RectanglesPerpendicular 
RectanglesAligned 
RectanglesSameLength 
AtFrontOf 
AtBackOf 
AtLeftOf 
AtRightOf 

Definition at line 648 of file SpatialUnderstandingDllShapes.cs.

Member Function Documentation

§ ActivateShapeAnalysis()

static void HoloToolkit.Unity.SpatialUnderstandingDllShapes.ActivateShapeAnalysis ( )

Runs the shape analysis. This should be called after scanning has been finalized and shapes have been defined with AddShape.

§ AddShape()

static int HoloToolkit.Unity.SpatialUnderstandingDllShapes.AddShape ( [In, MarshalAs(UnmanagedType.LPStr)] string  shapeName,
[In] int  componentCount,
[In] IntPtr  components,
[In] int  shapeConstraints,
[In] IntPtr  constraints 
)

Add a shape definition. A shape is defined by a list of components and a set of component constraints. Each component is of type ShapeComponent and is defined by a set of component constraint.

Parameters
shapeNameName of the shaped
componentCountLength of the component array pass in the components parameter
componentsArray of ShapeComponent structures
shapeConstraintsLength of the shape constraint array passed in the constraints parameter
constraintsArray of ShapeConstraint structures
Returns

§ QueryShape_FindPositionsOnShape()

static int HoloToolkit.Unity.SpatialUnderstandingDllShapes.QueryShape_FindPositionsOnShape ( [In, MarshalAs(UnmanagedType.LPStr)] string  shapeName,
[In] float  minRadius,
[In] int  shapeCount,
[In, Out] IntPtr  shapeData 
)

Finds the set of available positions on the set of found shapes of the type specified by shapeName.

Parameters
shapeNameName of the shape
minRadiusDefines the minimum space requirement for a returned position
shapeCountLength of the array passed in shapeData, the return value will never exceed this value
shapeDataAn array of ShapeResult structures to receive the results of the query
Returns
Number of positions found. This number will never exceed shapeCount (the space provided for the results in shapeData).

§ QueryShape_FindShapeHalfDims()

static int HoloToolkit.Unity.SpatialUnderstandingDllShapes.QueryShape_FindShapeHalfDims ( [In, MarshalAs(UnmanagedType.LPStr)] string  shapeName,
[In] int  shapeCount,
[In, Out] IntPtr  shapeData 
)

Finds the set of found shapes of the type specified by shapeName. Returns the bounding rectangle's half dimensions.

Parameters
shapeNameName of the shape
shapeCountLength of the array passed in shapeData, the return value will never exceed this value
shapeDataAn array of ShapeResult structures to receive the results of the query
Returns
Number of shapes found. This number will never exceed shapeCount (the space provided for the results in shapeData).

§ RemoveAllShapes()

static void HoloToolkit.Unity.SpatialUnderstandingDllShapes.RemoveAllShapes ( )

Removes all shapes defined by AddShape.


The documentation for this class was generated from the following file: