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);
        }
Пример #3
0
        public void ThenTheFenceHasAPostal_CodeOf(string geofenceName, string postalCode)
        {
            IFence fence = GetFenceFromPolicy(geofenceName);

            Assert.IsNotNull(fence);
            Assert.AreEqual(postalCode, (fence as TerritoryFence).PostalCode);
        }
Пример #4
0
        public void ThenTheFenceHasAnAdministrative_AreaOf(string geofenceName, string adminArea)
        {
            IFence fence = GetFenceFromPolicy(geofenceName);

            Assert.IsNotNull(fence);
            Assert.AreEqual(adminArea, (fence as TerritoryFence).AdministrativeArea);
        }
Пример #5
0
        public void ThenTheFenceHasACountryOf(string geofenceName, string country)
        {
            IFence fence = GetFenceFromPolicy(geofenceName);

            Assert.IsNotNull(fence);
            Assert.AreEqual(country, (fence as TerritoryFence).Country);
        }
Пример #6
0
        public void ThenTheOrganizationServicePolicyContainsTheTerritoryFence(string geofenceName)
        {
            IFence fence = GetFenceFromPolicy(geofenceName);

            Assert.IsNotNull(fence);
            Assert.IsInstanceOfType(fence, typeof(TerritoryFence));
        }
Пример #7
0
        public void ThenTheFenceHasARadiusOf(string geofenceName, int radius)
        {
            IFence fence = GetFenceFromPolicy(geofenceName);

            Assert.IsNotNull(fence);
            Assert.AreEqual(radius, (fence as GeoCircleFence).Radius);
        }
Пример #8
0
            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);
                }
            }
Пример #9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="d"></param>
 /// <param name="f"></param>
 public override void SetFence(Direction d, IFence f)
 {
     fence[d.index / 2] = f;
 }
Пример #10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="d"></param>
 /// <param name="f"></param>
 public abstract void SetFence(Direction d, IFence f);
Пример #11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="d"></param>
 /// <param name="f"></param>
 public override void SetFence(Direction d, IFence f)
 {
 }