예제 #1
0
        public TableLayoutPanelForProjection(CurrentTrajectory currentTrajectory, DisplayChoice displayChoice)
        {
            InitializeComponent();
            BorderStyle     = BorderStyle.None;
            CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
            RowCount        = 1;
            AutoScroll      = true;
            Dock            = DockStyle.Fill;

            this.CurrentTrajectory = currentTrajectory;
            zoomInformation        = new ZoomInformationOfView();
            this.displayChoice     = displayChoice;

            ColumnCount = 3;
            this.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33));
            this.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33));
            this.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33));

            mainViewPanel = new PanelForProjection(Vector3.UnitY, CurrentTrajectory, zoomInformation, displayChoice);
            leftViewPanel = new PanelForProjection(Vector3.UnitX, CurrentTrajectory, zoomInformation, displayChoice);
            topViewPanel  = new PanelForProjection(Vector3.UnitZ, CurrentTrajectory, zoomInformation, displayChoice);

            this.SuspendLayout();
            this.Controls.Add(mainViewPanel, 0, 0);
            this.Controls.Add(leftViewPanel, 1, 0);
            this.Controls.Add(topViewPanel, 2, 0);
            this.ResumeLayout();
        }
예제 #2
0
        public PanelForProjection(Vector3 normalVector, CurrentTrajectory currentTrajectory, ZoomInformationOfView zoomInformation, DisplayChoice displayChoice)
        {
            //initialize panel property
            Dock        = DockStyle.Fill;
            BorderStyle = BorderStyle.None;
            Name        = Projection.GetProjectionView(normalVector);

            this.currentTrajectory = currentTrajectory;
            this.currentTrajectory.PropertyChanged += UpdateParameters;
            this.normalVector  = normalVector;
            this.displayChoice = displayChoice;
            //zoom and drag
            isDrag               = false;
            isChoosingRegion     = false;
            this.zoomInformation = zoomInformation;

            UpdateParameters();

            //Initialize drawing property
            numberOfDataInAxisX    = 5;
            numberOfDataInAxisY    = 10;
            spaceHeightForViewName = 25;
            segementLength         = 5;
            marginAxis             = 10;
            widthOfCoordinate      = 50;
            heightOfCoordinate     = 18;
            widthOfAxisName        = 35;
            heightOfAxisName       = 18;
            leftPaddingX           = segementLength * 3 / 2 + marginAxis + widthOfCoordinate + 5;
            rightPaddingX          = segementLength / 2 + marginAxis + widthOfAxisName + 5;
            paddingY = segementLength * 3 / 2 + marginAxis + Math.Max(heightOfAxisName, heightOfCoordinate) + 5;

            //tool tip
            toolTipForAnnotation = new ToolTip()
            {
                AutoPopDelay = 50000,
                InitialDelay = 500,
                ReshowDelay  = 100,
                ShowAlways   = true,
            };

            Paint      += new PaintEventHandler(PaintPanel);
            MouseMove  += new MouseEventHandler(Panel_MouseMove);
            MouseDown  += new MouseEventHandler(Panel_MouseDown);
            MouseUp    += new MouseEventHandler(Panel_MouseUp);
            MouseWheel += new MouseEventHandler(Panel_MouseWheel);

            //MouseHover += new EventHandler(Panel_MouseHover);
        }