Esempio n. 1
0
 public override void execute(AnomalousMvcContext context)
 {
     if (LinkName != null)
     {
         NavigationModel navModel = context.getModel <NavigationModel>(NavigationModelName);
         if (navModel != null)
         {
             NavigationLink namedAction = navModel.getNamed(LinkName);
             if (namedAction != null)
             {
                 context.queueRunAction(namedAction.Action);
             }
             else
             {
                 Log.Warning("Cannot find named navigation link '{0}' in navigation model. Has it been setup properly?", LinkName, NavigationModelName);
             }
         }
         else
         {
             Log.Warning("Cannot find navigation model '{0}'. Has it been setup properly?", NavigationModelName);
         }
     }
     else
     {
         Log.Warning("Link name is null. Cannot navigate.");
     }
 }
Esempio n. 2
0
        public override void execute(AnomalousMvcContext context)
        {
            float blend;

            float.TryParse(context.getActionArgument("value"), out blend);
            startPosition.incrementalBlend(endPosition, blend);
        }
 public void removeContext(AnomalousMvcContext context)
 {
     if (activeContexts.Remove(context))
     {
         context.removedFromStack();
     }
 }
Esempio n. 4
0
 public override void execute(AnomalousMvcContext context)
 {
     if (!context.isViewOpen(View))
     {
         context.queueShowView(View);
     }
 }
Esempio n. 5
0
 public void restoreSavedViewLayout(StoredViewCollection storedViews, AnomalousMvcContext context)
 {
     foreach (View view in storedViews.Views)
     {
         requestOpen(view, context);
     }
 }
 public override void execute(AnomalousMvcContext context)
 {
     foreach (ActionCommand command in commands)
     {
         command.execute(context);
     }
 }
Esempio n. 7
0
        public override void execute(AnomalousMvcContext context)
        {
            float blend;

            float.TryParse(context.getActionArgument("value"), out blend);
            context.blendPresetStates(startState, endState, blend);
        }
Esempio n. 8
0
        public override void execute(AnomalousMvcContext context)
        {
            float blend;

            float.TryParse(context.getActionArgument("value"), out blend);
            context.applyBlendedLayers(StartLayers, endLayers, blend);
        }
 public AnomalousMvcContext loadContext(Stream stream)
 {
     using (XmlReader xmlReader = new XmlTextReader(stream))
     {
         AnomalousMvcContext context = (AnomalousMvcContext)xmlSaver.restoreObject(xmlReader);
         return(context);
     }
 }
Esempio n. 10
0
        public override void execute(AnomalousMvcContext context)
        {
            EditMenuManager menuManager = context.getModel <EditMenuManager>(EditMenuManagerName);

            if (menuManager != null)
            {
                menuManager.copy();
            }
        }
Esempio n. 11
0
        public override void execute(AnomalousMvcContext context)
        {
            ViewHost viewHost = context.findViewHost(View);

            if (viewHost != null)
            {
                context.queueCloseView(viewHost);
            }
        }
        public override void execute(AnomalousMvcContext context)
        {
            MedicalStateInfoModel stateInfo = context.getModel <MedicalStateInfoModel>(WizardStateInfoName);

            if (stateInfo == null)
            {
                stateInfo = new MedicalStateInfoModel(WizardStateInfoName);
            }
            context.createMedicalState(stateInfo);
        }
Esempio n. 13
0
        public void requestOpen(View view, AnomalousMvcContext context)
        {
            ViewHostPanelInfo panel = findPanel(view.ElementName);

            if (panel != null)
            {
                panel.Queued        = view;
                panel.QueuedContext = context;
            }
        }
Esempio n. 14
0
 public override void execute(AnomalousMvcContext context)
 {
     if (Name != null)
     {
         context.saveCamera(Name);
     }
     else
     {
         Log.Warning("No name defined.");
     }
 }
Esempio n. 15
0
 public override void execute(AnomalousMvcContext context)
 {
     if (Name != null)
     {
         context.restoreMedicalState(Name);
     }
     else
     {
         Log.Warning("No name defined.");
     }
 }
Esempio n. 16
0
 public override void execute(AnomalousMvcContext context)
 {
     if (Name != null)
     {
         TeethHighlightState saved = context.getModel <TeethHighlightState>(Name);
         TeethController.HighlightContacts = saved.Highlighted;
     }
     else
     {
         Log.Warning("No name defined.");
     }
 }
 public ViewHost createViewHost(View view, AnomalousMvcContext context)
 {
     foreach (ViewHostFactory factory in subFactories)
     {
         ViewHost host = factory.createViewHost(view, context);
         if (host != null)
         {
             return(host);
         }
     }
     return(null);
 }
        public override void execute(AnomalousMvcContext context)
        {
            float blend;

            float.TryParse(context.getActionArgument("value"), out blend);
            var blendedPosition = new CameraPosition(CameraStartPosition);

            blendedPosition.LookAt       = CameraStartPosition.LookAt.lerp(CameraEndPosition.LookAt, blend);
            blendedPosition.Translation  = CameraStartPosition.Translation.lerp(CameraEndPosition.Translation, blend);
            blendedPosition.IncludePoint = CameraStartPosition.IncludePoint.lerp(CameraEndPosition.IncludePoint, blend);
            context.applyCameraPosition(blendedPosition, 0.0f);
        }
