Beispiel #1
0
        public ScaleDialog(MedicalViewer control, Medical3DContainer container, ItemType type, int objectIndex)
        {
            InitializeComponent();

            _oldPoint    = new Medical3DPoint();
            _type        = type;
            _control     = control;
            _container   = container;
            _objectIndex = objectIndex;

            switch (type)
            {
            case ItemType.Camera:
                Text        = "Zoom Camera Dialog";
                _oldPoint.Y = container.Camera.Zoom;
                break;

            case ItemType.Object:
                Text        = "Scale Object Dialog";
                _oldPoint.X = container.Objects[objectIndex].XScale;
                _oldPoint.Y = container.Objects[objectIndex].YScale;
                _oldPoint.Z = container.Objects[objectIndex].ZScale;
                break;
            }

            _textBoxX.Value = (int)(_oldPoint.X * 1000);
            _textBoxY.Value = (int)(_oldPoint.Y * 1000);
            _textBoxZ.Value = (int)(_oldPoint.Z * 1000);
        }
Beispiel #2
0
        void UpdatePlanePointNormal()
        {
            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_viewer.Cells[0];

            switch (_type)
            {
            case Medical3DVolumeType.MIP:
                normal = _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].Normal;
                point  = _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].Point;
                break;

            case Medical3DVolumeType.VRT:
                normal = _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].Normal;
                point  = _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].Point;
                break;

            case Medical3DVolumeType.MPR:
                normal = _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].Normal;
                point  = _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].Point;
                break;
            }

            _textBoxPointX.Value  = point.X;
            _textBoxPointY.Value  = point.Y;
            _textBoxPointZ.Value  = point.Z;
            _textBoxNormalX.Value = normal.X;
            _textBoxNormalY.Value = normal.Y;
            _textBoxNormalZ.Value = normal.Z;
        }
Beispiel #3
0
        public MoveDialog(MedicalViewer viewer, Medical3DContainer container, ItemType type, int objectIndex)
        {
            InitializeComponent();

            _oldPoint    = new Medical3DPoint();
            _type        = type;
            _viewer      = viewer;
            _container   = container;
            _objectIndex = objectIndex;

            switch (type)
            {
            case ItemType.Camera:
                Text        = "Move Camera Dialog";
                _oldPoint.X = container.Camera.XOffset;
                _oldPoint.Y = container.Camera.YOffset;
                _oldPoint.Z = container.Camera.ZOffset;
                _textBoxZ.MaximumAllowed = 4000;
                _textBoxZ.MinimumAllowed = 0;
                _trackBarZ.Maximum       = 4000;
                _trackBarZ.Minimum       = 0;
                break;

            case ItemType.Object:
                Text        = "Move Object Dialog";
                _oldPoint.X = container.Objects[objectIndex].XOffset;
                _oldPoint.Y = container.Objects[objectIndex].YOffset;
                _oldPoint.Z = container.Objects[objectIndex].ZOffset;
                break;
            }

            _textBoxX.Value = (int)(_oldPoint.X * 1000);
            _textBoxY.Value = (int)(_oldPoint.Y * 1000);
            _textBoxZ.Value = (int)(_oldPoint.Z * 1000);
        }
Beispiel #4
0
        public RotateDialog(MedicalViewer control, Medical3DContainer container, ItemType type, int objectIndex)
        {
            InitializeComponent();

            _type        = type;
            _control     = control;
            _container   = container;
            _objectIndex = objectIndex;
            _oldPoint    = new Medical3DPoint();

            switch (type)
            {
            case ItemType.Camera:
                Text = "Rotate Camera Dialog";
                _textBoxX.MinimumAllowed = -180;
                _textBoxY.MinimumAllowed = -90;
                _textBoxZ.MinimumAllowed = 0;

                _textBoxX.MaximumAllowed = 180;
                _textBoxY.MaximumAllowed = 90;
                _textBoxZ.MaximumAllowed = 360;

                _trackBarX.Minimum = -180;
                _trackBarY.Minimum = -90;
                _trackBarZ.Minimum = 0;

                _trackBarX.Maximum = 180;
                _trackBarY.Maximum = 90;
                _trackBarZ.Maximum = 360;

                _oldPoint.X = container.Camera.XRotation;
                _oldPoint.Y = container.Camera.YRotation;
                _oldPoint.Z = container.Camera.AxialRotation;

                break;

            case ItemType.Object:
                Text        = "Rotate Object Dialog";
                _oldPoint.X = container.Objects[objectIndex].XRotation;
                _oldPoint.Y = container.Objects[objectIndex].YRotation;
                _oldPoint.Z = container.Objects[objectIndex].ZRotation;
                break;
            }

            _textBoxX.Value = (int)_oldPoint.X;
            _textBoxY.Value = (int)_oldPoint.Y;
            _textBoxZ.Value = (int)_oldPoint.Z;
        }
