public vtkPlaneCollection GenerateNewPlaneCollection(ClipingEventArgs args)
        {
            try
            {
                switch (args.Type)
                {
                    case (EClipingModuleOperationType.X1):
                        _planeCollection.GetItem(0).SetOrigin(args.Position, 0, 0);
                        break;
                    case (EClipingModuleOperationType.X2):
                        _planeCollection.GetItem(1).SetOrigin(_xSize - args.Position, 0, 0);
                        break;
                    case (EClipingModuleOperationType.Y1):
                        _planeCollection.GetItem(2).SetOrigin(0, args.Position, 0);
                        break;
                    case (EClipingModuleOperationType.Y2):
                        _planeCollection.GetItem(3).SetOrigin(0, _ySize - args.Position, 0);
                        break;
                    case (EClipingModuleOperationType.Z1):
                        _planeCollection.GetItem(4).SetOrigin(0, 0, args.Position);
                        break;
                    case (EClipingModuleOperationType.Z2):
                        _planeCollection.GetItem(5).SetOrigin(0, 0, _zSize - args.Position);
                        break;
                }

            }catch(Exception e)
            {
                //logger
            }
            return _planeCollection;
        }
 private void InvokeOnHandler(EClipingModuleOperationType type, int value)
 {
     if (this.ClipingOperationEventHandlerDelegate != null)
     {
         EventArgs e2 = new ClipingEventArgs()
         {
             Type     = type,
             Position = value,
         };
         object[] args = new object[] { null, e2 };
         foreach (Delegate handler in this.ClipingOperationEventHandlerDelegate.GetInvocationList())
         {
             handler.DynamicInvoke(args);
         }
     }
 }
예제 #3
0
        /// <summary>
        /// Changes cliping plane position.
        /// </summary>
        /// <param name="args">EventArgs with operation type and new plane position</param>
        /// <returns>Modified plane</returns>
        public vtkPlaneCollection Clip(ClipingEventArgs args)
        {
            try
            {
                switch (args.Type)
                {
                case (EClipingModuleOperationType.X1):
                    _planeCollection.GetItem(0).SetOrigin(args.Position, 0, 0);
                    break;

                case (EClipingModuleOperationType.X2):
                    _planeCollection.GetItem(1).SetOrigin(_xSize - args.Position, 0, 0);
                    break;

                case (EClipingModuleOperationType.Y1):
                    _planeCollection.GetItem(2).SetOrigin(0, args.Position, 0);
                    break;

                case (EClipingModuleOperationType.Y2):
                    _planeCollection.GetItem(3).SetOrigin(0, _ySize - args.Position, 0);
                    break;

                case (EClipingModuleOperationType.Z1):
                    _planeCollection.GetItem(4).SetOrigin(0, 0, args.Position);
                    break;

                case (EClipingModuleOperationType.Z2):
                    _planeCollection.GetItem(5).SetOrigin(0, 0, _zSize - args.Position);
                    break;
                }
            }catch (Exception e)
            {
                logger.ErrorException("Cliping opeartion exception.", e);
                return(null);
            }
            return(_planeCollection);
        }
예제 #4
0
        public vtkPlaneCollection GenerateNewPlaneCollection(ClipingEventArgs args)
        {
            try
            {
                switch (args.Type)
                {
                case (EClipingModuleOperationType.X1):
                    _planeCollection.GetItem(0).SetOrigin(args.Position, 0, 0);
                    break;

                case (EClipingModuleOperationType.X2):
                    _planeCollection.GetItem(1).SetOrigin(_xSize - args.Position, 0, 0);
                    break;

                case (EClipingModuleOperationType.Y1):
                    _planeCollection.GetItem(2).SetOrigin(0, args.Position, 0);
                    break;

                case (EClipingModuleOperationType.Y2):
                    _planeCollection.GetItem(3).SetOrigin(0, _ySize - args.Position, 0);
                    break;

                case (EClipingModuleOperationType.Z1):
                    _planeCollection.GetItem(4).SetOrigin(0, 0, args.Position);
                    break;

                case (EClipingModuleOperationType.Z2):
                    _planeCollection.GetItem(5).SetOrigin(0, 0, _zSize - args.Position);
                    break;
                }
            }catch (Exception e)
            {
                //logger
            }
            return(_planeCollection);
        }
 private void InvokeOnHandler(EClipingModuleOperationType type, int value)
 {
     if (this.ClipingOperationEventHandlerDelegate != null)
     {
         EventArgs e2 = new ClipingEventArgs()
         {
             Type = type,
             Position = value,
         };
         object[] args = new object[] { null, e2 };
         foreach (Delegate handler in this.ClipingOperationEventHandlerDelegate.GetInvocationList())
         {
             handler.DynamicInvoke(args);
         }
     }
 }
 /// <summary>
 /// Handler for ClipingEvent - reacts for cliping volume and update 3D view
 /// </summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="args">Event arguments</param>
 public void ExecuteClipingOperation(object sender, ClipingEventArgs args)
 {
     _mapper.SetClippingPlanes(_clipingModule.Clip(args));
     Update3DVisualization();
 }
 public void ExecuteClipingOperation(object sender, ClipingEventArgs args)
 {
     _mapper.SetClippingPlanes(_clipingModule.GenerateNewPlaneCollection(args));
     Update3DVisualization();
 }
        /// <summary>
        /// Changes cliping plane position.
        /// </summary>
        /// <param name="args">EventArgs with operation type and new plane position</param>
        /// <returns>Modified plane</returns>
        public vtkPlaneCollection Clip(ClipingEventArgs args)
        {
            try
            {
                switch (args.Type)
                {
                    case (EClipingModuleOperationType.X1):
                        _planeCollection.GetItem(0).SetOrigin(args.Position, 0, 0);
                        break;
                    case (EClipingModuleOperationType.X2):
                        _planeCollection.GetItem(1).SetOrigin(_xSize - args.Position, 0, 0);
                        break;
                    case (EClipingModuleOperationType.Y1):
                        _planeCollection.GetItem(2).SetOrigin(0, args.Position, 0);
                        break;
                    case (EClipingModuleOperationType.Y2):
                        _planeCollection.GetItem(3).SetOrigin(0, _ySize - args.Position, 0);
                        break;
                    case (EClipingModuleOperationType.Z1):
                        _planeCollection.GetItem(4).SetOrigin(0, 0, args.Position);
                        break;
                    case (EClipingModuleOperationType.Z2):
                        _planeCollection.GetItem(5).SetOrigin(0, 0, _zSize - args.Position);
                        break;
                }

            }catch(Exception e)
            {
                logger.ErrorException("Cliping opeartion exception.", e);
                return null;
            }
            return _planeCollection;
        }