protected void SetupRenderer() { try { Renderable.Initialize(Device); FieldPlane.Initialize(); ColorMapping.Initialize(Device); PointCloud.Initialize(); LineBall.Initialize(); Mesh.Initialize(); Device.ImmediateContext.OutputMerger.SetTargets(_host.RenderTargetView); Device.ImmediateContext.Rasterizer.SetViewports(new Viewport(0, 0, _host.RenderTargetWidth, _host.RenderTargetHeight, 0.0f, 1.0f)); _renderables = new List <Renderable>(); Camera = new Camera(Device, ((float)_host.RenderTargetWidth) / _host.RenderTargetHeight); var desc = new RasterizerStateDescription { CullMode = CullMode.None, FillMode = FillMode.Solid }; Device.ImmediateContext.Rasterizer.State = RasterizerState.FromDescription(Device, desc); SetupCuda(); AlgorithmCuda.Initialize(ContextCuda, Device); FlowMapUncertain.Initialize(); CutDiffusion.Initialize(); LocalDiffusion.Initialize(); } catch (Exception e) { Console.WriteLine(e); } }
public FlowMapMapper(LoaderNCF.SliceRange[] uv, Plane plane, VectorFieldUnsteady velocity) : base(plane, velocity.Size.ToInt2()) { _flowMap = new FlowMapUncertain(_startPoint, uv, 0, 9); _algorithm = _flowMap; Plane = plane; _subrangePlane = Plane; Mapping = GetCurrentMap; _velocity = velocity; _maxPlane = velocity.Size.ToInt2(); }