public DrawingPlane(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null) { // Decoration styleHelper.Color = Color.Empty; styleHelper.GridDivisions = 8; styleHelper.Perspective = true; styleHelper.ValueChanged += StyleHelper_ValueChanged; if (preset == null) { preset = ToolManager.GetStylePreset("Plane"); } style = preset.Clone(); BindStyle(); infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); infosFading.UseDefault = false; infosFading.AlwaysVisible = true; planeWidth = 100; planeHeight = 100; quadPlane = new QuadrilateralF(planeWidth, planeHeight); mnuCalibrate.Click += new EventHandler(mnuCalibrate_Click); mnuCalibrate.Image = Properties.Drawings.linecalibrate; }
public DrawingLine(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null) { points["a"] = origin; points["b"] = origin.Translate(10, 0); labelMeasure = new KeyframeLabel(GetMiddlePoint(), Color.Black, transformer); styleHelper.Color = Color.DarkSlateGray; styleHelper.LineSize = 1; if (preset == null) { preset = ToolManager.GetStylePreset("Line"); } style = preset.Clone(); BindStyle(); // Fading infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); // Context menu mnuShowMeasure.Click += mnuShowMeasure_Click; mnuShowMeasure.Image = Properties.Drawings.measure; mnuSealMeasure.Click += mnuSealMeasure_Click; mnuSealMeasure.Image = Properties.Drawings.linecalibrate; }
public DrawingPolyline(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null) { points["0"] = origin; points["1"] = origin; styleHelper.Color = Color.DarkSlateGray; styleHelper.LineSize = 1; if (preset == null) { preset = ToolManager.GetStylePreset("Polyline"); } style = preset.Clone(); BindStyle(); infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); mnuFinish.Click += mnuFinish_Click; mnuAddThenFinish.Click += mnuAddThenFinish_Click; mnuCloseMenu.Click += mnuCloseMenu_Click; mnuFinish.Image = Properties.Drawings.tick_small; mnuAddThenFinish.Image = Properties.Drawings.plus_small; mnuCloseMenu.Image = Properties.Drawings.cross_small; }
public DrawingText(Point p, long _iTimestamp, long _iAverageTimeStampsPerFrame, DrawingStyle _preset) { m_Text = " "; m_Background.Rectangle = new Rectangle(p, Size.Empty); // Decoration & binding with editors m_StyleHelper.Bicolor = new Bicolor(Color.Black); m_StyleHelper.Font = new Font("Arial", m_iDefaultFontSize, FontStyle.Bold); if (_preset != null) { m_Style = _preset.Clone(); BindStyle(); } m_InfosFading = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame); m_bEditMode = false; m_TextBox = new TextBox() { Visible = false, BackColor = Color.White, BorderStyle = BorderStyle.None, Multiline = true, Text = m_Text, Font = m_StyleHelper.GetFontDefaultSize(m_iDefaultFontSize) }; m_TextBox.TextChanged += new EventHandler(TextBox_TextChanged); UpdateLabelRectangle(); }
public DrawingToolLine2D() { m_DefaultStylePreset.Elements.Add("color", new StyleElementColor(Color.LightGreen)); m_DefaultStylePreset.Elements.Add("line size", new StyleElementLineSize(2)); m_DefaultStylePreset.Elements.Add("arrows", new StyleElementLineEnding(LineEnding.None)); m_StylePreset = m_DefaultStylePreset.Clone(); }
public DrawingAngle(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null) { int length = 50; if (transformer != null) { length = transformer.Untransform(50); } points.Add("o", origin); points.Add("a", origin.Translate(0, -length)); points.Add("b", origin.Translate(length, 0)); styleHelper.Bicolor = new Bicolor(Color.Empty); styleHelper.Font = new Font("Arial", 12, FontStyle.Bold); if (preset == null) { preset = ToolManager.GetStylePreset("Angle"); } style = preset.Clone(); BindStyle(); // Fading infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); mnuInvertAngle.Click += mnuInvertAngle_Click; mnuInvertAngle.Image = Properties.Drawings.angleinvert; }
//------------------------------------------------------ // Note: // When using the planar calibration, the projection of the circle in world space and back in image space // creates an ellipse whose center is not exactly on the center of the original circle. // This is why there are extra checks to move the minilabel attachment point everytime the drawing moves, // changes size, or when the calibration changes. //------------------------------------------------------ #region Constructor public DrawingCircle(PointF center, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null) { this.center = center; miniLabel.SetAttach(center, true); if (transformer != null) { this.radius = transformer.Untransform(25); } this.radius = Math.Min(radius, 10); this.infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); styleHelper.Color = Color.Empty; styleHelper.LineSize = 1; styleHelper.PenShape = PenShape.Solid; styleHelper.ValueChanged += StyleHelper_ValueChanged; if (preset == null) { preset = ToolManager.GetStylePreset("Circle"); } style = preset.Clone(); BindStyle(); ReinitializeMenu(); }
public DrawingLine(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null) { points["a"] = origin; points["b"] = origin.Translate(10, 0); miniLabel.SetAttach(GetMiddlePoint(), true); styleHelper.Color = Color.DarkSlateGray; styleHelper.LineSize = 1; styleHelper.LineShape = LineShape.Solid; styleHelper.LineEnding = LineEnding.None; styleHelper.ValueChanged += StyleHelper_ValueChanged; if (preset == null) { preset = ToolManager.GetStylePreset("Line"); } style = preset.Clone(); BindStyle(); // Fading infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); // Context menu ReinitializeMenu(); mnuCalibrate.Click += mnuCalibrate_Click; mnuCalibrate.Image = Properties.Drawings.linecalibrate; }
public DrawingChrono(Point p, long start, long _AverageTimeStampsPerFrame, DrawingStyle _preset) { // Core m_iVisibleTimestamp = start; m_iStartCountingTimestamp = long.MaxValue; m_iStopCountingTimestamp = long.MaxValue; m_iInvisibleTimestamp = long.MaxValue; m_bCountdown = false; m_MainBackground.Rectangle = new Rectangle(p, Size.Empty); m_Timecode = "error"; m_StyleHelper.Bicolor = new Bicolor(Color.Black); m_StyleHelper.Font = new Font("Arial", 16, FontStyle.Bold); if (_preset != null) { m_Style = _preset.Clone(); BindStyle(); } m_Label = ""; m_bShowLabel = true; // We use the InfosFading utility to fade the chrono away. // The refererence frame will be the frame at which fading start. // Must be updated on "Hide" menu. m_InfosFading = new InfosFading(m_iInvisibleTimestamp, _AverageTimeStampsPerFrame); m_InfosFading.FadingFrames = m_iAllowedFramesOver; m_InfosFading.UseDefault = false; }
public DrawingToolText() { m_DefaultStylePreset.Elements.Add("back color", new StyleElementColor(Color.CornflowerBlue)); m_DefaultStylePreset.Elements.Add("font size", new StyleElementFontSize(12)); m_StylePreset = m_DefaultStylePreset.Clone(); }
public DrawingText(PointF p, long timestamp, long averageTimeStampsPerFrame, DrawingStyle stylePreset) { text = " "; background.Rectangle = new RectangleF(p, SizeF.Empty); styleHelper.Bicolor = new Bicolor(Color.Black); styleHelper.Font = new Font("Arial", defaultFontSize, FontStyle.Bold); if (stylePreset != null) { style = stylePreset.Clone(); BindStyle(); } infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); editing = false; textBox = new TextBox() { Visible = false, BackColor = Color.White, BorderStyle = BorderStyle.None, Multiline = true, Text = text, Font = styleHelper.GetFontDefaultSize(defaultFontSize) }; textBox.TextChanged += TextBox_TextChanged; UpdateLabelRectangle(); }
public DrawingAngle(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null) { int length = 50; if (transformer != null) { length = transformer.Untransform(50); } points.Add("o", origin); points.Add("a", origin.Translate(length, 0)); points.Add("b", origin.Translate(0, -length)); styleHelper.Bicolor = new Bicolor(Color.Empty); styleHelper.Font = new Font("Arial", 12, FontStyle.Bold); if (preset == null) { preset = ToolManager.GetStylePreset("Angle"); } style = preset.Clone(); BindStyle(); // Fading infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); mnuSignedAngle.Click += mnuSignedAngle_Click; mnuSignedAngle.Checked = signedAngle; mnuCounterClockwise.Click += mnuCounterClockwise_Click; mnuCounterClockwise.Checked = counterClockwise; mnuSupplementaryAngle.Click += mnuSupplementaryAngle_Click; mnuSupplementaryAngle.Checked = supplementaryAngle; }
public DrawingChrono(PointF p, long start, long averageTimeStampsPerFrame, DrawingStyle preset = null) { // Core visibleTimestamp = start; startCountingTimestamp = long.MaxValue; stopCountingTimestamp = long.MaxValue; invisibleTimestamp = long.MaxValue; countdown = false; mainBackground.Rectangle = new RectangleF(p, SizeF.Empty); timecode = "error"; styleHelper.Bicolor = new Bicolor(Color.Black); styleHelper.Font = new Font("Arial", 16, FontStyle.Bold); if (preset == null) { preset = ToolManager.GetStylePreset("Chrono"); } style = preset.Clone(); BindStyle(); label = ""; showLabel = true; // We use the InfosFading utility to fade the chrono away. // The refererence frame will be the frame at which fading start. // Must be updated on "Hide" menu. infosFading = new InfosFading(invisibleTimestamp, averageTimeStampsPerFrame); infosFading.FadingFrames = allowedFramesOver; infosFading.UseDefault = false; }
public AutoNumberManager(DrawingStyle preset) { styleHelper.Bicolor = new Bicolor(Color.Black); styleHelper.Font = new Font("Arial", defaultFontSize, FontStyle.Bold); if (preset != null) { style = preset.Clone(); BindStyle(); } }
public DrawingChrono(PointF p, long start, long averageTimeStampsPerFrame, DrawingStyle preset = null) { // Core visibleTimestamp = 0; startCountingTimestamp = long.MaxValue; stopCountingTimestamp = long.MaxValue; invisibleTimestamp = long.MaxValue; clockOriginTimestamp = long.MaxValue; mainBackground.Rectangle = new RectangleF(p, SizeF.Empty); timecode = "error"; styleHelper.Bicolor = new Bicolor(Color.Black); styleHelper.Font = new Font("Arial", 16, FontStyle.Bold); styleHelper.Clock = false; if (preset == null) { preset = ToolManager.GetStylePreset("Chrono"); } style = preset.Clone(); BindStyle(); label = ""; showLabel = true; // We use the InfosFading utility to fade the chrono away. // The refererence frame will be the frame at which fading start. // Must be updated on "Hide" menu. infosFading = new InfosFading(invisibleTimestamp, averageTimeStampsPerFrame); infosFading.FadingFrames = allowedFramesOver; infosFading.UseDefault = false; mnuVisibility.Image = Properties.Drawings.persistence; mnuShowBefore.Image = Properties.Drawings.showbefore; mnuShowAfter.Image = Properties.Drawings.showafter; mnuHideBefore.Image = Properties.Drawings.hidebefore; mnuHideAfter.Image = Properties.Drawings.hideafter; mnuShowBefore.Click += MnuShowBefore_Click; mnuShowAfter.Click += MnuShowAfter_Click; mnuHideBefore.Click += MnuHideBefore_Click; mnuHideAfter.Click += MnuHideAfter_Click; mnuVisibility.DropDownItems.AddRange(new ToolStripItem[] { mnuShowBefore, mnuShowAfter, new ToolStripSeparator(), mnuHideBefore, mnuHideAfter }); mnuStart.Image = Properties.Drawings.chronostart; mnuStop.Image = Properties.Drawings.chronostop; mnuMarkOrigin.Image = Properties.Resources.marker; mnuStart.Click += mnuStart_Click; mnuStop.Click += mnuStop_Click; mnuMarkOrigin.Click += mnuMarkOrigin_Click; }
public DrawingPencil(Point _origin, Point _second, long _iTimestamp, long _AverageTimeStampsPerFrame, DrawingStyle _preset) { m_PointList.Add(_origin); m_PointList.Add(_second); m_InfosFading = new InfosFading(_iTimestamp, _AverageTimeStampsPerFrame); m_StyleHelper.Color = Color.Black; m_StyleHelper.LineSize = 1; if (_preset != null) { m_Style = _preset.Clone(); BindStyle(); } }
public DrawingTool(Guid id, string name, string displayName, Bitmap icon, Type drawingType, bool attached, bool keepToolAfterDrawingCreation, bool keepToolAfterFrameChange, DrawingStyle defaultStyle) { this.id = id; this.name = name; this.displayName = displayName; this.icon = icon; this.drawingType = drawingType; this.attached = attached; this.keepToolAfterDrawingCreation = keepToolAfterDrawingCreation; this.keepToolAfterFrameChange = keepToolAfterFrameChange; this.defaultStyle = defaultStyle; this.currentStyle = defaultStyle.Clone(); }
public DrawingPencil(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null) { pointList.Add(origin); pointList.Add(origin.Translate(1, 0)); infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); styleHelper.Color = Color.Black; styleHelper.LineSize = 1; if (preset != null) { style = preset.Clone(); BindStyle(); } }
public DrawingCircle(Point _center, int radius, long _iTimestamp, long _iAverageTimeStampsPerFrame, DrawingStyle _preset) { m_Center = _center; m_iRadius = Math.Min(radius, 10); m_InfosFading = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame); m_StyleHelper.Color = Color.Empty; m_StyleHelper.LineSize = 1; if (_preset != null) { m_Style = _preset.Clone(); BindStyle(); } }
public DrawingRectangle(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null) { quadImage = new QuadrilateralF(origin, origin.Translate(50, 0), origin.Translate(50, 50), origin.Translate(0, 50)); styleHelper.Color = Color.Empty; styleHelper.LineSize = 1; styleHelper.PenShape = PenShape.Solid; if (preset == null) { preset = ToolManager.GetStylePreset("Rectangle"); } style = preset.Clone(); BindStyle(); infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); }
public DrawingDistortionGrid(PointF point, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null) { styleHelper.Color = Color.Empty; if (preset == null) { preset = ToolManager.GetStylePreset("DistortionGrid"); } style = preset.Clone(); BindStyle(); infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); infosFading.UseDefault = true; infosFading.AlwaysVisible = false; mnuCalibrate.Click += new EventHandler(mnuCalibrate_Click); mnuCalibrate.Image = Properties.Drawings.linecalibrate; }
public DrawingPlane(int _divisions, bool _support3D, long _iTimestamp, long _iAverageTimeStampsPerFrame, DrawingStyle _preset) { m_iDivisions = _divisions == 0 ? m_iDefaultDivisions : _divisions; m_bSupport3D = _support3D; // Decoration m_StyleHelper.Color = Color.Empty; if (_preset != null) { m_Style = _preset.Clone(); BindStyle(); } m_InfosFading = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame); m_InfosFading.UseDefault = false; m_InfosFading.AlwaysVisible = true; RedefineHomography(); }
public DrawingCrossMark(PointF center, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset, IImageToViewportTransformer transformer) { points["0"] = center; labelCoordinates = new KeyframeLabel(points["0"], Color.Black, transformer); // Decoration & binding with editors styleHelper.Color = Color.CornflowerBlue; if (preset != null) { style = preset.Clone(); BindStyle(); } infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); // Context menu mnuShowCoordinates.Click += new EventHandler(mnuShowCoordinates_Click); mnuShowCoordinates.Image = Properties.Drawings.measure; }
public DrawingCross2D(Point _center, long _iTimestamp, long _iAverageTimeStampsPerFrame, DrawingStyle _preset) { m_Center = _center; m_LabelCoordinates = new KeyframeLabel(m_Center, Color.Black); // Decoration & binding with editors m_StyleHelper.Color = Color.CornflowerBlue; if (_preset != null) { m_Style = _preset.Clone(); BindStyle(); } m_InfosFading = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame); // Context menu mnuShowCoordinates.Click += new EventHandler(mnuShowCoordinates_Click); mnuShowCoordinates.Image = Properties.Drawings.measure; }
public DrawingText(PointF p, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null) { text = ""; background.Rectangle = new RectangleF(p, SizeF.Empty); arrowEnd = p.Translate(-50, -50); showArrow = false; styleHelper.Bicolor = new Bicolor(Color.Black); styleHelper.Font = new Font("Arial", defaultFontSize, FontStyle.Bold); if (preset == null) { preset = ToolManager.GetStylePreset("Label"); } style = preset.Clone(); BindStyle(); infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); editing = false; fontText = styleHelper.GetFontDefaultSize(defaultFontSize); textBox = new TextBox() { Visible = false, BackColor = Color.White, BorderStyle = BorderStyle.None, Multiline = true, Text = text, Font = fontText }; textBox.Margin = new Padding(0, 0, 0, 0); textBox.TextAlign = HorizontalAlignment.Left; textBox.WordWrap = false; textBox.TextChanged += TextBox_TextChanged; UpdateLabelRectangle(); mnuShowArrow.Click += new EventHandler(mnuShowArrow_Click); mnuShowArrow.Image = Properties.Drawings.arrow; }
public DrawingCrossMark(PointF center, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null) { points["0"] = center; miniLabel = new MiniLabel(points["0"], Color.Black, transformer); // Decoration & binding with editors styleHelper.Color = Color.CornflowerBlue; styleHelper.ValueChanged += StyleHelper_ValueChanged; if (preset == null) { preset = ToolManager.GetStylePreset("CrossMark"); } style = preset.Clone(); BindStyle(); infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); ReinitializeMenu(); }
public DrawingCircle(PointF center, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null) { this.center = center; if (transformer != null) { this.radius = transformer.Untransform(25); } this.radius = Math.Min(radius, 10); this.infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); styleHelper.Color = Color.Empty; styleHelper.LineSize = 1; if (preset == null) { preset = ToolManager.GetStylePreset("Circle"); } style = preset.Clone(); BindStyle(); }
public DrawingPlane(bool inPerspective, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset) { this.inPerspective = inPerspective; // Decoration styleHelper.Color = Color.Empty; styleHelper.GridDivisions = 8; if (preset != null) { style = preset.Clone(); BindStyle(); } infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame); infosFading.UseDefault = false; infosFading.AlwaysVisible = true; planeWidth = 100; planeHeight = 100; quadPlane = new QuadrilateralF(planeWidth, planeHeight); mnuCalibrate.Click += new EventHandler(mnuCalibrate_Click); mnuCalibrate.Image = Properties.Drawings.linecalibrate; }
public DrawingCoordinateSystem(Point origin, DrawingStyle stylePreset) { points["0"] = origin; // Decoration & binding with editors styleHelper.Bicolor = new Bicolor(Color.Empty); styleHelper.Font = new Font("Arial", 8, FontStyle.Bold); if (stylePreset != null) { style = stylePreset.Clone(); BindStyle(); } // Context menu menuShowAxis.Click += menuShowAxis_Click; menuShowGrid.Click += menuShowGrid_Click; menuShowGraduations.Click += menuShowGraduations_Click; menuHide.Click += menuHide_Click; menuShowAxis.Image = Properties.Drawings.coordinates_axis; menuShowGrid.Image = Properties.Drawings.coordinates_grid; menuShowGraduations.Image = Properties.Drawings.coordinates_graduations; menuHide.Image = Properties.Drawings.hide; }
public DrawingAngle2D(Point o, Point a, Point b, long _iTimestamp, long _iAverageTimeStampsPerFrame, DrawingStyle _stylePreset) { // Core m_PointO = o; m_PointA = a; m_PointB = b; ComputeValues(); // Decoration and binding to mini editors. m_StyleHelper.Bicolor = new Bicolor(Color.Empty); m_StyleHelper.Font = new Font("Arial", 12, FontStyle.Bold); if (_stylePreset != null) { m_Style = _stylePreset.Clone(); BindStyle(); } // Fading m_InfosFading = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame); // Context menu m_mnuInvertAngle.Click += new EventHandler(mnuInvertAngle_Click); m_mnuInvertAngle.Image = Properties.Drawings.angleinvert; }