Example #1
0
 protected void notifyPointChanged(int pointNum)
 {
     if (!IsTypical)
     {
         PointChanged?.Invoke(pointNum);
     }
 }
Example #2
0
 /// <summary>
 /// On point property changed method
 /// </summary>
 protected virtual void OnPointChanged()
 {
     if (PointChanged != null)
     {
         PointChanged.Invoke();
     }
 }
 private void OnPointChanged()
 {
     if (ModelSpaceCoordinate.Point != _cachedModelSpacePoint)
     {
         PointChanged?.Invoke();
     }
 }
 private void notifyPointChanged(int numPoints)
 {
     if (!IsTypical)
     {
         PointChanged?.Invoke(numPoints);
     }
 }
Example #5
0
		public void ChangePoint(Tuple<int, Point> param)
		{
			if(param == null)
			{
				return;
			}

			switch(param.Item1)
			{
				case 0:
					Line1Start = param.Item2;
					break;

				case 1:
					Line1End = param.Item2;
					break;

				case 2:
					Line2Start = param.Item2;
					break;

				case 3:
					Line2End = param.Item2;
					break;

				default:
					return;
			}

			CalcIntersection();

			PointChanged?.Invoke(this, null);
		}
Example #6
0
 private void textBox1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         PointChanged?.Invoke(p);
     }
 }
Example #7
0
		public void Initialize()
		{
			Line1Start = new Point(50.0, 50.0);
			Line1End   = new Point(250.0, 250.0);
			Line2Start = new Point(50.0, 250.0);
			Line2End   = new Point(250.0, 50.0);
			IsCross    = false;
			CrossPoint = new Point(0.0, 0.0);

			CalcIntersection();

			PointChanged?.Invoke(this, null);
		}
Example #8
0
 private void SampleRefreshIcon_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "TouchPoint")
     {
         TouchPoint = (Drawable as SampleDrawable).TouchPoint;
         PointChanged?.Invoke(this, EventArgs.Empty);
     }
     else if (e.PropertyName == "IsFocused")
     {
         IsDrawableFocused = (Drawable as SampleDrawable).IsFocused;
         FocusChanged?.Invoke(this, EventArgs.Empty);
     }
 }
Example #9
0
        private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            switch ((sender as Slider).Name)
            {
            case "X":
                Point.X = e.NewValue;
                break;

            case "Y":
                Point.Y = e.NewValue;
                break;

            case "Z":
                Point.Z = e.NewValue;
                break;

            default: throw new Exception($"Invalid Slider Name: {(sender as Slider).Name}");
            }
            Label.Content = (Name != null ? $"{Name}: " : "") + $"X={SliderX.Value}, Y={SliderY.Value}, Z={SliderZ.Value}";
            PointChanged?.Invoke(this, Point);
        }
Example #10
0
        /// <summary>
        /// Transforms the Items that belong to this Gizmo.
        /// </summary>
        /// <param name="xChange">Input for x axis.</param>
        /// <param name="yChange">Input for y axis.</param>
        /// <returns>TRUE if an operation was performed, FALSE if nothing was done.</returns>
        public bool TransformAffected(float xChange, float yChange, EditorCamera cam)
        {
            // don't operate with an invalid axis seleciton, or invalid mode
            if ((selectedAxes == GizmoSelectedAxes.NONE) || (!enabled))
            {
                return(false);
            }

            if ((xChange == 0) && (yChange == 0))
            {
                return(false);
            }

            float yFlip = -1;             // I don't think we'll ever need to mess with this
            float xFlip = 1;

            float xOff = 0.0f, yOff = 0.0f, zOff = 0.0f, axisDot = 0.0f;

            Vector3 axisDirection = new Vector3();

            switch (selectedAxes)
            {
            case GizmoSelectedAxes.X_AXIS:
                axisDirection = new Vector3(1, 0, 0);
                axisDot       = Vector3.Dot(cam.Look, axisDirection);
                xFlip         = (axisDot > 0) ? 1 : -1;
                xOff          = xChange * xFlip;
                break;

            case GizmoSelectedAxes.Y_AXIS:
                axisDirection = new Vector3(0, 1, 0);
                axisDot       = Vector3.Dot(cam.Look, axisDirection);
                yOff          = yChange * yFlip;
                break;

            case GizmoSelectedAxes.Z_AXIS:
                axisDirection = new Vector3(0, 0, 1);
                axisDot       = Vector3.Dot(cam.Look, axisDirection);
                xFlip         = (axisDot > 0) ? -1 : 1;
                zOff          = xChange * xFlip;
                break;

            case GizmoSelectedAxes.XY_AXIS:
                xOff = xChange; yOff = yChange * yFlip;
                break;

            case GizmoSelectedAxes.XZ_AXIS:
                xOff = xChange; zOff = yChange;
                break;

            case GizmoSelectedAxes.ZY_AXIS:
                zOff = xChange; yOff = yChange * yFlip;
                break;
            }

            affectedPoint.X += xOff;
            affectedPoint.Y += yOff;
            affectedPoint.Z += zOff;


            PointChanged?.Invoke(this);

            return(true);
        }
 private void OnViewPortChanged()
 {
     PointChanged?.Invoke();
 }
