public formConfigureTrajectoryDisplay(DrawingTrack track, Metadata metadata, Bitmap image, long timestamp, Action invalidate)
        {
            InitializeComponent();

            this.track   = track;
            memoStatus   = track.Status;
            track.Status = TrackStatus.Configuration;
            track.TrackerParametersChanged += new EventHandler(track_TrackParametersChanged);
            this.invalidate = invalidate;
            this.timestamp  = timestamp;

            pnlViewport.Controls.Add(viewportController.View);
            viewportController.View.Dock = DockStyle.Fill;

            viewportController.Bitmap    = image;
            viewportController.Timestamp = timestamp;

            InitializeDisplayRectangle(image.Size, timestamp);
            metadataRenderer    = new MetadataRenderer(metadata);
            metadataManipulator = new MetadataManipulator(metadata, screenToolManager);
            metadataManipulator.SetFixedTimestamp(timestamp);
            metadataManipulator.SetFixedKeyframe(-1);

            viewportController.MetadataRenderer    = metadataRenderer;
            viewportController.MetadataManipulator = metadataManipulator;

            viewportController.Refresh();

            track.DrawingStyle.ReadValue();

            // Save the current state in case of cancel.
            track.MemorizeState();
            track.DrawingStyle.Memorize();

            InitViewCombo();
            InitMarkerCombo();
            InitExtraDataCombo();
            chkBestFitCircle.Checked = track.DisplayBestFitCircle;
            InitTrackParameters();
            SetupStyleControls();
            SetCurrentOptions();
            InitCulture();

            interactionTimer.Interval = 15;
            interactionTimer.Tick    += InteractionTimer_Tick;
            interactionTimer.Start();
        }
Ejemplo n.º 2
0
        private void InitializeMetadata()
        {
            metadata = new Metadata(historyStack, null);
            // TODO: hook to events raised by metadata.

            LoadCompanionKVA();

            if (metadata.Count == 0)
            {
                Keyframe kf = new Keyframe(0, "capture", metadata);
                metadata.AddKeyframe(kf);
            }

            metadataRenderer    = new MetadataRenderer(metadata);
            metadataManipulator = new MetadataManipulator(metadata, screenToolManager);

            viewportController.MetadataRenderer    = metadataRenderer;
            viewportController.MetadataManipulator = metadataManipulator;
        }