1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840 |
- using Metis.Measuring;
- using PaintDotNet.Annotation.Enum;
- using PaintDotNet.Base;
- using PaintDotNet.Data.Param;
- using PaintDotNet.Measuring;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Windows.Forms;
- namespace PaintDotNet.Menus
- {
- /// <summary>
- /// 图像测量菜单
- /// </summary>
- internal sealed class MeasureActionMenu : PdnMenuItem
- {
- public static ArrayList ArrayList1;
- public static ArrayList ArrayList2;
- public static ArrayList ArrayList3;
- public static bool InitKb = true;
- private PdnMenuItem menuChoiseAction;
- private PdnMenuItem menuSelectAllAction;
- private PdnMenuItem menuContinuousDrawingAction;
- private PdnMenuItem menuClearAllAction;
- private ToolStripSeparator menuHelpSeparator1;
- private PdnMenuItem menuOpticalDensity;
- private PdnMenuItem menuBitmapAnalysis;
- private ToolStripSeparator menuHelpSeparator2;
- private PdnMenuItem menuLengthMeasurement;
- private PdnMenuItem menuMultiPointLineSegment;
- private PdnMenuItem menuCurveLength;
- private PdnMenuItem menuPointPerpendicular;
- private PdnMenuItem menuParallelLines;
- private PdnMenuItem menuPolygonMeasurement;
- private PdnMenuItem menuCircularMeasurement;
- private PdnMenuItem menuAngleMeasurement;
- private PdnMenuItem menuRegistrationMeasurement;
- private ToolStripSeparator menuHelpSeparator3;
- private PdnMenuItem menuRulerCalibration;
- private PdnMenuItem menuMeasureList;
- private PdnMenuItem menuTheoreticalScale;
- private PdnMenuItem menuGeometryMeasure;
- //标尺标定子菜单
- //标尺标定
- private PdnMenuItem menuSubRulerCalibration;
- //应用当前
- private PdnMenuItem menuSubApplyCurrent;
- //应用全部
- private PdnMenuItem menuSubApplyAll;
- //长度测量子菜单
- //直线
- private PdnMenuItem menuStraightLine;
- //长度
- private PdnMenuItem menuLengthLine;
- //水平线
- private PdnMenuItem menuHorizontalLine;
- //垂线
- private PdnMenuItem menuPerpendicular;
- //垂线
- private PdnMenuItem menuDistance;
- //多点线段子菜单
- //多点直线
- private PdnMenuItem menuMultipointStraightLine;
- //多点水平线
- private PdnMenuItem menuMultipointHorizontalLine;
- //多点线段
- private PdnMenuItem menuMultipointLineSegment1;
- //多点垂直线
- private PdnMenuItem menuMultipointVerticalLine;
- //曲线长度子菜单
- //折线
- private PdnMenuItem menuPolyline;
- //轨迹曲线
- private PdnMenuItem menuTraceCurve;
- //曲线
- private PdnMenuItem menuCurve;
- //点垂线子菜单
- //点垂线
- private PdnMenuItem menuPointVertical;
- //多点垂线
- private PdnMenuItem menuMultiPointVertical;
- //水平多点垂线
- private PdnMenuItem menuHorizontalMultipointVertical;
- //垂直多点垂线
- private PdnMenuItem menuVerticalMultipointVertical;
- //点到水平线距离
- private PdnMenuItem menuPointToHLine;
- //平行线测量子菜单
- //平行线
- private PdnMenuItem menuParallelLine;
- //多点平行线
- private PdnMenuItem menuMultipointParallel;
- //多点水平平行线
- private PdnMenuItem menuMultipointHorizontalParallelLines;
- //多点垂直平行线
- private PdnMenuItem menuMultipointVerticalParallelLines;
- //多边形测量子菜单
- //闭合曲线
- private PdnMenuItem menuClosedCurve;
- //多边形
- private PdnMenuItem menuPolygon;
- //矩形
- private PdnMenuItem menuRectangle;
- //任意矩形
- private PdnMenuItem menuArbitraryRectangle;
- //正方形
- private PdnMenuItem menuSquare;
- //任意正方形
- private PdnMenuItem menuArbitrarySquare;
- //轨迹多边形
- private PdnMenuItem menuTrackPolygon;
- //圆形测量子菜单
- //三点圆
- private PdnMenuItem menuThreePointCircle;
- //向内画圆
- private PdnMenuItem menuDrawCircleInward;
- //向外画圆
- private PdnMenuItem menuDrawCircleOutward;
- //直径画圆
- private PdnMenuItem menuDiameterCircle;
- //点到圆距离
- private PdnMenuItem menuPointToCircleDistance;
- //点到圆心距离
- private PdnMenuItem menuPointToCenterDistance;
- //点到圆弧距离
- private PdnMenuItem menuPointToArcDistance;
- //角度测量子菜单
- //三点角度
- private PdnMenuItem menuThreePointAngle;
- //四点角度
- private PdnMenuItem menuFourPointAngle;
- //三点弧
- private PdnMenuItem menuThreePointArc;
- // 对准度测量子菜单
- //圆心到圆心距离
- private PdnMenuItem menuCenterToCenterDistance;
- //两线中垂线距离
- private PdnMenuItem menuTwoLineVLDistance;
- /// <summary>
- /// 图像测量
- /// </summary>
- public MeasureActionMenu(int menuId)
- {
- InitializeComponent();
- this.MenuId = menuId;
- this.AutomaticScript = false;
- }
- protected override void OnAppWorkspaceChanged()
- {
- base.OnAppWorkspaceChanged();
- }
- private void InitializeComponent()
- {
- this.menuChoiseAction = new PdnMenuItem(ActionType.MeasureSelect);
- this.menuSelectAllAction = new PdnMenuItem(ActionType.SelectAllMeasure);
- this.menuContinuousDrawingAction = new PdnMenuItem(ActionType.ContinuousDrawingMeasure, true);
- this.menuClearAllAction = new PdnMenuItem(ActionType.ClearAllMeasure);
- this.menuHelpSeparator1 = new ToolStripSeparator();
- this.menuOpticalDensity = new PdnMenuItem(ActionType.OpticalDensity);
- this.menuBitmapAnalysis = new PdnMenuItem(ActionType.BitmapAnalysis);
- this.menuHelpSeparator2 = new ToolStripSeparator();
- this.menuLengthMeasurement = new PdnMenuItem(ActionType.LengthMeasurement);
- this.menuMultiPointLineSegment = new PdnMenuItem(ActionType.MultiPointLineSegment);
- this.menuCurveLength = new PdnMenuItem(ActionType.CurveLength);
- this.menuPointPerpendicular = new PdnMenuItem(ActionType.PointPerpendicular);
- this.menuParallelLines = new PdnMenuItem(ActionType.ParallelLines);
- this.menuPolygonMeasurement = new PdnMenuItem(ActionType.PolygonMeasurement);
- this.menuCircularMeasurement = new PdnMenuItem(ActionType.CircularMeasurement);
- this.menuAngleMeasurement = new PdnMenuItem(ActionType.AngleMeasurement);
- this.menuRegistrationMeasurement = new PdnMenuItem(ActionType.RegistrationMeasurement);
- this.menuHelpSeparator3 = new ToolStripSeparator();
- this.menuMeasureList = new PdnMenuItem(ActionType.MeasureList);
- this.menuRulerCalibration = new PdnMenuItem(ActionType.RulerCalibration);
- this.menuTheoreticalScale = new PdnMenuItem(ActionType.TheoreticalScale);
- this.menuSubRulerCalibration = new PdnMenuItem(ActionType.SubRulerCalibration);
- this.menuSubApplyCurrent = new PdnMenuItem(ActionType.SubApplyCurrent);
- this.menuSubApplyAll = new PdnMenuItem(ActionType.SubApplyAll);
- this.menuStraightLine = new PdnMenuItem(ActionType.StraightLine);
- this.menuLengthLine = new PdnMenuItem(ActionType.LengthLine);
- this.menuHorizontalLine = new PdnMenuItem(ActionType.HorizontalLine);
- this.menuPerpendicular = new PdnMenuItem(ActionType.Perpendicular);
- this.menuDistance = new PdnMenuItem(ActionType.StraightDistanceLine);
- this.menuMultipointStraightLine = new PdnMenuItem(ActionType.MultipointStraightLine);
- this.menuMultipointHorizontalLine = new PdnMenuItem(ActionType.MultipointLineSegment1);
- this.menuMultipointLineSegment1 = new PdnMenuItem(ActionType.MultipointHorizontalLine);
- this.menuMultipointVerticalLine = new PdnMenuItem(ActionType.MultipointVerticalLine);
- this.menuPolyline = new PdnMenuItem(ActionType.Polyline);
- this.menuCurve = new PdnMenuItem(ActionType.Curve);
- this.menuTraceCurve = new PdnMenuItem(ActionType.TraceCurve);
- this.menuPointVertical = new PdnMenuItem(ActionType.PointVertical);
- this.menuMultiPointVertical = new PdnMenuItem(ActionType.MultiPointVertical);
- this.menuHorizontalMultipointVertical = new PdnMenuItem(ActionType.HorizontalMultipointVertical);
- this.menuVerticalMultipointVertical = new PdnMenuItem(ActionType.VerticalMultipointVertical);
- this.menuPointToHLine = new PdnMenuItem(ActionType.menuPointToHLine);
- this.menuParallelLine = new PdnMenuItem(ActionType.ParallelLine);
- this.menuMultipointParallel = new PdnMenuItem(ActionType.MultipointParallel);
- this.menuMultipointHorizontalParallelLines = new PdnMenuItem(ActionType.MultipointHorizontalParallelLines);
- this.menuMultipointVerticalParallelLines = new PdnMenuItem(ActionType.MultipointVerticalParallelLines);
- this.menuClosedCurve = new PdnMenuItem(ActionType.ClosedCurve);
- this.menuPolygon = new PdnMenuItem(ActionType.Polygon);
- this.menuRectangle = new PdnMenuItem(ActionType.Rectangle);
- this.menuArbitraryRectangle = new PdnMenuItem(ActionType.ArbitraryRectangle);
- this.menuSquare = new PdnMenuItem(ActionType.Square);
- this.menuArbitrarySquare = new PdnMenuItem(ActionType.ArbitrarySquare);
- this.menuTrackPolygon = new PdnMenuItem(ActionType.TrackPolygon);
- this.menuThreePointCircle = new PdnMenuItem(ActionType.ThreePointCircle);
- this.menuDrawCircleInward = new PdnMenuItem(ActionType.DrawCircleInward);
- this.menuDrawCircleOutward = new PdnMenuItem(ActionType.DrawCircleOutward);
- this.menuDiameterCircle = new PdnMenuItem(ActionType.DiameterCircle);
- this.menuPointToCircleDistance = new PdnMenuItem(ActionType.PointToCircleDistance);
- this.menuPointToCenterDistance = new PdnMenuItem(ActionType.PointToCenterDistance);
- this.menuPointToArcDistance = new PdnMenuItem(ActionType.PointToArcDistance);
- this.menuThreePointAngle = new PdnMenuItem(ActionType.ThreePointAngle);
- this.menuFourPointAngle = new PdnMenuItem(ActionType.FourPointAngle);
- this.menuThreePointArc = new PdnMenuItem(ActionType.ThreePointArc);
- this.menuCenterToCenterDistance = new PdnMenuItem(ActionType.CenterToCenterDistance);
- this.menuTwoLineVLDistance = new PdnMenuItem(ActionType.TwoLineVLDistance);
- this.menuGeometryMeasure = new PdnMenuItem(ActionType.GeometryMeasure);
- //
- // 主菜单
- //
- this.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuChoiseAction,
- this.menuSelectAllAction,
- this.menuContinuousDrawingAction,
- this.menuClearAllAction,
- this.menuHelpSeparator1,
- this.menuOpticalDensity,
- this.menuBitmapAnalysis,
- this.menuHelpSeparator2,
- this.menuLengthMeasurement,
- this.menuMultiPointLineSegment,
- this.menuCurveLength,
- this.menuCircularMeasurement,
- this.menuAngleMeasurement,
- this.menuRegistrationMeasurement,
- this.menuPointPerpendicular,
- this.menuParallelLines,
- this.menuPolygonMeasurement,
- this.menuHelpSeparator3,
- this.menuMeasureList,
- this.menuRulerCalibration,
- this.menuTheoreticalScale,
- this.menuGeometryMeasure
- });
- this.Name = "Menu.MeasureAction";
- this.Text = PdnResources.GetString("Menu.MeasureAction.Text");
- //
- // 选择
- //
- this.menuChoiseAction.NeedWaitKey = true;
- this.menuChoiseAction.Click += new EventHandler(MenuChoiseAction_Click);
- //
- // 全选
- //
- this.menuSelectAllAction.NeedWaitKey = true;
- this.menuSelectAllAction.Click += new EventHandler(MenuSelectAllAction_Click);
- //
- // 连续绘制
- //
- this.menuContinuousDrawingAction.NeedWaitKey = true;
- this.menuContinuousDrawingAction.Click += new EventHandler(MenuContinuousDrawingAction_Click);
- //
- // 清空元素
- //
- this.menuClearAllAction.Click += new EventHandler(MenuClearAllAction_Click);
- //
- // 光密度
- //
- this.menuOpticalDensity.NeedWaitKey = true;
- this.menuOpticalDensity.Click += new EventHandler(MenuOpticalDensity_Click);
- //
- // 位图分析
- //
- this.menuBitmapAnalysis.Click +=new EventHandler(BitmapAnalysis_Click);
- //
- // 长度测量
- //
- this.menuLengthMeasurement.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuStraightLine,
- this.menuLengthLine,
- this.menuHorizontalLine,
- this.menuPerpendicular,
- this.menuDistance
- });
- //
- // 多点线段
- //
- this.menuMultiPointLineSegment.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuMultipointStraightLine,
- this.menuMultipointLineSegment1,
- this.menuMultipointHorizontalLine,
- this.menuMultipointVerticalLine
- });
- //
- // 曲线长度
- //
- this.menuCurveLength.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuPolyline,
- this.menuCurve,
- this.menuTraceCurve
- });
- //
- // 点垂线测量
- //
- this.menuPointPerpendicular.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuPointVertical,
- this.menuMultiPointVertical,
- this.menuHorizontalMultipointVertical,
- this.menuVerticalMultipointVertical,
- this.menuPointToHLine
- });
- //
- // 平行线测量
- //
- this.menuParallelLines.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuParallelLine,
- this.menuMultipointParallel,
- this.menuMultipointHorizontalParallelLines,
- this.menuMultipointVerticalParallelLines
- });
- //
- // 多边形测量
- //
- this.menuPolygonMeasurement.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuClosedCurve,
- this.menuPolygon,
- this.menuRectangle,
- this.menuArbitraryRectangle,
- this.menuSquare,
- this.menuArbitrarySquare,
- this.menuTrackPolygon
- });
- //
- // 圆形测量
- //
- this.menuCircularMeasurement.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuThreePointCircle,
- this.menuDrawCircleInward,
- this.menuDrawCircleOutward,
- this.menuDiameterCircle,
- this.menuPointToCircleDistance,
- this.menuPointToCenterDistance,
- this.menuPointToArcDistance
- });
- //
- // 角度测量
- //
- this.menuAngleMeasurement.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuThreePointAngle,
- this.menuFourPointAngle,
- this.menuThreePointArc
- });
- this.menuRegistrationMeasurement.Image = PdnResources.GetImageResource("Icons.MenuMeasureRegistrationMeasurementIcon.png").Reference;
- this.menuRegistrationMeasurement.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuCenterToCenterDistance,
- this.menuTwoLineVLDistance
- });
- //
- // 标尺标定
- //
- //this.menuRulerCalibration.NeedWaitKey = true;
- this.menuRulerCalibration.DropDownItems.AddRange(new ToolStripItem[] {
- this.menuSubRulerCalibration,
- this.menuSubApplyCurrent,
- this.menuSubApplyAll
- });
-
- //this.menuRulerCalibration.Click += new EventHandler(MenuRulerCalibration_Click);
- //
- // 测量列表
- //
- this.menuMeasureList.NeedWaitKey = true;
- this.menuMeasureList.Click += new EventHandler(MenuMeasureList_Click);
- //
- // 理论比例尺
- //
- this.menuTheoreticalScale.Click += new EventHandler(TheoreticalScale_Click);
- //
- // 以下是子菜单
- //
- //
- // 标尺标定(子菜单)
- //
- this.menuSubRulerCalibration.Text = PdnResources.GetString("Menu.MeasureAction.RulerCalibration.Text");
- this.menuSubRulerCalibration.NeedWaitKey = true;
- this.menuSubRulerCalibration.Click += new EventHandler(MenuRulerCalibration_Click);
- this.menuSubRulerCalibration.Image = PdnResources.GetImageResource("Icons.MenuRulerCalibration.png").Reference;
- //
- // 应用当前
- //
- this.menuSubApplyCurrent.Text = PdnResources.GetString("Menu.Imagement.Rulersetting.current.text");
- this.menuSubApplyCurrent.NeedWaitKey = true;
- this.menuSubApplyCurrent.Click += new EventHandler(MenuSubApplyCurrent_Click);
- this.menuSubApplyCurrent.Image = PdnResources.GetImageResource("Icons.MenuNow.png").Reference;
- //
- // 应用全部
- //
- this.menuSubApplyAll.Text = PdnResources.GetString("Menu.Binaryoperation.Binaryextraction.Applytoall.text");
- this.menuSubApplyAll.NeedWaitKey = true;
- this.menuSubApplyAll.Click += new EventHandler(MenuSubApplyAll_Click);
- this.menuSubApplyAll.Image = PdnResources.GetImageResource("Icons.MenuAll.png").Reference;
- //
- // 直线
- //
- this.menuStraightLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLine.Text");
- this.menuStraightLine.NeedWaitKey = true;
- this.menuStraightLine.Click += new EventHandler(MenuStraightLine_Click);
- this.menuStraightLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureLineIcon.png").Reference;
- //
- //
- // 距离
- //
- this.menuDistance.Text = PdnResources.GetString("Menu.MeasureAction.MeasureDistanceLine.Text");
- this.menuDistance.NeedWaitKey = true;
- this.menuDistance.Click += new EventHandler(MenuDistance_Click);
- this.menuDistance.Image = PdnResources.GetImageResource("Icons.MenuMeasureLineIcon.png").Reference;
- //
- // 长度
- //
- this.menuLengthLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text");
- this.menuLengthLine.NeedWaitKey = true;
- this.menuLengthLine.Click += new EventHandler(MenuLengthLine_Click);
- this.menuLengthLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureLengthIcon.png").Reference;
- //
- // 水平线
- //
- this.menuHorizontalLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureHLine.Text");
- this.menuHorizontalLine.NeedWaitKey = true;
- this.menuHorizontalLine.Click += new EventHandler(MenuHorizontalLine_Click);
- this.menuHorizontalLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureHLineIcon.png").Reference;
- //
- // 垂线
- //
- this.menuPerpendicular.Text = PdnResources.GetString("Menu.MeasureAction.MeasureVLine.Text");
- this.menuPerpendicular.NeedWaitKey = true;
- this.menuPerpendicular.Click += new EventHandler(MenuPerpendicular_Click);
- this.menuPerpendicular.Image = PdnResources.GetImageResource("Icons.MenuMeasureVLineIcon.png").Reference;
- //
- // 多点直线
- //
- this.menuMultipointStraightLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureMulLine.Text");
- this.menuMultipointStraightLine.NeedWaitKey = true;
- this.menuMultipointStraightLine.Click += new EventHandler(menuMultipointStraightLine_Click);
- this.menuMultipointStraightLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureMulLineIcon.png").Reference;
- //
- // 多点水平线
- //
- this.menuMultipointHorizontalLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureMulHVLine.Text");
- this.menuMultipointHorizontalLine.NeedWaitKey = true;
- this.menuMultipointHorizontalLine.Click += new EventHandler(menuMultipointHorizontalLine_Click);
- this.menuMultipointHorizontalLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureMulHVLineIcon.png").Reference;
- //
- // 多点线段
- //
- this.menuMultipointLineSegment1.Text = PdnResources.GetString("Menu.MeasureAction.MeasureMulSegment.Text");
- this.menuMultipointLineSegment1.NeedWaitKey = true;
- this.menuMultipointLineSegment1.Click += new EventHandler(menuMultipointLineSegment1_Click);
- this.menuMultipointLineSegment1.Image = PdnResources.GetImageResource("Icons.MenuMeasureMulSegmentIcon.png").Reference;
- //
- // 多点垂直线
- //
- this.menuMultipointVerticalLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureMulVLine.Text");
- this.menuMultipointVerticalLine.NeedWaitKey = true;
- this.menuMultipointVerticalLine.Click += new EventHandler(menuMultipointVerticalLine_Click);
- this.menuMultipointVerticalLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureMulVLineIcon.png").Reference;
- //
- // 折线
- //
- this.menuPolyline.Text = PdnResources.GetString("Menu.MeasureAction.MeasureBrokenLine.Text");
- this.menuPolyline.NeedWaitKey = true;
- this.menuPolyline.Click += new EventHandler(MenuPolyline_Click);
- this.menuPolyline.Image = PdnResources.GetImageResource("Icons.MenuMeasureBrokenLineIcon.png").Reference;
- //
- // 轨迹曲线
- //
- this.menuTraceCurve.Text = PdnResources.GetString("Menu.MeasureAction.MeasureTraceCurve.Text");
- this.menuTraceCurve.NeedWaitKey = true;
- this.menuTraceCurve.Click += new EventHandler(MenuTraceCurve_Click);
- this.menuTraceCurve.Image = PdnResources.GetImageResource("Icons.MenuMeasureTraceCurveIcon.png").Reference;
- //
- // 曲线
- //
- this.menuCurve.Text = PdnResources.GetString("Menu.MeasureAction.MeasureCurveLine.Text");
- this.menuCurve.NeedWaitKey = true;
- this.menuCurve.Click += new EventHandler(MenuCurve_Click);
- this.menuCurve.Image = PdnResources.GetImageResource("Icons.MenuMeasureCurveLineIcon.png").Reference;
- //
- // 点垂线
- //
- this.menuPointVertical.Text = PdnResources.GetString("Menu.MeasureAction.MeasurePLine.Text");
- this.menuPointVertical.NeedWaitKey = true;
- this.menuPointVertical.Click += new EventHandler(menuPointVertical_Click);
- this.menuPointVertical.Image = PdnResources.GetImageResource("Icons.MenuMeasurePLineIcon.png").Reference;
- //
- // 多点垂线
- //
- this.menuMultiPointVertical.Text = PdnResources.GetString("Menu.MeasureAction.MeasureMulPLine.Text");
- this.menuMultiPointVertical.NeedWaitKey = true;
- this.menuMultiPointVertical.Click += new EventHandler(menuMultiPointVertical_Click);
- this.menuMultiPointVertical.Image = PdnResources.GetImageResource("Icons.MenuMeasureMulPLineIcon.png").Reference;
- //
- // 水平多点垂线
- //
- this.menuHorizontalMultipointVertical.Text = PdnResources.GetString("Menu.MeasureAction.MeasureHMulPLine.Text");
- this.menuHorizontalMultipointVertical.NeedWaitKey = true;
- this.menuHorizontalMultipointVertical.Click += new EventHandler(menuHorizontalMultipointVertical_Click);
- this.menuHorizontalMultipointVertical.Image = PdnResources.GetImageResource("Icons.MenuMeasureHMulPLineIcon.png").Reference;
- //
- // 垂直多点垂线
- //
- this.menuVerticalMultipointVertical.Text = PdnResources.GetString("Menu.MeasureAction.MeasureVMulPLine.Text");
- this.menuVerticalMultipointVertical.NeedWaitKey = true;
- this.menuVerticalMultipointVertical.Click += new EventHandler(menuVerticalMultipointVertical_Click);
- this.menuVerticalMultipointVertical.Image = PdnResources.GetImageResource("Icons.MenuMeasureVMulPLineIcon.png").Reference;
- //
- //
- //点到水平线距离
- //
- this.menuPointToHLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasurePointHLine.Text");
- this.menuPointToHLine.NeedWaitKey = true;
- this.menuPointToHLine.Click += new EventHandler(menuMultiPointToHLine_Click);
- this.menuPointToHLine.Image = PdnResources.GetImageResource("Icons.MenuMeasurePLineIcon.png").Reference;
- // 平行线
- //
- this.menuParallelLine.Text = PdnResources.GetString("Menu.MeasureAction.MeasureParallelLine.Text");
- this.menuParallelLine.NeedWaitKey = true;
- this.menuParallelLine.Click += new EventHandler(menuParallelLine_Click);
- this.menuParallelLine.Image = PdnResources.GetImageResource("Icons.MenuMeasureParallelLineIcon.png").Reference;
- //
- // 多点平行线
- //
- this.menuMultipointParallel.Text = PdnResources.GetString("Menu.MeasureAction.MeasureMulParallelLine.Text");
- this.menuMultipointParallel.NeedWaitKey = true;
- this.menuMultipointParallel.Click += new EventHandler(menuMultipointParallel_Click);
- this.menuMultipointParallel.Image = PdnResources.GetImageResource("Icons.MenuMeasureMulParallelLineIcon.png").Reference;
- //
- // 水平多点平行线
- //
- this.menuMultipointHorizontalParallelLines.Text = PdnResources.GetString("Menu.MeasureAction.MeasureHMulParallelLine.Text");
- this.menuMultipointHorizontalParallelLines.NeedWaitKey = true;
- this.menuMultipointHorizontalParallelLines.Click += new EventHandler(menuMultipointHorizontalParallelLines_Click);
- this.menuMultipointHorizontalParallelLines.Image = PdnResources.GetImageResource("Icons.MenuMeasureHMulParallelLineIcon.png").Reference;
- //
- // 垂直多点平行线
- //
- this.menuMultipointVerticalParallelLines.Text = PdnResources.GetString("Menu.MeasureAction.MeasureVMulParallelLine.Text");
- this.menuMultipointVerticalParallelLines.NeedWaitKey = true;
- this.menuMultipointVerticalParallelLines.Click += new EventHandler(menuMultipointVerticalParallelLines_Click);
- this.menuMultipointVerticalParallelLines.Image = PdnResources.GetImageResource("Icons.MenuMeasureVMulParallelLineIcon.png").Reference;
- //
- // 闭合曲线
- //
- this.menuClosedCurve.Text = PdnResources.GetString("Menu.MeasureAction.MeasureClosedCurve.Text");
- this.menuClosedCurve.NeedWaitKey = true;
- this.menuClosedCurve.Click += new EventHandler(menuClosedCurve_Click);
- this.menuClosedCurve.Image = PdnResources.GetImageResource("Icons.MenuMeasureClosedCurveIcon.png").Reference;
- //
- // 多边形
- //
- this.menuPolygon.Text = PdnResources.GetString("Menu.MeasureAction.MeasurePolygon.Text");
- this.menuPolygon.NeedWaitKey = true;
- this.menuPolygon.Click += new EventHandler(menuPolygon_Click);
- this.menuPolygon.Image = PdnResources.GetImageResource("Icons.MenuMeasurePolygonIcon.png").Reference;
- //
- // 矩形
- //
- this.menuRectangle.Text = PdnResources.GetString("Menu.MeasureAction.MeasureRectangle.Text");
- this.menuRectangle.NeedWaitKey = true;
- this.menuRectangle.Click += new EventHandler(menuRectangle_Click);
- this.menuRectangle.Image = PdnResources.GetImageResource("Icons.MenuMeasureRectangleIcon.png").Reference;
- //
- // 任意矩形
- //
- this.menuArbitraryRectangle.Text = PdnResources.GetString("Menu.MeasureAction.MeasureRandRectangle.Text");
- this.menuArbitraryRectangle.NeedWaitKey = true;
- this.menuArbitraryRectangle.Click += new EventHandler(menuArbitraryRectangle_Click);
- this.menuArbitraryRectangle.Image = PdnResources.GetImageResource("Icons.MenuMeasureRandRectangleIcon.png").Reference;
- //
- // 正方形
- //
- this.menuSquare.Text = PdnResources.GetString("Menu.MeasureAction.MeasureSquare.Text");
- this.menuSquare.NeedWaitKey = true;
- this.menuSquare.Click += new EventHandler(menuSquare_Click);
- this.menuSquare.Image = PdnResources.GetImageResource("Icons.MenuMeasureSquareIcon.png").Reference;
- //
- // 任意正方形
- //
- this.menuArbitrarySquare.Text = PdnResources.GetString("Menu.MeasureAction.MeasureRandSquare.Text");
- this.menuArbitrarySquare.NeedWaitKey = true;
- this.menuArbitrarySquare.Click += new EventHandler(menuArbitrarySquare_Click);
- this.menuArbitrarySquare.Image = PdnResources.GetImageResource("Icons.MenuMeasureRandSquareIcon.png").Reference;
- //
- // 轨迹多边形
- //
- this.menuTrackPolygon.Text = PdnResources.GetString("Menu.MeasureAction.MeasureTracePolygon.Text");
- this.menuTrackPolygon.NeedWaitKey = true;
- this.menuTrackPolygon.Click += new EventHandler(menuTrackPolygon_Click);
- this.menuTrackPolygon.Image = PdnResources.GetImageResource("Icons.MenuMeasureTracePolygonIcon.png").Reference;
- //
- // 三点圆
- //
- this.menuThreePointCircle.Text = PdnResources.GetString("Menu.MeasureAction.MeasureCircle.Text");
- this.menuThreePointCircle.NeedWaitKey = true;
- this.menuThreePointCircle.Click += new EventHandler(MenuThreePointCircle_Click);
- this.menuThreePointCircle.Image = PdnResources.GetImageResource("Icons.MenuMeasureCircleIcon.png").Reference;
- //
- // 向内画圆
- //
- this.menuDrawCircleInward.Text = PdnResources.GetString("Menu.MeasureAction.MeasureInnerCircle.Text");
- this.menuDrawCircleInward.NeedWaitKey = true;
- this.menuDrawCircleInward.Click += new EventHandler(MenuDrawCircleInward_Click);
- this.menuDrawCircleInward.Image = PdnResources.GetImageResource("Icons.MenuMeasureInnerCircleIcon.png").Reference;
- //
- // 向外画圆
- //
- this.menuDrawCircleOutward.Text = PdnResources.GetString("Menu.MeasureAction.MeasureOuterCircle.Text");
- this.menuDrawCircleOutward.NeedWaitKey = true;
- this.menuDrawCircleOutward.Click += new EventHandler(MenuDrawCircleOutward_Click);
- this.menuDrawCircleOutward.Image = PdnResources.GetImageResource("Icons.MenuMeasureOuterCircleIcon.png").Reference;
- //
- // 直径画圆
- //
- this.menuDiameterCircle.Text = PdnResources.GetString("Menu.MeasureAction.MeasureDiameterCircle.Text");
- this.menuDiameterCircle.NeedWaitKey = true;
- this.menuDiameterCircle.Click += new EventHandler(MenuDiameterCircle_Click);
- this.menuDiameterCircle.Image = PdnResources.GetImageResource("Icons.MenuMeasureDiameterCircleIcon.png").Reference;
- //
- // 点到圆距离
- //
- this.menuPointToCircleDistance.Text = PdnResources.GetString("Menu.MeasureAction.MeasurePointEdgeSize.Text");
- this.menuPointToCircleDistance.NeedWaitKey = true;
- this.menuPointToCircleDistance.Click += new EventHandler(MenuPointToCircleDistance_Click);
- this.menuPointToCircleDistance.Image = PdnResources.GetImageResource("Icons.MenuMeasurePointEdgeSizeIcon.png").Reference;
- //
- // 点到圆心距离
- //
- this.menuPointToCenterDistance.Text = PdnResources.GetString("Menu.MeasureAction.MeasurePointCenterSize.Text");
- this.menuPointToCenterDistance.NeedWaitKey = true;
- this.menuPointToCenterDistance.Click += new EventHandler(MenuPointToCenterDistance_Click);
- this.menuPointToCenterDistance.Image = PdnResources.GetImageResource("Icons.MenuMeasurePointCenterSizeIcon.png").Reference;
- //
- // 点到圆弧距离
- //
- this.menuPointToArcDistance.Text = PdnResources.GetString("Menu.MeasureAction.MeasurePointArcSize.Text");
- this.menuPointToArcDistance.NeedWaitKey = true;
- this.menuPointToArcDistance.Click += new EventHandler(MenuPointToArcDistance_Click);
- this.menuPointToArcDistance.Image = PdnResources.GetImageResource("Icons.MenuMeasurePointCenterSizeIcon.png").Reference;
- //
- // 圆心到圆心距离
- //
- this.menuCenterToCenterDistance.Text = PdnResources.GetString("Menu.MeasureAction.MeasureCenterCenterSize.Text");
- this.menuCenterToCenterDistance.NeedWaitKey = true;
- this.menuCenterToCenterDistance.Click += new EventHandler(MenuCenterToCenterDistance_Click);
- this.menuCenterToCenterDistance.Image = PdnResources.GetImageResource("Icons.MenuMeasurePointCenterSizeIcon.png").Reference;
- //
- // 两线中垂线距离
- //
- this.menuTwoLineVLDistance.Text = PdnResources.GetString("Menu.MeasureAction.MeasureTwoLineVLDistance.Text");
- this.menuTwoLineVLDistance.NeedWaitKey = true;
- this.menuTwoLineVLDistance.Click += new EventHandler(MeasureTwoLineVLDistance_Click);
- this.menuTwoLineVLDistance.Image = PdnResources.GetImageResource("Icons.MenuTwoLineVLDistance.png").Reference;
- //
- // 三点角度
- //
- this.menuThreePointAngle.Text = PdnResources.GetString("Menu.MeasureAction.MeasureThreePointAngle.Text");
- this.menuThreePointAngle.NeedWaitKey = true;
- this.menuThreePointAngle.Click += new EventHandler(menuThreePointAngle_Click);
- this.menuThreePointAngle.Image = PdnResources.GetImageResource("Icons.MenuMeasureThreePointAngleIcon.png").Reference;
- //
- // 四点角度
- //
- this.menuFourPointAngle.Text = PdnResources.GetString("Menu.MeasureAction.MeasureFourPointAngle.Text");
- this.menuFourPointAngle.NeedWaitKey = true;
- this.menuFourPointAngle.Click += new EventHandler(menuFourPointAngle_Click);
- this.menuFourPointAngle.Image = PdnResources.GetImageResource("Icons.MenuMeasureFourPointAngleIcon.png").Reference;
- //
- // 三点弧
- //
- this.menuThreePointArc.Text = PdnResources.GetString("Menu.MeasureAction.MeasureThreePointArc.Text");
- this.menuThreePointArc.NeedWaitKey = true;
- this.menuThreePointArc.Click += new EventHandler(menuThreePointArc_Click);
- this.menuThreePointArc.Image = PdnResources.GetImageResource("Icons.MenuMeasureThreePointArcIcon.png").Reference;
- //
- // 几何测量
- //
- this.menuGeometryMeasure.Text = "交互测量";
- this.menuGeometryMeasure.Click += new EventHandler(menuGeometryMeasure_Click);
- this.menuGeometryMeasure.Image = PdnResources.GetImageResource("Icons.MenuMeasureThreePointArcIcon.png").Reference;
- //
- // 加载菜单的文字和icon
- //
- this.LoadNames(this.Name);
- this.LoadIcons();
- }
- protected override void OnDropDownOpening(EventArgs e)
- {
- this.menuContinuousDrawingAction.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure : false;
- this.menuMeasureList.Checked = AppWorkspace.Widgets.MeasureListDialog.Visible;
- this.menuRulerCalibration.Checked = AppWorkspace.Widgets.RuleListForm.Visible;
- this.menuOpticalDensity.Checked = AppWorkspace.Widgets.OpticalDensityDialog.Visible;
- this.menuGeometryMeasure.Checked = AppWorkspace.Widgets.GeometryMeasureDialog.Visible;
- if (AppWorkspace.ActiveDocumentWorkspace == null/* || AppWorkspace.ScriptRunning*/)
- {
- this.menuOpticalDensity.Enabled = false;
- this.menuBitmapAnalysis.Enabled = false;
- }
- else
- {
- this.menuOpticalDensity.Enabled = true;
- this.menuBitmapAnalysis.Enabled = true;
- }
- //this.RecursiveData(this.DropDownItems);
- base.OnDropDownOpening(e);
- }
- /// <summary>
- /// 选择
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuChoiseAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.Pointer;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.Pointer);
- }
- /// <summary>
- /// 全选
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuSelectAllAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.GraphicsList.SelectAll();
- AppWorkspace.ActiveDocumentWorkspace.Refresh();
- }
- if (AppWorkspace.cameraPreviewDialog != null && !AppWorkspace.cameraPreviewDialog.IsDisposed)
- {
- AppWorkspace.cameraPreviewDialog.documentWorkspace.GraphicsList.SelectAll();
- AppWorkspace.cameraPreviewDialog.documentWorkspace.Refresh();
- }
- }
- /// <summary>
- /// 连续绘制
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuContinuousDrawingAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure = !AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure;
- AppWorkspace.continuousDrawingMeasure = AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure;
- for (int i = 0; i < AppWorkspace.DocumentWorkspaces.Length; i++)
- {
- AppWorkspace.DocumentWorkspaces[i].ContinuousDrawingMeasure = AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure;
- }
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure, "ContinuousDrawingMeasure");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure, "ContinuousDrawingMeasure");
- if (!AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure
- && AppWorkspace.ActiveDocumentWorkspace.activeTool >= DrawToolType.MeasureLine && AppWorkspace.ActiveDocumentWorkspace.activeTool <= DrawToolType.MeasureThreePointArc)
- {
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.Pointer;
- }
- this.menuContinuousDrawingAction.Checked = AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure;
- }
- if (AppWorkspace.cameraPreviewDialog != null && !AppWorkspace.cameraPreviewDialog.IsDisposed)
- {
- AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure = !AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure;
- if(AppWorkspace.ActiveDocumentWorkspace!=null) AppWorkspace.continuousDrawingMeasure = AppWorkspace.ActiveDocumentWorkspace.ContinuousDrawingMeasure;
- for (int i = 0; i < AppWorkspace.DocumentWorkspaces.Length; i++)
- {
- AppWorkspace.DocumentWorkspaces[i].ContinuousDrawingMeasure = AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure;
- }
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure, "ContinuousDrawingMeasure");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure, "ContinuousDrawingMeasure");
- if (!AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure)
- {
- AppWorkspace.cameraPreviewDialog.documentWorkspace.ActiveTool = DrawToolType.Pointer;
- }
-
- if(AppWorkspace.ActiveDocumentWorkspace != null
- && AppWorkspace.ActiveDocumentWorkspace.activeTool >= DrawToolType.MeasureLine
- && AppWorkspace.ActiveDocumentWorkspace.activeTool <= DrawToolType.MeasureThreePointArc)
- {
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
-
- }
- this.menuContinuousDrawingAction.Checked = AppWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure;
- }
- }
- /// <summary>
- /// 清空元素
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuClearAllAction_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.GraphicsList.Clear();
- AppWorkspace.ActiveDocumentWorkspace.Refresh();
- }
- if (AppWorkspace.cameraPreviewDialog != null && !AppWorkspace.cameraPreviewDialog.IsDisposed)
- {
- AppWorkspace.cameraPreviewDialog.documentWorkspace.GraphicsList.Clear();
- AppWorkspace.cameraPreviewDialog.documentWorkspace.Refresh();
- }
- }
- /// <summary>
- /// 长度测量->直线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuStraightLine_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureLine);
- }
- /// <summary>
- /// 长度测量->距离
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuDistance_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureDistanceLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureDistanceLine);
- }
- /// <summary>
- /// 长度测量->长度
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuLengthLine_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureLength;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureLength);
- }
- /// <summary>
- /// 长度测量->水平线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuHorizontalLine_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureHLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureHLine);
- }
- /// <summary>
- /// 长度测量->垂线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuPerpendicular_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureVLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureVLine);
- }
- /// <summary>
- /// 测量-曲线-折线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuPolyline_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureBrokenLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureBrokenLine);
- }
- /// <summary>
- /// 曲线测量->轨迹曲线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuTraceCurve_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureTraceCurve;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureTraceCurve);
- }
- /// <summary>
- /// 圆形->三点圆
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuThreePointCircle_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureCircle;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureCircle);
- }
- /// <summary>
- /// 圆形->向内画圆
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuDrawCircleInward_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureInnerCircle;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureInnerCircle);
- }
-
- /// <summary>
- /// 圆形->向外画圆
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuDrawCircleOutward_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureOuterCircle;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureOuterCircle);
- }
- /// <summary>
- /// 圆形->直径画圆
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuDiameterCircle_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureDiameterCircle;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureDiameterCircle);
- }
-
- /// <summary>
- /// 圆形->点到圆距离
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuPointToCircleDistance_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasurePointEdgeSize;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasurePointEdgeSize);
- }
-
- /// <summary>
- /// 圆形->点到圆心距离
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuPointToCenterDistance_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasurePointCenterSize;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasurePointCenterSize);
- }
- /// <summary>
- /// 圆形->点到圆弧距离
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuPointToArcDistance_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasurePointArcSize;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasurePointArcSize);
- }
- /// <summary>
- /// 对准度->圆心到圆心距离
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuCenterToCenterDistance_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureCenterCenterSize;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureCenterCenterSize);
- }
- /// <summary>
- /// 对准度->两线中垂线距离
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MeasureTwoLineVLDistance_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureTwoLineVLDistance;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureTwoLineVLDistance);
- }
- /// <summary>
- /// 曲线测量->曲线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuCurve_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureCurveLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureCurveLine);
- }
- /// <summary>
- /// 三点角度
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void menuThreePointAngle_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureThreePointAngle;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureThreePointAngle);
- }
- /// <summary>
- /// 四点角度
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void menuFourPointAngle_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureFourPointAngle;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureFourPointAngle);
- }
- /// <summary>
- /// 三点弧
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void menuThreePointArc_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureThreePointArc;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureThreePointArc);
- }
- /// <summary>
- /// 几何测量
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void menuGeometryMeasure_Click(object sander, EventArgs e)
- {
- //if (AppWorkspace.ActiveDocumentWorkspace != null)
- //{
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.Widgets.GeometryMeasureDialog.Visible = !AppWorkspace.Widgets.GeometryMeasureDialog.Visible;
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.GeometryMeasureDialog.Visible, "Geometry");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.GeometryMeasureDialog.Visible, "Geometry");
- this.menuGeometryMeasure.Checked = AppWorkspace.Widgets.GeometryMeasureDialog.Visible;
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- AppWorkspace.ActiveDocumentWorkspace.Focus();
- }
- //Form form = Application.OpenForms["GeometryMeasureDialog"];//尝试获取已经弹出的窗口对象
- //FloatingFormMethod.ShowFloatForm(form, form == null ? new GeometryMeasureDialog(AppWorkspace) : null, AppWorkspace, true);
- AppWorkspace.RefreshMeasureListView();
- //}
- }
- ///<summary>
- ///点垂线
- ///</summary>
- ///
- private void menuPointVertical_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasurePLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasurePLine);
- }
- ///<summary>
- ///多点垂线
- ///</summary>
- ///
- private void menuMultiPointVertical_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureMulPLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureMulPLine);
- }
- ///<summary>
- ///点到水平线距离
- ///</summary>
- ///
- private void menuMultiPointToHLine_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasurePointHLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasurePointHLine);
- }
- ///<summary>
- ///水平多点垂线
- ///</summary>
- ///
- private void menuHorizontalMultipointVertical_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureHMulPLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureHMulPLine);
- }
- ///<summary>
- ///垂直多点垂线
- ///</summary>
- ///
- private void menuVerticalMultipointVertical_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureVMulPLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureVMulPLine);
- }
- ///<summary>
- ///平行线
- ///</summary>
- ///
- private void menuParallelLine_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureParallelLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureParallelLine);
- }
- ///<summary>
- ///多点平行线
- ///</summary>
- ///
- private void menuMultipointParallel_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureMulParallelLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureMulParallelLine);
- }
- ///<summary>
- ///水平多点平行线
- ///</summary>
- ///
- private void menuMultipointHorizontalParallelLines_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureHMulParallelLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureHMulParallelLine);
- }
- ///<summary>
- ///垂直多点平行线
- ///</summary>
- ///
- private void menuMultipointVerticalParallelLines_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureVMulParallelLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureVMulParallelLine);
- }
- ///<summary>
- ///闭合曲线
- ///</summary>
- ///
- private void menuClosedCurve_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureClosedCurve;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureClosedCurve);
- }
- ///<summary>
- ///多边形
- ///</summary>
- ///
- private void menuPolygon_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasurePolygon;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasurePolygon);
- }
- ///<summary>
- ///矩形
- ///</summary>
- ///
- private void menuRectangle_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureRectangle;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureRectangle);
- }
- /// <summary>
- /// 任意矩形
- /// </summary>
- /// <param name="sander"></param>
- /// <param name="e"></param>
- private void menuArbitraryRectangle_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureRandRectangle;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureRandRectangle);
- }
- /// <summary>
- /// 任意正方形
- /// </summary>
- /// <param name="sander"></param>
- /// <param name="e"></param>
- private void menuArbitrarySquare_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureRandSquare;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureRandSquare);
- }
- ///<summary>
- ///正方形
- ///</summary>
- ///
- private void menuSquare_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureSquare;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureSquare);
- }
- ///<summary>
- ///轨迹多边形
- ///</summary>
- ///
- private void menuTrackPolygon_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureTracePolygon;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureTracePolygon);
- }
- ///<summary>
- ///多点直线
- ///</summary>
- ///
- private void menuMultipointStraightLine_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureMulLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureMulLine);
- }
- ///<summary>
- ///多点线段
- ///</summary>
- ///
- private void menuMultipointLineSegment1_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureMulSegment;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureMulSegment);
- }
- ///<summary>
- ///多点水平线
- ///</summary>
- ///
- private void menuMultipointHorizontalLine_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureMulHVLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureMulHVLine);
- }
- ///<summary>
- ///多点垂直线
- ///</summary>
- ///
- private void menuMultipointVerticalLine_Click(object sander, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sander).MenuId, ((PdnMenuItem)sander).Text, new List<Args>());
- }
- AppWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.MeasureMulVLine;
- }
- this.SetCameraPreviewActiveTool(DrawToolType.MeasureMulVLine);
- }
- /// <summary>
- /// 标尺标定
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuRulerCalibration_Click(object sender, EventArgs e)
- {
- AppWorkspace.Widgets.RuleListForm.Visible = !AppWorkspace.Widgets.RuleListForm.Visible;
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.RuleListForm.Visible, "RulerCalibration");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.RuleListForm.Visible, "RulerCalibration");
- this.menuRulerCalibration.Checked = AppWorkspace.Widgets.RuleListForm.Visible;
- AppWorkspace.ActiveDocumentWorkspace.Focus();
- //AppWorkspace.Widgets.RuleListForm.MenuSubApplyCurrent();
- }
- }
- /// <summary>
- /// 应用当前
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuSubApplyCurrent_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.Widgets.RuleListForm.MenuSubApplyCurrent();
- }
- /// <summary>
- /// 应用全部
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuSubApplyAll_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- AppWorkspace.Widgets.RuleListForm.MenuSubApplyAll();
- }
- /// <summary>
- /// 测量列表
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuMeasureList_Click(object sender, EventArgs e)
- {
- AppWorkspace.Widgets.MeasureListDialog.Visible = !AppWorkspace.Widgets.MeasureListDialog.Visible;
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.MeasureListDialog.Visible, "MeasureList");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.MeasureListDialog.Visible, "MeasureList");
- this.menuMeasureList.Checked = AppWorkspace.Widgets.MeasureListDialog.Visible;
- AppWorkspace.ActiveDocumentWorkspace.Focus();
- }
- }
- /// <summary>
- /// 光密度
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuOpticalDensity_Click(object sender, EventArgs e)
- {
- AppWorkspace.Widgets.OpticalDensityDialog.Visible = !AppWorkspace.Widgets.OpticalDensityDialog.Visible;
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.OpticalDensityDialog.Visible, "OpticalDensity");
- this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.OpticalDensityDialog.Visible, "OpticalDensity");
- this.menuOpticalDensity.Checked = AppWorkspace.Widgets.OpticalDensityDialog.Visible;
- bool canDram = true;
- int count = this.AppWorkspace.ActiveDocumentWorkspace.GraphicsList.Count;
- for (int i = 0; i < count; i++)
- {
- if (this.AppWorkspace.ActiveDocumentWorkspace.GraphicsList[i].objectType == DrawClass.Other
- && this.AppWorkspace.ActiveDocumentWorkspace.GraphicsList[i].drawToolType == DrawToolType.OpticalDensityLine)
- {
- canDram = false;
- this.AppWorkspace.ActiveDocumentWorkspace.GraphicsList[i].Selected = true;
- }
- }
- if(canDram)
- AppWorkspace.ActiveDocumentWorkspace.activeTool = DrawToolType.OpticalDensityLine;
- AppWorkspace.ActiveDocumentWorkspace.Focus();
- }
- }
- /// <summary>
- /// 位图分析
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>"
- private void BitmapAnalysis_Click(object sender, EventArgs e)
- {
- if (AppWorkspace.ActiveDocumentWorkspace != null)
- {
- using (BitmapAnalysisDialog dialog = new BitmapAnalysisDialog(this.AppWorkspace))
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- dialog.StartPosition = FormStartPosition.CenterParent;
- dialog.ShowDialog();
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseopenatleastonepicturefirst.Text"));
- }
- }
- /// <summary>
- /// 理论比例尺
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void TheoreticalScale_Click(object sender, EventArgs e)
- {
- using (TheoreticalScaleDialog dialog = new TheoreticalScaleDialog(this.AppWorkspace,ArrayList1, ArrayList2, ArrayList3))
- {
- if (AppWorkspace.startScriptRecording)
- {
- AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
- }
- dialog.StartPosition = FormStartPosition.CenterParent;
- dialog.ShowDialog();
- }
- }
- private void SetCameraPreviewActiveTool(DrawToolType drawToolType)
- {
- if (AppWorkspace.cameraPreviewDialog != null && !AppWorkspace.cameraPreviewDialog.IsDisposed)
- {
- AppWorkspace.cameraPreviewDialog.documentWorkspace.ActiveTool = drawToolType;
- }
- }
- private string GetCultureInfoName(CultureInfo ci)
- {
- CultureInfo en_US = new CultureInfo("en-US");
- if (ci.Equals(en_US))
- {
- return GetCultureInfoName(ci.Parent);
- }
- else
- {
- return ci.NativeName;
- }
- }
- }
- }
|