Beispiel #5
0
        private void GetPlanePoint()
        {
            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_viewer.Cells[0];

            switch (_type)
            {
            case Medical3DVolumeType.VRT:
                point = _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].Point;
                break;

            case Medical3DVolumeType.MIP:
                point = _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].Point;
                break;

            case Medical3DVolumeType.MPR:
                point = _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].Point;
                break;
            }
        }
Beispiel #6
0
        private void _btnOK_Click(object sender, EventArgs e)
        {
            Medical3DPoint point1 = new Medical3DPoint(_textBoxPoint1X.Value, _textBoxPoint1Y.Value, _textBoxPoint1Z.Value);
            Medical3DPoint point2 = new Medical3DPoint(_textBoxPoint2X.Value, _textBoxPoint2Y.Value, _textBoxPoint2Z.Value);
            Medical3DPoint point3 = new Medical3DPoint(_textBoxPoint3X.Value, _textBoxPoint3Y.Value, _textBoxPoint3Z.Value);

            switch (type)
            {
            case Medical3DVolumeType.VRT:
                _planeIndex = container.Objects[container.CurrentObjectIndex].VRT.Planes.Count - 1;
                break;

            case Medical3DVolumeType.MIP:
                _planeIndex = container.Objects[container.CurrentObjectIndex].MIP.Planes.Count - 1;
                break;

            case Medical3DVolumeType.MPR:
                _planeIndex = container.Objects[container.CurrentObjectIndex].MPR.Planes.Count - 1;
                break;
            }

            try
            {
                switch (type)
                {
                case Medical3DVolumeType.MIP:
                    container.Objects[container.CurrentObjectIndex].MIP.Planes[_planeIndex].SetPlanePoints(point1, point2, point3);
                    break;

                case Medical3DVolumeType.VRT:
                    container.Objects[container.CurrentObjectIndex].VRT.Planes[_planeIndex].SetPlanePoints(point1, point2, point3);
                    break;

                case Medical3DVolumeType.MPR:
                    container.Objects[container.CurrentObjectIndex].MPR.Planes[_planeIndex].SetPlanePoints(point1, point2, point3);
                    break;
                }
            }
            catch (System.Exception ex)
            {
                Messager.ShowError(this, ex);
            }
        }
Beispiel #7
0
        void applyNewValue(bool old)
        {
            if (_dontApply)
            {
                return;
            }

            Medical3DPoint currentPoint;
            Medical3DPoint currentNormal;

            if (old)
            {
                currentPoint  = new Medical3DPoint(point.X, point.Y, point.Z);
                currentNormal = new Medical3DPoint(normal.X, normal.Y, normal.Z);
            }
            else
            {
                currentPoint  = new Medical3DPoint(_textBoxPointX.Value, _textBoxPointY.Value, _textBoxPointZ.Value);
                currentNormal = new Medical3DPoint(_textBoxNormalX.Value, _textBoxNormalY.Value, _textBoxNormalZ.Value);
            }

            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_viewer.Cells[0];

            switch (_type)
            {
            case Medical3DVolumeType.MIP:
                _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].Point  = currentPoint;
                _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].Normal = currentNormal;
                break;

            case Medical3DVolumeType.VRT:
                _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].Point  = currentPoint;
                _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].Normal = currentNormal;
                break;

            case Medical3DVolumeType.MPR:
                _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].Point  = currentPoint;
                _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].Normal = currentNormal;
                break;
            }

            cell3D.Invalidate();
        }