Ejemplo n.º 1
0
        public void ChangeBoundary(BoundaryDirection direction, float delta)
        {
            switch (direction)
            {
            case BoundaryDirection.Forward:
                m_forward = m_forward + delta;
                break;

            case BoundaryDirection.Backward:
                m_backward = m_backward + delta;
                break;

            case BoundaryDirection.Leftward:
                m_leftward = m_leftward + delta;
                break;

            case BoundaryDirection.Rightward:
                m_rightward = m_rightward + delta;
                break;

            case BoundaryDirection.Upward:
                m_upward = m_upward + delta;
                break;

            case BoundaryDirection.Downward:
                m_downward = m_downward + delta;
                break;
            }
        }
 internal MetricBoundaryCondition(double?lowerBound, double?upperBound, BoundaryDirection direction, string companionMetricId, bool?triggerForMissing)
 {
     LowerBound        = lowerBound;
     UpperBound        = upperBound;
     Direction         = direction;
     CompanionMetricId = companionMetricId;
     TriggerForMissing = triggerForMissing;
 }
Ejemplo n.º 3
0
 internal MetricBoundaryCondition(double?lowerBound, double?upperBound, BoundaryDirection direction, ValueType?type, string companionMetricId, bool?shouldAlertIfDataPointMissing)
 {
     LowerBound                    = lowerBound;
     UpperBound                    = upperBound;
     Direction                     = direction;
     Type                          = type;
     CompanionMetricId             = companionMetricId;
     ShouldAlertIfDataPointMissing = shouldAlertIfDataPointMissing;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Returns the <see cref="BoundaryKind"/> of the <see cref="Boundary{T}"/> at location d of the result of intersecting another <see cref="IIntervalSet{T}"/>
        /// with a <see cref="Boundary{T}"/> at d with an <see cref="IIntervalSet{T}"/> with this kind of <see cref="Boundary{T}"/> at d
        /// </summary>
        /// <returns></returns>
        public BoundaryKind Cross(BoundaryKind other)
        {
            BoundaryDirection crossDirection   = Direction & other.Direction;
            Inclusivity       crossInclusivity = Inclusivity & other.Inclusivity;

            if (crossDirection == BoundaryDirection.None && crossInclusivity == Inclusivity.Exclusive)
            {
                return(null);
            }
            return(new BoundaryKind(crossDirection, crossInclusivity));
        }
Ejemplo n.º 5
0
        private BoundedUIObjectEventArgs GetEventArgsByHandles(BoundaryDirection direction)
        {
            var   dic  = new Dictionary <BoundaryDirection, float>();
            float temp = 0f;

            switch (direction)
            {
            case BoundaryDirection.Forward:
                temp = Vector3.Dot((m_forwardHandle.Position - m_boudary.Center.position), transform.forward);
                dic.Add(BoundaryDirection.Forward, temp / m_boudary.Forward);
                break;

            case BoundaryDirection.Backward:
                temp = Vector3.Dot((m_backwardHandle.Position - m_boudary.Center.position), -transform.forward);
                dic.Add(BoundaryDirection.Backward, temp / m_boudary.Backward);
                break;

            case BoundaryDirection.Leftward:
                temp = Vector3.Dot((m_leftwardHandle.Position - m_boudary.Center.position), -transform.right);
                dic.Add(BoundaryDirection.Leftward, temp / m_boudary.Leftward);
                break;

            case BoundaryDirection.Rightward:
                temp = Vector3.Dot((m_rightwardHandle.Position - m_boudary.Center.position), transform.right);
                dic.Add(BoundaryDirection.Rightward, temp / m_boudary.Rightward);
                break;

            case BoundaryDirection.Upward:
                temp = Vector3.Dot((m_upwardHandle.Position - m_boudary.Center.position), transform.up);
                dic.Add(BoundaryDirection.Upward, temp / m_boudary.Upward);
                break;

            case BoundaryDirection.Downward:
                temp = Vector3.Dot((m_downwardHandle.Position - m_boudary.Center.position), -transform.up);
                dic.Add(BoundaryDirection.Downward, temp / m_boudary.Downward);
                break;
            }
            var args = new BoundedUIObjectEventArgs(dic);

            return(args);
        }
Ejemplo n.º 6
0
 public HistoricalBoundaryValue(float value, BoundaryDirection direction, float weight)
     : base(value, weight)
 {
     this.Direction = direction;
 }
 public MetricBoundaryCondition(BoundaryDirection direction)
 {
     Direction = direction;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Deserializes a <see cref="BoundaryKind"/>
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 protected BoundaryKind(SerializationInfo info, StreamingContext context)
 {
     Direction   = (BoundaryDirection)info.GetValue("Direction", typeof(BoundaryDirection));
     Inclusivity = (Inclusivity)info.GetValue("Inclusivity", typeof(Inclusivity));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new <see cref="BoundaryKind"/> with a given <see cref="BoundaryDirection"/> and <see cref="Kind.Inclusivity"/>
 /// </summary>
 protected BoundaryKind(BoundaryDirection direction, Inclusivity inclusivity)
 {
     Direction   = direction;
     Inclusivity = inclusivity;
 }