/// <summary> /// 创建点对实体 /// </summary> /// <param name="entinyNode">VCT点实体节点</param> public override FeatureEntity CreateFeatureEntity(EntityNode entinyNode) { if (entinyNode is PointNode) { m_PointEntity = new PointEntity(); m_PointEntity.SetFeatureKeyFieldName(m_strEntityFieldName, m_strSYDMFieldName); m_PointEntity.CreateFeature(this.Table, entinyNode); return m_PointEntity; } else return null; }
/// <summary> /// �������ʵ�� /// </summary> /// <param name="entinyNode">VCT��ʵ��ڵ�</param> public override FeatureEntity CreateFeatureEntity(EntityNode entinyNode) { if (entinyNode is PointNode) { m_PointEntity = new PointEntity(); m_PointEntity.SetFeatureKeyFieldName(m_strEntityFieldName, m_strSYDMFieldName); m_PointEntity.CreateFeature(this.Table, entinyNode); return m_PointEntity; } else return null; }
/// <summary> /// 获取实体集合 /// </summary> public override List<FeatureEntity> GetFeatureEntitys() { try { IFeatureClass pFeatureCls = this.Table as IFeatureClass; IFeatureCursor pCursor = pFeatureCls.Search(null, false); IFeature pFeature = pCursor.NextFeature(); List<FeatureEntity> listFeatureEnty = new List<FeatureEntity>();//保存FeatureEntity while (pFeature != null) { ///add by 曾平2011-9-7 添加裁切判断 ///裁切范围为空表示不进行裁切 if (m_CutGeometry != null) { if (!FeatureInCutRegion(pFeature.Shape)) { pFeature = pCursor.NextFeature(); continue; } } PointEntity pPointEntity = new PointEntity(); pPointEntity.Feature = pFeature; ///初始化相关数据 //pPointEntity.GetEntityNode(); pPointEntity.FeatureCode = this.FeatureCode; int nEntityIDIndex = -1; nEntityIDIndex = pFeature.Fields.FindField(m_strEntityFieldName); if (nEntityIDIndex != -1) pPointEntity.EntityID = Convert.ToInt32(pFeature.get_Value(nEntityIDIndex)); ///设置要素代码和标识码 pPointEntity.SetFeatureKeyFieldName(m_strEntityFieldName, m_strSYDMFieldName); listFeatureEnty.Add(pPointEntity); pFeature = pCursor.NextFeature(); } m_FeatureEntys = listFeatureEnty; return listFeatureEnty; } catch (Exception ex) { LogAPI.WriteErrorLog(ex); return null; } }
/// <summary> /// ��ȡʵ�弯�� /// </summary> public override List<FeatureEntity> GetFeatureEntitys() { try { IFeatureClass pFeatureCls = this.Table as IFeatureClass; IFeatureCursor pCursor = pFeatureCls.Search(null, false); IFeature pFeature = pCursor.NextFeature(); List<FeatureEntity> listFeatureEnty = new List<FeatureEntity>();//����FeatureEntity while (pFeature != null) { ///add by ��ƽ2011-9-7 ��Ӳ����ж� ///���з�ΧΪ�ձ�ʾ�����в��� if (m_CutGeometry != null) { if (!FeatureInCutRegion(pFeature.Shape)) { pFeature = pCursor.NextFeature(); continue; } } PointEntity pPointEntity = new PointEntity(); pPointEntity.Feature = pFeature; ///��ʼ��������� //pPointEntity.GetEntityNode(); pPointEntity.FeatureCode = this.FeatureCode; int nEntityIDIndex = -1; nEntityIDIndex = pFeature.Fields.FindField(m_strEntityFieldName); if (nEntityIDIndex != -1) pPointEntity.EntityID = Convert.ToInt32(pFeature.get_Value(nEntityIDIndex)); ///����Ҫ�ش���ͱ�ʶ�� pPointEntity.SetFeatureKeyFieldName(m_strEntityFieldName, m_strSYDMFieldName); listFeatureEnty.Add(pPointEntity); pFeature = pCursor.NextFeature(); } m_FeatureEntys = listFeatureEnty; return listFeatureEnty; } catch (Exception ex) { Logger.WriteErrorLog(ex); return null; } }