Comment tamponner un IPoint pour faire une vérification d'intersection en utilisant IRelationalOperator?Comment tamponner un IPoint ou un IGeometry? (Comment faire des vérifications d'intersection tamponnée sur un IPoint?)
J'ai, pour des arguments:
IPoint p1 = xxx;
IPoint p2 = yyy;
IRelationalOperator rel1 = (IRelationalOperator)p1;
if (rel.Intersects (p2))
// Do something
Mais maintenant, je veux ajouter une tolérance à mon chèque, je suppose donc la bonne façon de le faire est soit mise en mémoire tampon P1 ou P2. Droite? Comment ajouter un tel tampon?
Remarque: la méthode Intersects que j'utilise est une méthode d'extension que j'ai écrite pour simplifier mon code. Le voici:
/// <summary>
/// Returns true if the IGeometry is intersected.
/// This method negates the Disjoint method.
/// </summary>
/// <param name="relOp">The rel op.</param>
/// <param name="other">The other.</param>
/// <returns></returns>
public static bool Intersects (
this IRelationalOperator relOp,
IGeometry other)
{
return (!relOp.Disjoint (other));
}
Modification de la balise C#. Voir: http://stackoverflow.com/questions/247621/what-are-the-correct-version-numbers-for-c – chilltemp