Esempio n. 19
0
 /// <summary>
 /// Start running an mvc context. The context should be a unique
 /// instance because its internal state will be modified as it is run.
 /// So you should load a fresh context from a file or make a copy before
 /// passing it into this method.
 /// </summary>
 /// <param name="context">The context to run.</param>
 public void startRunningContext(AnomalousMvcContext context)
 {
     if (contextManager.CurrentContext != null)
     {
         contextManager.CurrentContext.suspend();
         contextManager.CurrentContext.queueShutdown();
         this.processViewChanges();
         this.shutdownContext(contextManager.CurrentContext, false, false);
     }
     contextManager.pushContext(context);
     setupContextToRun(context);
     context.startup();
 }
Esempio n. 20
0
        public override void execute(AnomalousMvcContext context)
        {
            DataModel dataModel = context.getModel <DataModel>(DataModelName);

            if (dataModel != null)
            {
                dataModel.setValue(FieldName, Value);
            }
            else
            {
                Log.Error("Could not find a data model named {0}", DataModelName);
            }
        }
Esempio n. 21
0
        public override void execute(AnomalousMvcContext context)
        {
            BackStackModel backStack = context.getModel <BackStackModel>(BackStackModelName);

            if (backStack != null)
            {
                backStack.setCurrentAction(context.ExecutingAction);
            }
            else
            {
                Log.Warning("Cannot find BackStackModel '{0}'. Has it been setup properly?", BackStackModelName);
            }
        }
 public void pushContext(AnomalousMvcContext context)
 {
     //Remove any existing contexts with the same runtime name
     for (int i = 0; i < activeContexts.Count; ++i)
     {
         if (activeContexts[i].RuntimeName == context.RuntimeName)
         {
             activeContexts[i].removedFromStack();
             activeContexts.RemoveAt(i--);
         }
     }
     activeContexts.Add(context);
 }
Esempio n. 23
0
        public override void execute(AnomalousMvcContext context)
        {
            DataModel dataModel = context.getModel <DataModel>(DataModelName);

            if (dataModel != null)
            {
                context.analyzeViewData(dataModel);
            }
            else
            {
                Log.Error("Could not find data model named {0}", DataModelName);
            }
        }
Esempio n. 24
0
 public override void execute(AnomalousMvcContext context)
 {
     if (Name != null)
     {
         MusclePosition musclePosition = new MusclePosition();
         musclePosition.captureState();
         context.addModel(Name, musclePosition);
     }
     else
     {
         Log.Warning("No name defined.");
     }
 }
Esempio n. 25
0
        public override void execute(AnomalousMvcContext context)
        {
            DataModel dataModel = context.getModel <DataModel>(DataModelName);

            if (dataModel != null)
            {
                foreach (var param in context.ActionArguments)
                {
                    dataModel.setValue(param.Item1, param.Item2);
                }
            }
            else
            {
                Log.Error("Could not find a data model named {0}", DataModelName);
            }
        }
Esempio n. 26
0
 public override void execute(AnomalousMvcContext context)
 {
     if (Name != null)
     {
         TeethHighlightState saved = context.getModel <TeethHighlightState>(Name);
         if (saved == null)
         {
             saved = new TeethHighlightState();
             context.addModel(Name, saved);
         }
         saved.Highlighted = TeethController.HighlightContacts;
     }
     else
     {
         Log.Warning("No name defined.");
     }
 }
        public override void execute(AnomalousMvcContext context)
        {
            NavigationModel navModel = context.getModel <NavigationModel>(NavigationModelName);

            if (navModel != null)
            {
                NavigationLink previousAction = navModel.getPrevious();
                if (previousAction != null)
                {
                    context.queueRunAction(previousAction.Action);
                }
            }
            else
            {
                Log.Warning("Cannot find navigation model '{0}'. Has it been setup properly?", NavigationModelName);
            }
        }
Esempio n. 28
0
        public override void execute(AnomalousMvcContext context)
        {
            BackStackModel backStack = context.getModel <BackStackModel>(BackStackModelName);

            if (backStack != null)
            {
                String backAction = backStack.getPreviousAction();
                if (backAction != null)
                {
                    backStack.ignoreNextCurrentAction();
                    context.queueRunAction(backAction);
                }
            }
            else
            {
                Log.Warning("Cannot find BackStackModel '{0}'. Has it been setup properly?", BackStackModelName);
            }
        }
 public override void execute(AnomalousMvcContext context)
 {
     if (Name != null)
     {
         MusclePosition musclePosition = context.getModel <MusclePosition>(Name);
         if (musclePosition != null)
         {
             context.applyMusclePosition(musclePosition, MedicalConfig.CameraTransitionTime);
         }
         else
         {
             Log.Warning("Cannot find muscle position {0}.", Name);
         }
     }
     else
     {
         Log.Warning("No name defined.");
     }
 }
Esempio n. 30
0
        public override void execute(AnomalousMvcContext context)
        {
            NavigationModel navModel = context.getModel <NavigationModel>(NavigationModelName);

            if (navModel != null)
            {
                NavigationLink namedAction = navModel.getAt(Index);
                if (namedAction != null)
                {
                    context.queueRunAction(namedAction.Action);
                }
                else
                {
                    Log.Warning("Cannot find navigation link at index '{0}' in navigation model '{1}'. Has it been setup properly?", Index, NavigationModelName);
                }
            }
            else
            {
                Log.Warning("Cannot find navigation model '{0}'. Has it been setup properly?", NavigationModelName);
            }
        }