Example #12
0
 protected virtual void OnPointChanged() => PointChanged?.Invoke(X, Y);
Example #13
0
 private void raisePointChanged(ITECObject sender, int num)
 {
     PointChanged?.Invoke(num);
 }
Example #14
0
 protected void invokePointChanged(int pointNum)
 {
     PointChanged?.Invoke(pointNum);
 }
Example #15
0
 private void OnPointChanged()
 {
     PointChanged?.Invoke();
 }
Example #16
0
 private void collectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e, string collectionName)
 {
     if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
     {
         int       pointNumber  = 0;
         CostBatch costs        = new CostBatch();
         bool      pointChanged = false;
         bool      costChanged  = false;
         foreach (object item in e.NewItems)
         {
             if (item is INotifyPointChanged pointItem)
             {
                 pointNumber += pointItem.PointNumber;
                 pointChanged = true;
             }
             if (item is INotifyCostChanged costItem)
             {
                 costs      += costItem.CostBatch;
                 costChanged = true;
             }
             notifyCombinedChanged(Change.Add, collectionName, this, item);
             if (item is TECTypical typical)
             {
                 costChanged  = false;
                 pointChanged = false;
             }
         }
         if (pointChanged)
         {
             PointChanged?.Invoke(pointNumber);
         }
         if (costChanged)
         {
             CostChanged?.Invoke(costs);
         }
     }
     else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
     {
         int       pointNumber  = 0;
         CostBatch costs        = new CostBatch();
         bool      pointChanged = false;
         bool      costChanged  = false;
         foreach (object item in e.OldItems)
         {
             if (item is INotifyPointChanged pointItem)
             {
                 pointNumber += pointItem.PointNumber;
                 pointChanged = true;
             }
             if (item is INotifyCostChanged costItem)
             {
                 costs      += costItem.CostBatch;
                 costChanged = true;
             }
             notifyCombinedChanged(Change.Remove, collectionName, this, item);
             if (item is TECTypical typ)
             {
                 if (typ.Instances.Count == 0)
                 {
                     costChanged  = false;
                     pointChanged = false;
                 }
                 foreach (TECSystem instance in typ.Instances)
                 {
                     foreach (TECSubScope subScope in instance.GetAllSubScope())
                     {
                         TECController parentController = subScope.Connection?.ParentController;
                         if (parentController != null && this.Controllers.Contains(parentController))
                         {
                             parentController.Disconnect(subScope);
                         }
                     }
                     foreach (TECController controller in instance.Controllers)
                     {
                         TECController parentController = controller.ParentConnection?.ParentController;
                         if (parentController != null && this.Controllers.Contains(parentController))
                         {
                             parentController.Disconnect(controller);
                         }
                     }
                 }
             }
         }
         if (pointChanged)
         {
             PointChanged?.Invoke(pointNumber * -1);
         }
         if (costChanged)
         {
             CostChanged?.Invoke(costs * -1);
         }
     }
     else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Move)
     {
         notifyCombinedChanged(Change.Edit, collectionName, this, sender, sender);
     }
 }
Example #17
0
 protected void OnPointChanged()
 {
     PointChanged?.Invoke(this, new PointChangedEventArgs());
 }
Example #18
0
 private void button1_Click(object sender, EventArgs e)
 {
     PointChanged?.Invoke(p);
     Set?.Invoke();
 }
Example #19
0
 public void PointsChanged(MasteryIcon src, int amount)
 {
     Points = 0;
     Points = Rows.Sum(r => r.Points);
     PointChanged?.Invoke(src, Points);
 }
Example #20
0
 protected virtual void OnPointChanged(Point e)
 {
     PointChanged?.Invoke(this, e);
 }