/// <summary> /// A helper method to convert an HObject containing a polygon to an HXLDPoly. /// </summary> /// <param name="from">From.</param> /// <returns>HXLDPoly.</returns> /// <exception cref="NotImplementedException"></exception> public static HXLDPoly ToHXLDPoly(this HObject from) { HXLDPoly newXldPoly = new HXLDPoly(); if (from.IsValid()) { if (from.GetObjClass().S == "xld_poly") { newXldPoly.Dispose(); newXldPoly = new HXLDPoly(from); } } return(newXldPoly); }
public HXLDPoly TransPolygonXLD(HXLDPoly xldPoly) { try { HHomMat2D matd = new HHomMat2D(); matd.VectorAngleToRigid(this.info.ModelRegionRow, this.info.ModelRegionCol, this.info.ModelRegionAngle, this.info.ResultY, this.info.ResultX, this.info.ResultAngle); if (IsSuccess) { xldPoly = matd.AffineTransPolygonXld(xldPoly); return(xldPoly); } } catch (Exception ex) { WriteErrorLog("VisionTool", ToolName + "模板" + ex.ToString()); } return(null); }