예제 #1
0
        private IIntentStates _GetElementIntentList(Guid elementId)
        {
            IIntentStates elementIntentList;

            if (!_elementStates.TryGetValue(elementId, out elementIntentList))
            {
                elementIntentList         = new IntentStateList();
                _elementStates[elementId] = elementIntentList;
            }
            return(elementIntentList);
        }
예제 #2
0
 public void AddElementState(Guid elementId, IIntentState state)
 {
     lock (_elementStates)
     {
         IIntentStates elementIntentList;
         if (!_elementStates.TryGetValue(elementId, out elementIntentList))
         {
             elementIntentList         = new IntentStateList(4);
             _elementStates[elementId] = elementIntentList;
         }
         elementIntentList.AddIntentState(state);
     }
 }
예제 #3
0
        private static Color ProcessIntentNodes(KeyValuePair <Guid, IntentNodeCollection> effectIntent, TimeSpan effectRelativeTime)
        {
            IntentStateList states = new IntentStateList();

            foreach (IIntentNode intentNode in effectIntent.Value)
            {
                if (TimeNode.IntersectsInclusively(intentNode, effectRelativeTime))
                {
                    IIntentState intentState = intentNode.CreateIntentState(effectRelativeTime - intentNode.StartTime, SequenceLayers.GetDefaultLayer());
                    states.Add(intentState);
                }
            }

            return(IntentHelpers.GetOpaqueRGBMaxColorForIntents(states));
        }
예제 #4
0
        private static Dictionary <Color, DiscreteValue> ProcessDiscreteIntentNodes(KeyValuePair <Guid, IntentNodeCollection> effectIntent, TimeSpan effectRelativeTime)
        {
            IntentStateList states = new IntentStateList();

            foreach (IIntentNode intentNode in effectIntent.Value)
            {
                if (TimeNode.IntersectsInclusively(intentNode, effectRelativeTime))
                {
                    IIntentState intentState = intentNode.CreateIntentState(effectRelativeTime - intentNode.StartTime, SequenceLayers.GetDefaultLayer());
                    states.Add(intentState);
                }
            }

            return(GetAlphaDiscreteColorsForIntents(states));
        }
예제 #5
0
        private static Color ProcessIntentNodes(KeyValuePair<Guid, IntentNodeCollection> effectIntent, TimeSpan effectRelativeTime)
        {
            IntentStateList states = new IntentStateList();
            foreach (IIntentNode intentNode in effectIntent.Value)
            {
                if (TimeNode.IntersectsInclusively(intentNode, effectRelativeTime))
                {
                    IIntentState intentState = intentNode.CreateIntentState(effectRelativeTime - intentNode.StartTime, SequenceLayers.GetDefaultLayer());
                    states.Add(intentState);
                }
            }

            return IntentHelpers.GetOpaqueRGBMaxColorForIntents(states);
        }
예제 #6
0
        private static Dictionary<Color, DiscreteValue> ProcessDiscreteIntentNodes(KeyValuePair<Guid, IntentNodeCollection> effectIntent, TimeSpan effectRelativeTime)
        {
            IntentStateList states = new IntentStateList();
            foreach (IIntentNode intentNode in effectIntent.Value)
            {
                if (TimeNode.IntersectsInclusively(intentNode, effectRelativeTime))
                {
                    IIntentState intentState = intentNode.CreateIntentState(effectRelativeTime - intentNode.StartTime, SequenceLayers.GetDefaultLayer());
                    states.Add(intentState);
                }
            }

            return GetAlphaDiscreteColorsForIntents(states);
        }