Ejemplo n.º 1
0
        public myCtcRectangle(AnnotationBase ab)
        {
            base.AnnotationType        = AnnotationType.CtcRectangle;
            base.Calibration           = ab.Calibration;
            base.SlideZoom             = ab.SlideZoom;
            base.ControlName           = ab.ControlName;
            base.AnnotationDescription = ab.AnnotationDescription;
            base.CurrentStart          = ab.CurrentStart;
            base.CurrentEnd            = ab.CurrentEnd;
            base.Size           = ab.Size;
            base.BorderBrush    = ab.BorderBrush;
            base.isVisble       = ab.isVisble;
            base.isHidden       = ab.isHidden;
            base.isMsVisble     = ab.isMsVisble;
            base.AnnotationName = ab.AnnotationName;
            base.isFinish       = true;
            base.Zoom           = ab.Zoom;
            base.msi            = ab.msi;
            base.FiguresCanvas  = ab.FiguresCanvas;
            base.objectlist     = ab.objectlist;
            base.AnnoControl    = ab.AnnoControl;
            m_rectangle         = new Rectangle();
            m_rectangle.Name    = ab.ControlName;
            Point point  = MsiToCanvas(base.CurrentStart);
            Point point2 = MsiToCanvas(base.CurrentEnd);

            m_rectangle.SetValue(Canvas.LeftProperty, point.X);
            m_rectangle.SetValue(Canvas.TopProperty, point.Y);
            m_rectangle.Width           = point2.X - point.X;
            m_rectangle.Height          = point2.Y - point.Y;
            m_rectangle.StrokeThickness = base.Size;
            m_rectangle.Stroke          = base.BorderBrush;
            M_FiguresCanvas.Children.Add(m_rectangle);
        }
Ejemplo n.º 2
0
        public myPin(AnnotationBase ab)
        {
            base.AnnotationType        = AnnotationType.Remark;
            base.ControlName           = ab.ControlName;
            base.Calibration           = ab.Calibration;
            base.SlideZoom             = ab.SlideZoom;
            base.AnnotationDescription = ab.AnnotationDescription;
            base.CurrentStart          = ab.CurrentStart;
            base.CurrentEnd            = ab.CurrentEnd;
            base.Size           = ab.Size;
            base.FontColor      = ab.FontColor;
            base.isVisble       = ab.isVisble;
            base.isHidden       = ab.isHidden;
            base.isMsVisble     = ab.isMsVisble;
            base.AnnotationName = ab.AnnotationName;
            base.FontBold       = ab.FontBold;
            base.FontItalic     = ab.FontItalic;
            base.FontSize       = ab.FontSize;
            base.PinType        = ab.PinType;
            base.isFinish       = true;
            base.Zoom           = ab.Zoom;
            base.msi            = ab.msi;
            base.FiguresCanvas  = ab.FiguresCanvas;
            base.objectlist     = ab.objectlist;
            base.AnnoControl    = ab.AnnoControl;
            Point point = MsiToCanvas(base.CurrentStart);

            newImage        = new Image();
            newImage.Name   = base.ControlName;
            newImage.Source = new BitmapImage(new Uri(base.PinType, UriKind.Relative));
            newImage.Width  = 40.0;
            newImage.SetValue(Canvas.LeftProperty, point.X - 20.0);
            newImage.SetValue(Canvas.TopProperty, point.Y - 20.0);
            M_FiguresCanvas.Children.Add(newImage);
            base.OriginStart  = point;
            base.CurrentStart = CanvasToMsi(point);
            base.CurrentEnd   = base.CurrentStart;
            CreateMTextBlock();
            CreateThumb();
            myImage.MouseLeftButtonDown += Pin_MouseDown;
            myImage.MouseEnter          += GotFocus;
            base.objectlist.Insert(0, this);
            UpdateCB();
            base.UpadteTextBlock();
            IsActive(Visibility.Collapsed);
            base.AnnoControl.CB.SelectedIndex = -1;
        }
