public void ThenTheDirectoryServicePolicyContainsTheGeoCircleFence(string geofenceName) { IFence fence = GetFenceFromPolicy(geofenceName); Assert.IsNotNull(fence); Assert.IsInstanceOfType(fence, typeof(GeoCircleFence)); }
public void ThenTheFenceHasALongitudeOf(string geofenceName, double longitude) { IFence fence = GetFenceFromPolicy(geofenceName); Assert.IsNotNull(fence); Assert.AreEqual(longitude, (fence as GeoCircleFence).Longitude); }
public void ThenTheFenceHasAPostal_CodeOf(string geofenceName, string postalCode) { IFence fence = GetFenceFromPolicy(geofenceName); Assert.IsNotNull(fence); Assert.AreEqual(postalCode, (fence as TerritoryFence).PostalCode); }
public void ThenTheFenceHasAnAdministrative_AreaOf(string geofenceName, string adminArea) { IFence fence = GetFenceFromPolicy(geofenceName); Assert.IsNotNull(fence); Assert.AreEqual(adminArea, (fence as TerritoryFence).AdministrativeArea); }
public void ThenTheFenceHasACountryOf(string geofenceName, string country) { IFence fence = GetFenceFromPolicy(geofenceName); Assert.IsNotNull(fence); Assert.AreEqual(country, (fence as TerritoryFence).Country); }
public void ThenTheOrganizationServicePolicyContainsTheTerritoryFence(string geofenceName) { IFence fence = GetFenceFromPolicy(geofenceName); Assert.IsNotNull(fence); Assert.IsInstanceOfType(fence, typeof(TerritoryFence)); }
public void ThenTheFenceHasARadiusOf(string geofenceName, int radius) { IFence fence = GetFenceFromPolicy(geofenceName); Assert.IsNotNull(fence); Assert.AreEqual(radius, (fence as GeoCircleFence).Radius); }
public void grab(IRenderDevice device, IDeviceContext context, ITexture texture, ConsumeTextureDelegate consume) { TextureDesc desc = texture.GetDesc(); // Create staging texture if needed if (null == stagingTexture || stagingDesc.Size != desc.Size || stagingDesc.Format != desc.Format) { ComUtils.clear(ref stagingTexture); desc.Type = ResourceDimension.Tex2d; desc.BindFlags = BindFlags.None; desc.CPUAccessFlags = CpuAccessFlags.Read; desc.Usage = Usage.Staging; stagingTexture = device.CreateTexture(ref desc, "ScreenGrabber staging"); stagingDesc = desc; } // In D3D12, Diligent engine fails instead of waiting for GPU. Need to wait manually, need a fence for that. if (RuntimeEnvironment.runningWindows && null == fence) { var fd = new FenceDesc(false); fence = device.CreateFence(ref fd); } // Finish the rendering, if any waitForGpu(context); // Unset the targets context.SetRenderTargets(0, null, null); waitForGpu(context); // Copy source texture to staging context.copyTexture(stagingTexture, texture); waitForGpu(context); // Map the texture Box box = new Box(false) { MaxX = desc.Size.cx, MaxY = desc.Size.cy }; MappedTextureSubresource mapped = context.MapTextureSubresource(stagingTexture, 0, 0, MapType.Read, MapFlags.DoNotWait, ref box); try { consume(desc.Format, desc.Size, mapped); } finally { context.UnmapTextureSubresource(stagingTexture, 0, 0); } }
/// <summary> /// /// </summary> /// <param name="d"></param> /// <param name="f"></param> public override void SetFence(Direction d, IFence f) { fence[d.index / 2] = f; }
/// <summary> /// /// </summary> /// <param name="d"></param> /// <param name="f"></param> public abstract void SetFence(Direction d, IFence f);
/// <summary> /// /// </summary> /// <param name="d"></param> /// <param name="f"></param> public override void SetFence(Direction d, IFence f) { }