本文整理汇总了C#中PolylineClass.ReverseOrientation方法的典型用法代码示例。如果您正苦于以下问题:C# PolylineClass.ReverseOrientation方法的具体用法?C# PolylineClass.ReverseOrientation怎么用?C# PolylineClass.ReverseOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolylineClass
的用法示例。
在下文中一共展示了PolylineClass.ReverseOrientation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLRParallelPnts
/// <summary>
/// 构造平行线的边点坐标串
/// </summary>
/// <params name="centerPts">中心线的坐标集合</params>
/// <params name="lineSpace">巷道宽度的一半</params>
/// <params name="flag">方向</params>
/// <returns>返回平行线的坐标串</returns>
public List<IPoint> GetLRParallelPnts(List<IPoint> centerPts, double lineSpace, int flag)
{
List<IPoint> results = new List<IPoint>();
IPolyline plin = new PolylineClass();//获得的平行线
IPolyline centerline = new PolylineClass();
centerline.SpatialReference = Global.spatialref;
IPointCollection centerlinecols = centerline as IPointCollection;
for (int i = 0; i < centerPts.Count; i++)
{
centerlinecols.AddPoint(centerPts[i]);
}
//ITopologicalOperator4 top4 = centerline as ITopologicalOperator4;
//if (!top4.IsSimple)
// top4.Simplify();
if (flag == 1)//右侧
plin = ConstructOffset(centerline, lineSpace / 2);
else//左侧
{
plin = ConstructOffset(centerline, -lineSpace / 2);
plin.ReverseOrientation();//将左侧平行线的点方向逆转
}
IPointCollection plincols = plin as IPointCollection;
for (int i = 0; i < plincols.PointCount; i++)
{
IPoint pnttmp = new PointClass();
pnttmp.PutCoords(plincols.get_Point(i).X, plincols.get_Point(i).Y);
pnttmp.Z = 0;
results.Add(pnttmp);
}
//for (int i = 0; i < centerPts.Count - 1; i++)
//{
// IPoint offsetPoint = new PointClass();//偏移坐标A
// IPoint movePoint = new PointClass();//移动点的坐标
// IPoint downPoint = new PointClass();
// downPoint = centerPts[i];
// movePoint = centerPts[i + 1];
// double angle = PointToAngle(downPoint, movePoint);
// if (centerPts.Count >= 1)
// {
// if (flag == 1)//右平行线
// {
// offsetPoint.X = (float)(Math.Cos(angle + 0.5f * Math.PI) * lineSpace + downPoint.X);
// offsetPoint.Y = (float)(Math.Sin(angle + 0.5f * Math.PI) * lineSpace + downPoint.Y);
// offsetPoint.Z = downPoint.Z;
// }
// if (flag == 0)//左平行线
// {
// offsetPoint.X = (float)(Math.Cos(angle - 0.5f * Math.PI) * lineSpace + downPoint.X);
// offsetPoint.Y = (float)(Math.Sin(angle - 0.5f * Math.PI) * lineSpace + downPoint.Y);
// offsetPoint.Z = downPoint.Z;
// }
// Point pt = new PointClass();
// pt.X = movePoint.X + offsetPoint.X - downPoint.X;
// pt.Y = movePoint.Y + offsetPoint.Y - downPoint.Y;
// pt.Z = downPoint.Z;
// results.Add(offsetPoint);
// results.Add(pt);
// }
//}
return results;
}