Ejemplo n.º 3
0
 public myPolyline(AnnotationBase ab)
 {
     m_originalPoints           = new PointCollection();
     m_CurrentPoints            = new PointCollection();
     base.Calibration           = ab.Calibration;
     base.SlideZoom             = ab.SlideZoom;
     base.AnnotationType        = AnnotationType.Polygon;
     base.AnnotationDescription = ab.AnnotationDescription;
     base.ControlName           = ab.ControlName;
     base.Zoom          = ab.Zoom;
     m_CurrentPoints    = ab.PointCollection;
     base.msi           = ab.msi;
     base.isMsVisble    = ab.isMsVisble;
     base.FiguresCanvas = ab.FiguresCanvas;
     base.objectlist    = ab.objectlist;
     base.AnnoControl   = ab.AnnoControl;
     foreach (Point currentPoint in m_CurrentPoints)
     {
         m_originalPoints.Add(MsiToCanvas(currentPoint));
     }
     base.OriginStart           = new Point(m_originalPoints.Min((Point p) => p.X), m_originalPoints.Min((Point p) => p.Y));
     base.OriginEnd             = new Point(m_originalPoints.Max((Point p) => p.X), m_originalPoints.Max((Point p) => p.Y));
     base.CurrentStart          = CanvasToMsi(base.OriginStart);
     base.CurrentEnd            = CanvasToMsi(base.OriginEnd);
     base.Size                  = ab.Size;
     base.BorderBrush           = ab.BorderBrush;
     base.isVisble              = ab.isVisble;
     base.isHidden              = ab.isHidden;
     base.AnnotationName        = ab.AnnotationName;
     base.isFinish              = true;
     m_polyline                 = new Polyline();
     m_polyline.StrokeThickness = base.Size;
     m_polyline.Stroke          = base.BorderBrush;
     m_polyline.Name            = base.ControlName;
     m_polyline.Points          = OriginalPoints;
     M_FiguresCanvas.Children.Add(m_polyline);
     base.objectlist.Insert(0, this);
     CreateMTextBlock();
     UpdateCB();
     CreateThumb();
     m_polyline.MouseLeftButtonDown += Select_MouseDown;
     m_polyline.MouseEnter          += GotFocus;
     base.UpadteTextBlock();
     IsActive(Visibility.Collapsed);
     base.AnnoControl.CB.SelectedIndex = -1;
 }
Ejemplo n.º 4
0
        public myDiyCtcRectangle(AnnotationBase ab)
        {
            base.AnnotationType        = AnnotationType.DiyCtcRectangle;
            base.Calibration           = ab.Calibration;
            base.SlideZoom             = ab.SlideZoom;
            base.ControlName           = ab.ControlName;
            base.AnnotationDescription = ab.AnnotationDescription;
            base.CurrentStart          = ab.CurrentStart;
            base.CurrentEnd            = ab.CurrentEnd;
            base.Size           = ab.Size;
            base.BorderBrush    = ab.BorderBrush;
            base.isVisble       = ab.isVisble;
            base.isHidden       = ab.isHidden;
            base.isMsVisble     = ab.isMsVisble;
            base.AnnotationName = ab.AnnotationName;
            base.isFinish       = true;
            base.Zoom           = ab.Zoom;
            base.msi            = ab.msi;
            base.FiguresCanvas  = ab.FiguresCanvas;
            base.objectlist     = ab.objectlist;
            base.AnnoControl    = ab.AnnoControl;
            base.FontSize       = ab.FontSize;
            m_rectangle         = new Rectangle();
            m_rectangle.Name    = ab.ControlName;
            Point originStart = MsiToCanvas(base.CurrentStart);
            Point originEnd   = MsiToCanvas(base.CurrentEnd);

            base.OriginStart = originStart;
            base.OriginEnd   = originEnd;
            m_rectangle.SetValue(Canvas.LeftProperty, originStart.X);
            m_rectangle.SetValue(Canvas.TopProperty, originStart.Y);
            m_rectangle.Width           = originEnd.X - originStart.X;
            m_rectangle.Height          = originEnd.Y - originStart.Y;
            m_rectangle.StrokeThickness = base.Size;
            m_rectangle.Stroke          = base.BorderBrush;
            M_FiguresCanvas.Children.Add(m_rectangle);
            base.objectlist.Insert(0, this);
            CreateMTextBlock();
            CreateThumb();
            UpdateCB();
            base.UpadteTextBlock();
            IsActive(Visibility.Collapsed);
            base.AnnoControl.CB.SelectedIndex = -1;
        }
