void RegisterShapes() { foreach (STShape s in Shapes) { s.Register(); } SpatialUnderstandingDllShapes.ActivateShapeAnalysis(); }
/// <summary> /// Create shape definitions, add them and analyze the definitions to get the results to query later /// </summary> private void FindShapes() { if (HasCreatedShapes || !SpatialUnderstanding.Instance.AllowSpatialUnderstanding) { return; } CreateShapeDefinitions(); SpatialUnderstandingDllShapes.ActivateShapeAnalysis(); }
/** * Create shape definitions. */ public void CreateShapes() { if (this.HasCreatedShapes || !SpatialUnderstanding.IsInitialized || !SpatialUnderstanding.Instance.AllowSpatialUnderstanding) { return; } // Create definitions and analyze this.CreateCustomShapeDefinitions(); SpatialUnderstandingDllShapes.ActivateShapeAnalysis(); }
public void CreateShapes() { if (HasCreatedShapes || !SpatialUnderstandingManager.Instance.AllowSpatialUnderstanding) { return; } // Create definitions and analyze CreateCustomShapeDefinitions(); SpatialUnderstandingDllShapes.ActivateShapeAnalysis(); }
private void CreateElectricBoxShape() { var shapeComponents = new List <SpatialUnderstandingDllShapes.ShapeComponent>() { new SpatialUnderstandingDllShapes.ShapeComponent( new List <SpatialUnderstandingDllShapes.ShapeComponentConstraint>() { SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_IsRectangle(0.1f), SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_RectangleLength_Between(0.4f, 0.6f), SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_RectangleWidth_Between(0.3f, 0.5f) }), new SpatialUnderstandingDllShapes.ShapeComponent( new List <SpatialUnderstandingDllShapes.ShapeComponentConstraint>() { SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_IsRectangle(0.1f), SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_RectangleLength_Between(0.15f, 0.2f), SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_RectangleWidth_Between(0.3f, 0.5f) }), new SpatialUnderstandingDllShapes.ShapeComponent( new List <SpatialUnderstandingDllShapes.ShapeComponentConstraint>() { SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_IsRectangle(0.1f), SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_RectangleLength_Between(0.4f, 0.6f), SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_RectangleWidth_Between(0.15f, 0.2f) }), }; var shapeConstraints = new List <SpatialUnderstandingDllShapes.ShapeConstraint>() { SpatialUnderstandingDllShapes.ShapeConstraint.Create_RectanglesSameLength(0, 2), SpatialUnderstandingDllShapes.ShapeConstraint.Create_RectanglesPerpendicular(0, 1), SpatialUnderstandingDllShapes.ShapeConstraint.Create_RectanglesPerpendicular(0, 2) }; AddShapeDefinition("ElectricBox", shapeComponents, shapeConstraints); SpatialUnderstandingDllShapes.ActivateShapeAnalysis(); }
/// <summary> /// /// </summary> public void CreateShapes() { // Create definitions and analyze CreateCustomShapeDefinitions(); SpatialUnderstandingDllShapes.ActivateShapeAnalysis(); }