本文整理汇总了C#中IPolyline.GetPoints方法的典型用法代码示例。如果您正苦于以下问题:C# IPolyline.GetPoints方法的具体用法?C# IPolyline.GetPoints怎么用?C# IPolyline.GetPoints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPolyline
的用法示例。
在下文中一共展示了IPolyline.GetPoints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProjectBoreholes
public static ProjectBoreholeResult ProjectBoreholes(List<Tuple<Borehole, IMapPoint>> input,
IPolyline projLine, GeoProjSettings geoProjSettings)
{
if (input == null || projLine == null)
return null;
// remove the boreholes that do not have geology infos,
// so called 'empty' boreholes
//
input.RemoveAll(x =>
x.Item1.Geologies == null || x.Item1.Geologies.Count == 0
|| x.Item1.Top == x.Item1.Base);
// sort the boreholes according to their projected position on the projection line
//
List<ProjectedBorehole> sortedList = new List<ProjectedBorehole>();
foreach (var tuple in input)
{
Borehole bh = tuple.Item1;
IMapPoint p = tuple.Item2;
double distance = 0;
IMapPoint prjPnt = null;
bool canProject = GeomUtil.ProjectPointToPolyline(p,
projLine.GetPoints(), ref distance, ref prjPnt);
if (geoProjSettings.clipInProjectionLine == true && canProject == false)
continue;
distance /= geoProjSettings.scale;
distance += geoProjSettings.xOffset;
ProjectedBorehole prjBorehole = new ProjectedBorehole();
prjBorehole.Borehole = bh;
prjBorehole.Distance = distance;
prjBorehole.Pos = p;
sortedList.Add(prjBorehole);
}
if (sortedList.Count == 0)
return null;
sortedList.Sort((x, y) => x.Distance.CompareTo(y.Distance));
// extend borholes to same depth
//
if (geoProjSettings.extendBorehole)
{
ExtendBoreholes(input);
}
// perform the projection
//
ProjectBoreholeResult result = new ProjectBoreholeResult();
List<STGraphic> stResults = new List<STGraphic>();
ProjectedBorehole previousBh = null;
foreach (ProjectedBorehole projectedBorehole in sortedList)
{
Borehole bh = projectedBorehole.Borehole;
// draw strata
if (geoProjSettings.drawStratum)
{
if (previousBh == null)
{
previousBh = projectedBorehole;
}
else
{
List<STGraphic> stGraphics = LinkBorehole(
previousBh.Borehole, projectedBorehole.Borehole,
previousBh.Distance, projectedBorehole.Distance,
geoProjSettings.zScale);
previousBh = projectedBorehole;
stResults.AddRange(stGraphics);
}
}
// draw borehole
if (geoProjSettings.drawBorehole)
{
IGraphicCollection gc = ProjectBorehole(bh,
projectedBorehole.Distance, geoProjSettings.zScale);
result.bhGraphics[bh.id] = gc;
}
}
// transfrom strata results
foreach (STGraphic stGraphic in stResults)
{
int id = stGraphic.StratumID;
if (result.stGraphics.ContainsKey(id))
{
IGraphicCollection gc = result.stGraphics[id];
gc.Add(stGraphic.Graphic);
}
else
{
IGraphicCollection gc = NewGraphicCollection();
gc.Add(stGraphic.Graphic);
result.stGraphics[id] = gc;
}
//.........这里部分代码省略.........