Ejemplo n.º 5
0
 public myLine(AnnotationBase ab)
 {
     base.AnnotationType        = AnnotationType.Line;
     base.ControlName           = ab.ControlName;
     base.AnnotationDescription = ab.AnnotationDescription;
     m_line                 = new Line();
     m_line.Name            = ab.ControlName;
     base.Calibration       = ab.Calibration;
     base.SlideZoom         = ab.SlideZoom;
     base.CurrentStart      = ab.CurrentStart;
     base.CurrentEnd        = ab.CurrentEnd;
     base.Size              = ab.Size;
     base.BorderBrush       = ab.BorderBrush;
     base.isVisble          = ab.isVisble;
     base.isHidden          = ab.isHidden;
     base.isMsVisble        = ab.isMsVisble;
     base.isFinish          = true;
     base.Zoom              = ab.Zoom;
     base.AnnotationName    = ab.AnnotationName;
     base.FiguresCanvas     = ab.FiguresCanvas;
     base.objectlist        = ab.objectlist;
     base.AnnoControl       = ab.AnnoControl;
     base.FiguresCanvas     = ab.FiguresCanvas;
     base.objectlist        = ab.objectlist;
     base.AnnoControl       = ab.AnnoControl;
     base.msi               = ab.msi;
     m_line.X1              = MsiToCanvas(ab.CurrentStart).X;
     m_line.Y1              = MsiToCanvas(ab.CurrentStart).Y;
     m_line.X2              = MsiToCanvas(ab.CurrentEnd).X;
     m_line.Y2              = MsiToCanvas(ab.CurrentEnd).Y;
     m_line.StrokeThickness = ab.Size;
     m_line.Stroke          = ab.BorderBrush;
     M_FiguresCanvas.Children.Add(m_line);
     base.objectlist.Insert(0, this);
     CreateMTextBlock();
     CreateThumb();
     UpdateCB();
     m_line.MouseLeftButtonDown += Select_MouseDown;
     m_line.MouseEnter          += GotFocus;
     base.UpadteTextBlock();
     IsActive(Visibility.Collapsed);
     base.AnnoControl.CB.SelectedIndex = -1;
 }
Ejemplo n.º 6
0
        public myEllipse(AnnotationBase ab)
        {
            base.AnnotationType        = AnnotationType.Ellipse;
            base.Calibration           = ab.Calibration;
            base.SlideZoom             = ab.SlideZoom;
            base.ControlName           = ab.ControlName;
            base.AnnotationDescription = ab.AnnotationDescription;
            base.Zoom           = ab.Zoom;
            base.CurrentStart   = ab.CurrentStart;
            base.CurrentEnd     = ab.CurrentEnd;
            base.Size           = ab.Size;
            base.BorderBrush    = ab.BorderBrush;
            base.isVisble       = ab.isVisble;
            base.isHidden       = ab.isHidden;
            base.isMsVisble     = ab.isMsVisble;
            base.AnnotationName = ab.AnnotationName;
            base.isFinish       = true;
            base.msi            = ab.msi;
            base.FiguresCanvas  = ab.FiguresCanvas;
            base.objectlist     = ab.objectlist;
            base.AnnoControl    = ab.AnnoControl;
            m_rectangle         = new Ellipse();
            m_rectangle.Name    = ab.ControlName;
            Point point  = MsiToCanvas(base.CurrentStart);
            Point point2 = MsiToCanvas(base.CurrentEnd);

            m_rectangle.SetValue(Canvas.LeftProperty, point.X);
            m_rectangle.SetValue(Canvas.TopProperty, point.Y);
            m_rectangle.Width           = point2.X - point.X;
            m_rectangle.Height          = point2.Y - point.Y;
            m_rectangle.StrokeThickness = base.Size;
            m_rectangle.Stroke          = base.BorderBrush;
            M_FiguresCanvas.Children.Add(m_rectangle);
            base.objectlist.Insert(0, this);
            CreateMTextBlock();
            CreateThumb();
            UpdateCB();
            m_rectangle.MouseLeftButtonDown += Select_MouseDown;
            m_rectangle.MouseEnter          += GotFocus;
            base.UpadteTextBlock();
            IsActive(Visibility.Collapsed);
            base.AnnoControl.CB.SelectedIndex = -1;
        }
