BDPGeometry

@protocol BDPGeometry <BDPDeepCopy>

@brief Geometrical methods required for implementation of a concrete geometry class. @copyright Bluedot Innovation

  • Sometimes referred to as ‘hit test’ or ‘Point in polygon test’, this method determines whether the given @ref BDPoint “point” falls on, or inside the bounds of this geometry.

    @returns YES if the point falls on or inside the bounds, NO if the point falls outside the bounds

    Declaration

    Objective-C

    - (BOOL)intersects:(BDGeometry *)geometry;
  • Currently, only Circles may receive this message; other shapes will throw an assertion error in DEBUG or return NO in RELEASE.

    @returns YES if this shape fully encloses the specified shape, NO otherwise.

    Declaration

    Objective-C

    - (BOOL)isEnclosedBy:(BDGeometry *)geometry;
  • Calculates the minimum @ref BDBoundingBox “bounding-box” that encloses this geometry.

    Notably, for @ref BDBoundingBox instances, this will simply return a `self` reference.

    For @ref BDPoint instances, this will return a zero-sized box positioned at the point.

    @returns the minimum @ref BDBoundingBox “bounding-box” that encloses this geometry.

    Declaration

    Objective-C

    - (BDBoundingBox *)boundingBox;
  • @returns The centre of a geometrical shape.

    Declaration

    Objective-C

    - (BDPoint *)centroid;
  • @returns the distance to another geometric shape.

    Declaration

    Objective-C

    - (BDLocationDistance)distanceTo:(BDGeometry *)geometry;
  • @returns The type of current geometry. Available values: point, circle, lineString, boundingBox, polygon.

    Declaration

    Objective-C

    - (BDGeometryType)geometryType;