public void OnTick(float dt)
        {
            TickUserInputs(dt);
            if (this._isEnabled && this._isRotatingCharacter)
            {
                this.UpdateCharacterRotation((int)Input.MouseMoveX);
            }
            if (this._animationFrequencyThreshold > this._animationGap)
            {
                this._animationGap += dt;
            }
            if (this._isEnabled && this._agentVisuals != null)
            {
                this._agentVisuals.TickVisuals();
            }
            TableauView view = this.View;

            if (view != null)
            {
                if (this._continuousRenderCamera == null)
                {
                    this._continuousRenderCamera = Camera.CreateCamera();
                }
                view.SetDoNotRenderThisFrame(false);
            }
        }
Example #2
0
        private void TableauMaterialTabInventoryItemTooltipOnRender(Texture sender, EventArgs e)
        {
            TableauView tableauView = this.View;

            if ((NativeObject)tableauView == (NativeObject)null)
            {
                tableauView = sender.TableauView;
                tableauView.SetEnable(this._isEnabled);
            }


            tableauView.SetRenderWithPostfx(true);
            tableauView.SetClearColor(0U);
            tableauView.SetScene(this._tableauScene);
            if ((NativeObject)this._camera == (NativeObject)null)
            {
                this._camera = Camera.CreateCamera();
                this._camera.SetViewVolume(true, -0.5f, 0.5f, -0.5f, 0.5f, 0.01f, 100f);
                this.ResetCamera();
                tableauView.SetSceneUsesSkybox(false);
            }
            tableauView.SetCamera(this._camera);
            if (this._isRotatingByDefault)
            {
                this.UpdateRotation(1f, 0.0f);
            }
            tableauView.SetDeleteAfterRendering(false);
            tableauView.SetContinuousRendering(true);
        }
        public void OnFinalize()
        {
            if (this._continuousRenderCamera != null)
            {
                this._continuousRenderCamera.ReleaseCameraEntity();
                this._continuousRenderCamera = null;
            }
            AgentVisuals expr_26 = this._agentVisuals;

            if (expr_26 != null)
            {
                expr_26.Reset();
            }
            this._agentVisuals = null;
            TableauView expr_3E = this.View;

            if (expr_3E != null)
            {
                expr_3E.AddClearTask();
            }
            this.Texture = null;
            if (this._tableauScene != null)
            {
                MBAgentRendererSceneController.DestructAgentRendererSceneController(this._tableauScene, this._agentRendererSceneController);
                this._agentRendererSceneController = null;
                this._tableauScene = null;
            }
        }
Example #4
0
        public void should_Generate_SyncSummary()
        {
            var summary = TableauView.GenerateSyncSummary(_listOld, _listNew, "Views");

            Assert.AreEqual(3, summary.Inserts);
            Assert.AreEqual(2, summary.Updates);
            Assert.AreEqual(1, summary.Voids);
            Console.WriteLine(summary.ShowSummary());
        }
        private void SetEnabled(bool enabled)
        {
            this._isEnabled = enabled;
            TableauView view = this.View;

            if (view != null)
            {
                view.SetEnable(this._isEnabled);
            }
        }
Example #6
0
        protected void SetEnabled(bool enabled)
        {
            this._isRotatingByDefault = false;
            this._isRotating          = false;
            this.ResetCamera();
            this._isEnabled = enabled;
            TableauView view = this.View;

            if (!((NativeObject)view != (NativeObject)null))
            {
                return;
            }
            view.SetEnable(this._isEnabled);
        }
Example #7
0
        public IEnumerable <TableauView> GetOrgViewsNoCharts(Guid orgId, bool canViewOnly = false)
        {
            var context = Context as DwhDashboardContext;

            var org        = Find(orgId);
            var orgViewIds = org.Views.Select(x => x.TabViewId).ToList();

            var allViews = _tabViewRepository.GetViewsFiltered().ToList();
            var orgViews = allViews.Where(x => orgViewIds.Contains(x.Id)).ToList();

            if (canViewOnly)
            {
                return(orgViews);
            }

            return(TableauView.GenerateShowingChecked(allViews, orgViews));
        }
Example #8
0
        public void OnFinalize()
        {
            if ((NativeObject)this._camera != (NativeObject)null)
            {
                this._camera.ReleaseCameraEntity();
                this._camera = (Camera)null;
            }
            TableauView view = this.View;

            if ((NativeObject)view != (NativeObject)null)
            {
                view.SetEnable(false);
            }
            if (!((NativeObject)this._tableauScene != (NativeObject)null))
            {
                return;
            }
            this._tableauScene.ClearAll();
            this._tableauScene = (Scene)null;
        }
Example #9
0
        private void RefreshModelTableau()
        {
            if (!this._initialized)
            {
                this.Initialize();
            }

            if (this._model != null)
            {
                this._model.Remove();
                this._model = (GameEntity)null;
            }


            var frame = MatrixFrame.Identity;

            this._model = GameEntity.Instantiate(this._tableauScene, _stringId, false);
            this._model.SetFrame(ref frame);
            foreach (var sc in _model.GetScriptComponents())
            {
                _model.RemoveScriptComponent(sc.ScriptComponent.RefPointer());
            }



            TableauView view = this.View;

            if ((NativeObject)view != (NativeObject)null)
            {
                float radius = (this._model.GetBoundingBoxMax() - this._model.GetBoundingBoxMin()).Length * 2f;
                Vec3  origin = this._model.GetGlobalFrame().origin;
                view.SetFocusedShadowmap(true, ref origin, radius);
            }

            this._initialFrame = this._model.GetFrame();
            Vec3 eulerAngles = this._initialFrame.rotation.GetEulerAngles();

            this._panRotation  = eulerAngles.x;
            this._tiltRotation = eulerAngles.z;
        }
