本文整理汇总了C#中IGeometryCollection.AddGeometry方法的典型用法代码示例。如果您正苦于以下问题:C# IGeometryCollection.AddGeometry方法的具体用法?C# IGeometryCollection.AddGeometry怎么用?C# IGeometryCollection.AddGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGeometryCollection
的用法示例。
在下文中一共展示了IGeometryCollection.AddGeometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteRowsByFIDSetReturnGeomCollection
public bool DeleteRowsByFIDSetReturnGeomCollection(ITable inTable, IFIDSet pFIDSet,
IStepProgressor StepProgressor, ITrackCancel TrackCancel, ref IGeometryCollection GeomCollection)
{
//this routine uses the GetRows method, avoids the need to break up the InClause.
if (pFIDSet == null)
return false;
IMouseCursor pMouseCursor = new MouseCursorClass();
pMouseCursor.SetCursor(2);
try
{
pFIDSet.Reset();
int[] iID = { };
bool bCont = true;
iID = RedimPreserveInt(ref iID, pFIDSet.Count());
for (int iCount = 0; iCount <= pFIDSet.Count() - 1; iCount++)
pFIDSet.Next(out iID[iCount]);
ICursor pCursor = inTable.GetRows(iID, false);
IRow row = pCursor.NextRow();
if (StepProgressor != null)
{
if (StepProgressor.Position < StepProgressor.MaxRange)
StepProgressor.Step();
}
while (row != null)
{
IFeature pFeat = row as IFeature;
IGeometry pGeom = pFeat.ShapeCopy;
if (pGeom != null)
{
if (!pGeom.IsEmpty)
{
object obj = Type.Missing;
IEnvelope2 pEnv = (IEnvelope2)pGeom.Envelope;
pEnv.Expand(0.1, 0.1, false);
GeomCollection.AddGeometry(pEnv, ref obj, ref obj);
}
}
//Check if the cancel button was pressed. If so, stop process
if (StepProgressor != null)
{
if (TrackCancel != null)
bCont = TrackCancel.Continue();
if (!bCont)
break;
}
row.Delete();
Marshal.ReleaseComObject(row);
row = pCursor.NextRow();
if (StepProgressor != null)
{
if (StepProgressor.Position < StepProgressor.MaxRange)
StepProgressor.Step();
}
}
Marshal.ReleaseComObject(pCursor);
inTable = null;
iID = null;
if (!bCont)
return false;
return true;
}
catch (COMException ex)
{
StepProgressor = null;
if (ex.ErrorCode == -2147217400)
//MessageBox.Show(ex.ErrorCode + Environment.NewLine + ex.Message +
// Environment.NewLine + "This error indicates that the fabric may not have been correctly upgraded.");
//TODO: need to confirm this.
m_LastErrorCode = ex.ErrorCode;
else
MessageBox.Show(ex.Message + Environment.NewLine + ex.ErrorCode);
m_LastErrorCode = ex.ErrorCode;
return false;
}
}