本文整理汇总了C#中ESRI.GetIncidentLinks方法的典型用法代码示例。如果您正苦于以下问题:C# ESRI.GetIncidentLinks方法的具体用法?C# ESRI.GetIncidentLinks怎么用?C# ESRI.GetIncidentLinks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ESRI
的用法示例。
在下文中一共展示了ESRI.GetIncidentLinks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectElementsToCollapse
public ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeature SelectElementsToCollapse(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNode node, ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeature relatedFeatures)
{
// get feature
ESRI.ArcGIS.Geodatabase.IFeature esriFeature;
esriFeature = node as ESRI.ArcGIS.Geodatabase.IFeature;
if (esriFeature == null) return null;
// get feature class
ESRI.ArcGIS.Geodatabase.IFeatureClass esriFeatureClass;
esriFeatureClass = esriFeature.Class as ESRI.ArcGIS.Geodatabase.IFeatureClass;
// if not the right feature class do nothing
if (esriFeatureClass.AliasName != "plants") return null;
bool okToCollapse = true;
relatedFeatures.Reset();
// Test if you want to collapse related element
//ESRI.ArcGIS.Schematic.ISchematicElement schemElement = relatedElements.Next();
//while ((schemElement != null) && okToCollapse)
//{
// okToCollapse = CanCollapseElement(schemElement);
// schemElement = relatedElements.Next();
//}
if (!okToCollapse)
return null; // if nothing to collapse return nothing
else if (relatedFeatures.Count == 0)
{
EnumCollapsedElts enumCollapse = new EnumCollapsedElts(); // create a list of feature to collapse
// get incident links
ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeatureLink enumLinks;
enumLinks = node.GetIncidentLinks(ESRI.ArcGIS.Schematic.esriSchematicEndPointType.esriSchematicOriginOrExtremityNode);
if (enumLinks == null) return enumCollapse;
if (enumLinks.Count > 1)
{
enumLinks.Reset();
ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLink schemLink;
// for each link
schemLink = enumLinks.Next();
if (schemLink != null)
{
enumCollapse.Add((ESRI.ArcGIS.Schematic.ISchematicInMemoryFeature)node); // Add node to collapse
while (schemLink != null)
{
enumCollapse.Add((ESRI.ArcGIS.Schematic.ISchematicInMemoryFeature)schemLink); // Add link to collapse
schemLink = enumLinks.Next();
}
}
}
return enumCollapse;
}
else
{
return relatedFeatures;
}
}