Example #10
0
        public async Task <IEnumerable <TableauView> > GetAllViewsAsync(string workbookId)
        {
            List <TableauView> tabViews;

            await GetAuthToken();

            if (string.IsNullOrWhiteSpace(_authToken))
            {
                var message = "Access is denied !";
                Log.Debug(message);
                throw new UnauthorizedAccessException(message);
            }

            if (string.IsNullOrWhiteSpace(_siteId))
            {
                var message = "Site Id required!";
                Log.Debug(message);
                throw new ArgumentException(message);
            }

            try
            {
                //GET   /api/api-version/sites/site-id/workbooks/workbook-id/views
                var response = await GetHttpClient(_authToken).GetAsync($"sites/{_siteId}/workbooks/{workbookId}/views");

                response.EnsureSuccessStatusCode();
                string content = await response.Content.ReadAsStringAsync();

                var viewsResponse = JsonConvert.DeserializeObject <ViewsResponse>(content);
                tabViews = TableauView.Generate(viewsResponse.GetViews(), workbookId);
            }
            catch (Exception e)
            {
                Log.Debug(e);
                throw;
            }

            return(tabViews);
        }
Example #11
0
        public void SetTargetSize(int width, int height)
        {
            this._isRotating = false;
            if (width <= 0 || height <= 0)
            {
                this._tableauSizeX = 10;
                this._tableauSizeY = 10;
            }
            else
            {
                this._tableauSizeX = width;
                this._tableauSizeY = height;
            }
            this._cameraRatio = (float)this._tableauSizeX / (float)this._tableauSizeY;
            TableauView view = this.View;

            if ((NativeObject)view != (NativeObject)null)
            {
                view.SetEnable(false);
            }
            this.Texture = TableauView.AddTableau(new RenderTargetComponent.TextureUpdateEventHandler(this.TableauMaterialTabInventoryItemTooltipOnRender), (object)this._tableauScene, this._tableauSizeX, this._tableauSizeY);
        }
        public void SetTargetSize(int width, int height)
        {
            this._isRotatingCharacter = false;
            if (width <= 0 || height <= 0)
            {
                this._tableauSizeX = 10;
                this._tableauSizeY = 10;
            }
            else
            {
                this._tableauSizeX = (int)((float)width * 1f);
                this._tableauSizeY = (int)((float)height * 1f);
            }
            this._cameraRatio = (float)this._tableauSizeX / (float)this._tableauSizeY;
            TableauView view = this.View;

            if (view != null)
            {
                view.SetEnable(false);
            }
            this.Texture = TableauView.AddTableau(new RenderTargetComponent.TextureUpdateEventHandler(this.CharacterTableauContinuousRenderFunction), this._tableauScene, this._tableauSizeX, this._tableauSizeY);
        }
Example #13
0
        private void RefreshModelTableau()
        {
            if (!this._initialized)
            {
                this.Initialize();
            }


            TableauView view = this.View;

            if ((NativeObject)view != (NativeObject)null)
            {
                float radius = (this._model.GetBoundingBoxMax() - this._model.GetBoundingBoxMin()).Length * 2f;
                Vec3  origin = this._model.GetGlobalFrame().origin;
                view.SetFocusedShadowmap(true, ref origin, radius);
            }

            this._initialFrame = this._model.GetFrame();
            Vec3 eulerAngles = this._initialFrame.rotation.GetEulerAngles();

            this._panRotation  = eulerAngles.x;
            this._tiltRotation = eulerAngles.z;
        }
        internal void CharacterTableauContinuousRenderFunction(Texture sender, EventArgs e)
        {
            Scene       scene       = (Scene)sender.UserData;
            TableauView tableauView = sender.TableauView;

            if (scene == null)
            {
                tableauView.SetContinuousRendering(false);
                tableauView.SetDeleteAfterRendering(true);
                return;
            }
            scene.EnsurePostfxSystem();
            scene.SetDofMode(false);
            scene.SetMotionBlurMode(false);
            scene.SetBloom(true);
            scene.SetDynamicShadowmapCascadesRadiusMultiplier(0.31f);
            tableauView.SetRenderWithPostfx(true);
            float       cameraRatio = this._cameraRatio;
            MatrixFrame camPos      = this._camPos;

            if (this._continuousRenderCamera != null)
            {
                Camera continuousRenderCamera = this._continuousRenderCamera;
                this._continuousRenderCamera = null;
                continuousRenderCamera.SetFovVertical(0.7853982f, cameraRatio, 0.2f, 200f);
                continuousRenderCamera.Frame = camPos;
                tableauView.SetCamera(continuousRenderCamera);
                tableauView.SetScene(scene);
                tableauView.SetSceneUsesSkybox(false);
                tableauView.SetDeleteAfterRendering(false);
                tableauView.SetContinuousRendering(true);
                tableauView.SetDoNotRenderThisFrame(true);
                tableauView.SetClearColor(0u);
                tableauView.SetFocusedShadowmap(true, ref this._frame.origin, 1.55f);
            }
        }