Exemple #1
0
        public override void AddToUI(IModifier m)
        {
            modifier_ = m as EyesModifier;
            if (modifier_ == null)
            {
                return;
            }

            widgets_.AddToUI(current_);
            widgets_.AddToUI(currentPos_);
            widgets_.AddToUI(head_);
            widgets_.AddToUI(eyes_);

            widgets_.AddToUI(saccade_);

            foreach (var w in saccadeTime_.GetWidgets())
            {
                widgets_.AddToUI(w);
            }

            widgets_.AddToUI(saccadeMin_);
            widgets_.AddToUI(saccadeMax_);

            foreach (var w in focusDuration_.GetWidgets())
            {
                widgets_.AddToUI(w);
            }

            widgets_.AddToUI(currentfocusDuration_);
            widgets_.AddToUI(focusDurationProgress_);

            widgets_.AddToUI(minDistance_);

            base.AddToUI(m);
        }
Exemple #2
0
 public Preview(EyesModifier m, EyesTargetContainer tc, float alpha)
 {
     modifier = m;
     t        = tc;
     alpha_   = alpha * AlphaFactor;
     Create();
 }
Exemple #3
0
        private void CopyTo(EyesModifier m, int cloneFlags)
        {
            base.CopyTo(m, cloneFlags);

            m.head_     = head_;
            m.eyes_     = eyes_;
            m.lookMode_ = lookMode_;
            m.chest_    = chest_;

            m.targets_.Clear();
            foreach (var t in targets_)
            {
                m.targets_.Add(t.Clone(cloneFlags));
            }

            m.saccadeTime_ = saccadeTime_.Clone(cloneFlags);

            if (!Bits.IsSet(cloneFlags, Utilities.CloneZero))
            {
                m.saccadeMin_.Value = saccadeMin_.Value;
                m.saccadeMax_.Value = saccadeMax_.Value;
                m.saccadeOffset_    = saccadeOffset_;
            }

            m.minDistance_.Value = minDistance_.Value;
            m.focusDuration_     = focusDuration_.Clone(cloneFlags);
            m.gazeSetting_       = gazeSetting_;
            m.gaze_         = gaze_.Clone(cloneFlags);
            m.blinkSetting_ = blinkSetting_;
        }
Exemple #4
0
        public override IModifier Clone(int cloneFlags = 0)
        {
            var m = new EyesModifier();

            CopyTo(m, cloneFlags);
            return(m);
        }
Exemple #5
0
        public EyesModifierTargetUIContainer(EyesModifier m, EyesTargetContainer t)
        {
            modifier_  = m;
            container_ = t;

            delete_ = new ConfirmableButton(
                "Delete target", DeleteTarget, Widget.Right);

            types_ = new FactoryStringList <EyesTargetFactory, IEyesTarget>(
                "Type", TypeChanged, Widget.Right);

            enabled_ = new Checkbox(
                "Enabled", t.Enabled, EnabledChanged, Widget.Right);

            collapsible_ = new Collapsible(
                container_.Name, null, Widget.Right);

            UpdateWidgets();
        }
Exemple #6
0
        public override void AddToTopUI(IModifier m)
        {
            var changed = (m != modifier_);

            modifier_ = m as EyesModifier;

            previews_.Modifier = modifier_;
            previews_.Create();

            if (modifier_ == null)
            {
                return;
            }

            if (modifier_.Targets.Count != targets_.Count)
            {
                changed = true;
            }

            if (changed)
            {
                targets_.Clear();

                foreach (var t in modifier_.Targets)
                {
                    targets_.Add(
                        new EyesModifierTargetUIContainer(modifier_, t));
                }
            }


            saccadeTime_.SetValue(
                modifier_.SaccadeTime, new FloatRange(0, 5));
            focusDuration_.SetValue(
                modifier_.FocusDuration, new FloatRange(0, 1));
            saccadeMin_.Parameter  = modifier_.SaccadeMinParameter;
            saccadeMax_.Parameter  = modifier_.SaccadeMaxParameter;
            minDistance_.Parameter = modifier_.MinDistanceParameter;
            previewsEnabled_.Value = previews_.Enabled;
            previewsAlpha_.Value   = previews_.Alpha;

            UpdateGaze();
            UpdateBlink();

            AddAtomWidgets(m);
            widgets_.AddToUI(saccade_);
            widgets_.AddToUI(focusDurationCollapsible_);
            widgets_.AddToUI(minDistance_);
            widgets_.AddToUI(gaze_);
            widgets_.AddToUI(blink_);
            widgets_.AddToUI(new SmallSpacer(Widget.Right));
            widgets_.AddToUI(addTarget_);
            widgets_.AddToUI(previewsEnabled_);
            widgets_.AddToUI(previewsAlpha_);

            if (targets_.Count > 0)
            {
                widgets_.AddToUI(new SmallSpacer(Widget.Right));
                foreach (var t in targets_)
                {
                    widgets_.AddToUI(t.Collapsible);
                }
            }

            widgets_.AddToUI(new LargeSpacer(Widget.Right));
            widgets_.AddToUI(new LargeSpacer(Widget.Right));

            base.AddToTopUI(m);
        }