Ejemplo n.º 7
0
        public myArrowLine(AnnotationBase ab)
        {
            base.Calibration           = ab.Calibration;
            base.SlideZoom             = ab.SlideZoom;
            base.AnnotationType        = AnnotationType.Arrow;
            base.ControlName           = ab.ControlName;
            base.Zoom                  = ab.Zoom;
            base.AnnotationDescription = ab.AnnotationDescription;
            base.CurrentStart          = ab.CurrentStart;
            base.CurrentEnd            = ab.CurrentEnd;
            base.Size                  = ab.Size;
            base.BorderBrush           = ab.BorderBrush;
            base.isVisble              = ab.isVisble;
            base.isHidden              = ab.isHidden;
            base.isMsVisble            = ab.isMsVisble;
            base.AnnotationName        = ab.AnnotationName;
            base.isFinish              = true;
            base.msi           = ab.msi;
            base.FiguresCanvas = ab.FiguresCanvas;
            base.objectlist    = ab.objectlist;
            base.AnnoControl   = ab.AnnoControl;
            Cap            = new Line();
            Cap.Name       = base.ControlName + "Cap";
            Connector      = new Line();
            rtf            = new RotateTransform();
            Connector.Name = base.ControlName;
            Point  point  = MsiToCanvas(base.CurrentStart);
            Point  point2 = MsiToCanvas(base.CurrentEnd);
            double angle  = Math.Atan2(point.Y - point2.Y, point.X - point2.X) * 180.0 / Math.PI;

            Connector.X1 = point.X;
            Connector.Y1 = point.Y;
            Connector.X2 = point2.X;
            Connector.Y2 = point2.Y;
            Connector.StrokeThickness = base.Size;
            Connector.Stroke          = base.BorderBrush;
            M_FiguresCanvas.Children.Add(Connector);
            Cap.X1 = point2.X;
            Cap.Y1 = point2.Y;
            Cap.X2 = point2.X;
            Cap.Y2 = point2.Y;
            Cap.StrokeStartLineCap = PenLineCap.Triangle;
            Cap.StrokeThickness    = base.Size + 20.0;
            Cap.Stroke             = base.BorderBrush;
            rtf.Angle           = angle;
            rtf.CenterX         = point2.X;
            rtf.CenterY         = point2.Y;
            Cap.RenderTransform = rtf;
            M_FiguresCanvas.Children.Add(Cap);
            base.objectlist.Insert(0, this);
            CreateMTextBlock();
            CreateThumb();
            UpdateCB();
            Connector.MouseLeftButtonDown += Select_MouseDown;
            Cap.MouseLeftButtonDown       += Select_MouseDown;
            Connector.MouseEnter          += GotFocus;
            Cap.MouseEnter += GotFocus;
            base.UpadteTextBlock();
            IsActive(Visibility.Collapsed);
            base.AnnoControl.CB.SelectedIndex = -1;
        }