// Generated .IDL file (by the OLE/COM Object Viewer)
// 
// typelib filename: PolygonLibrary.dll

[
  uuid(93413341-D4D0-4DE9-BF4E-20945410B249),
  version(1.0),
  helpstring("PolygonLib 1.3 Type Library"),
  custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 100663657),
  custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1364910256),
  custom(DE77BA65-517C-11D1-A2DA-0000F8773CE9, "Created by MIDL version 6.00.0361 at Tue Apr 02 16:44:13 2013
")

]

library PolygonLib
{
    // TLib :     // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
    importlib("stdole2.tlb");

    // Forward declare all types defined in this typelib
    interface INode;
    interface ITopology;
    interface IRectangle;
    interface IPolygonLayer;
    interface IPolygonEnumerator;
    interface IPolygon;
    interface IGeometry;
    interface IRingEnumerator;
    interface IRing;
    interface IPolyline;
    interface IPolygonSet;
    interface IPolylineLayer;
    interface IPolylineCollection;
    interface ITopologyContainer;

    typedef     ,
      custom(8AFCDA7F-33B7-3120-86A8-754D2C0C0578, "library_block")    
enum {
        E_INVALID_OPERATION = 0x80040200,
        E_INVALID_POLYGON = 0x80040201,
        E_POLYGONS_OVERLAP = 0x80040202
    } ERRORS;

	typedef [helpstring("Contains coordinates of a point in a two-dimensional plane.")]
    struct tagPOINT {
        [helpstring("The x-coordinate of the point.")]
        double X;

        [helpstring("The y-coordinate of the point.")]
        double Y;
    } POINT;

    [
      uuid(4D6E258C-7575-4D90-B8D8-48D790C45097),
      version(1.0),
      helpstring("Represents a vertex of geometry/geometries, is referenced by geometric objects of the Topology it belongs to, and there is no other duplicate Node in the Topology. The node coordinates have a fixed precision (part of solving the robustness problem)."),
      noncreatable
    ]
    coclass Node {
        [default] interface INode;
    };

    [
      odl,
      uuid(90DFF1F6-3B30-49F0-9AC5-843FB7A94304),
      helpstring("Represents a vertex of geometry/geometries, is referenced by geometric objects of the Topology it belongs to, and there is no other Node with the same coordinates in the Topology. The node coordinates have a fixed precision (part of solving the robustness problem)."),
      dual,
      oleautomation
    ]
    interface INode : IDispatch {
        [id(0x00000001), propget, helpstring("Gets coordinates of the node.")]
        HRESULT Location([out, retval] POINT* pVal);

        [id(0x00000002), propget, helpstring("Gets reference to the Topology this Node belongs to.")]
        HRESULT Topology([out, retval] ITopology** pVal);
    };

    [
      odl,
      uuid(51CFA4EB-DFFC-4F6D-AC18-A076DF91F02A),
      helpstring("A container of geometric objects that share Node objects representing vertices of the geometries. Each Node is unique in the Topology (there is no other Node with the same coordinates)."),
      dual,
      oleautomation
    ]
    interface ITopology : IDispatch {
        [id(0x00000001), propget, helpstring("Gets bounding box of all geometric objects of the topology.")]
        HRESULT Bounds([out, retval] IRectangle** pVal);

        [id(0x00000002), helpstring("Locates the node closest to the specified point and being within the specified tolerance distance from the point. Returns the pointer to the Node or null pointer if there is no node in the circular area.")]
        HRESULT NodeAtLocation(
                        [in] POINT* pPoint, 
                        [in] double dToleranceDistance, 
                        [out, retval] INode** pRetVal);
        
		[id(0x00000003), helpstring("Gets the bounds of the polygon/polyline segments that start/end at the specified node.")]
        HRESULT EdgesBounds(
                        [in] INode* pNode, 
                        [out, retval] IRectangle** pRetVal);
        
		[id(0x00000004), helpstring("Creates a PolygonLayer object with the specified value of the AllowsOverlap property and adds to this Topology. Returns pointer to the created PolygonLayer.")]
        HRESULT CreatePolygonLayer(
                        [in] VARIANT_BOOL bAllowsOverlap, 
                        [out, retval] IPolygonLayer** pRetVal);
        
		[id(0x00000005), helpstring("Creates and adds (to this Topology) a PolygonLayer representing the set-theoretic union of the specified polygon layers by minimal count of not overlapping polygons representing the origin polygons as far as possible (overlapping polygons are merged).")]
        HRESULT CreatePolygonLayersUnion(
                        [in] IPolygonLayer* pFirstPolygonLayer, 
                        [in] IPolygonLayer* pSecondPolygonLayer, 
                        [in] VARIANT_BOOL bSetParents, 
                        [out, retval] IPolygonLayer** pRetVal);
       
		[id(0x00000006), helpstring("Creates and adds (to this Topology) a PolygonLayer representing the set-theoretic union of the specified polygon layers by maximal count of not overlapping polygons: overlaps between polygons of the layers and not empty results of their subtraction from the polygons.")]
        HRESULT CreatePolygonLayersJoin(
                        [in] IPolygonLayer* pFirstPolygonLayer, 
                        [in] IPolygonLayer* pSecondPolygonLayer, 
                        [in] VARIANT_BOOL bSetParents, 
                        [out, retval] IPolygonLayer** pRetVal);
        
		[id(0x00000007), helpstring("Creates and adds (to this Topology) a PolygonLayer representing the set-theoretic intersection of the specified polygon layers by maximal count of polygons: not empty intersections between each polygon of the first layer and each polygon of the second layer.")]
        HRESULT CreatePolygonLayersIntersection(
                        [in] IPolygonLayer* pFirstPolygonLayer, 
                        [in] IPolygonLayer* pSecondPolygonLayer, 
                        [in] VARIANT_BOOL bSetParents, 
                        [out, retval] IPolygonLayer** pRetVal);
        
		[id(0x00000008), helpstring("Creates and adds (to this Topology) a PolygonLayer representing the set-theoretic difference between the specified polygon layers by not empty results of subtraction of the second layer from the polygons of the first layer.")]
        HRESULT CreatePolygonLayersDifference(
                        [in] IPolygonLayer* pFirstPolygonLayer, 
                        [in] IPolygonLayer* pSecondPolygonLayer, 
                        [in] VARIANT_BOOL bSetParents, 
                        [out, retval] IPolygonLayer** pRetVal);
        
		[id(0x00000009), helpstring("Deletes the specified PolygonLayer of this Topology. Raises the E_INVALID_OPERATION error if a Polygon of the PolygonLayer is contained in the Parents collection of a Polygon of an other PolygonLayer.")]
        HRESULT DeletePolygonLayer([in] IPolygonLayer* pPolygonLayer);
        
		[id(0x0000000a), helpstring("Creates a PolylineLayer object, adds it to this Topology and returns its pointer.")]
        HRESULT CreatePolylineLayer([out, retval] IPolylineLayer** pRetVal);
        
		[id(0x0000000b), helpstring("Deletes the specified PolylineLayer of this Topology.")]
        HRESULT DeletePolylineLayer([in] IPolylineLayer* pPolylineLayer);
        
		[id(0x0000000c), helpstring("Moves the specified node to the specified point. If there is a node at the target location, the moved node is replaced with the node. Returns pointer to the Node at the target point.")]
        HRESULT MoveNode(
                        [in] INode* pNode, 
                        [in] POINT* pPoint, 
                        [out, retval] INode** pRetVal);
        
		[id(0x0000000d), helpstring("Commits all changes made since last successful call of this method: calls AcceptChanges of changed PolygonLayer objects. Raises the E_INVALID_POLYGON or E_POLYGONS_OVERLAP error with corresponding description if the changes are not valid.")]
        HRESULT AcceptChanges();
    };

    [
      odl,
      uuid(440F046B-F719-4CFC-B284-DA9993E66385),
      helpstring("Represents a rectangle whose sides are parallel to the coordinate axises."),
      dual,
      oleautomation
    ]
    interface IRectangle : IDispatch {
        
		[id(0x00000001), propget, helpstring("Gets the x-coordinate of the left side of the rectangle.")]
        HRESULT MinX([out, retval] double* pVal);
        
		[id(0x00000002), propget, helpstring("Gets the y-coordinate of the bottom side of the rectangle.")]
        HRESULT MinY([out, retval] double* pVal);
        
		[id(0x00000003), propget, helpstring("Gets the x-coordinate of the right side of the rectangle.")]
        HRESULT MaxX([out, retval] double* pVal);
        
		[id(0x00000004), propget, helpstring("Gets the y-coordinate of the top side of the rectangle.")]
        HRESULT MaxY([out, retval] double* pVal);
        
		[id(0x00000005), propget, helpstring("Gets the width of the rectangle.")]
        HRESULT Width([out, retval] double* pVal);
        
		[id(0x00000006), propget, helpstring("Gets the height of the rectangle.")]
        HRESULT Height([out, retval] double* pVal);
        
		[id(0x00000007), propget, helpstring("Indicates whether the rectangle is empty (contains no point). The rectangle is empty after its creating.")]        
		HRESULT IsEmpty([out, retval] VARIANT_BOOL* pVal);
        
		[id(0x00000008), helpstring("Sets the rectangle bounds to the specified values. Raises the invalid argument error if a minimal bound is greater than the corresponding maximal one.")]
        HRESULT SetBounds(
                        [in] double dMinX, 
                        [in] double dMinY, 
                        [in] double dMaxX, 
                        [in] double dMaxY);
        
		[id(0x00000009), helpstring("Expands the rectangle minimally to include the specified point.")]
        HRESULT ExpandToIncludePoint([in] POINT* pPoint);
        
		[id(0x0000000a), helpstring("Expands the rectangle minimally to include the specified rectangle.")]
        HRESULT ExpandToIncludeRect([in] IRectangle* pRect);
        
		[id(0x0000000b), helpstring("Determines whether this rectangle has common points with the specified rectangle.")]
        HRESULT Intersects(
                        [in] IRectangle* pRectangle, 
                        [out, retval] VARIANT_BOOL* pRetVal);
    };

    [
      odl,
      uuid(F277BA95-7050-43EB-A667-8E0DE852FB9E),
      helpstring("A container of Polygon objects of a Topology."),
      dual,
      oleautomation
    ]
    interface IPolygonLayer : IDispatch {
        [id(0x00000001), propget, helpstring("Gets pointer to the Topology this PolygonLayer belongs to.")]
        HRESULT Topology([out, retval] ITopology** pVal);
        
		[id(0x00000002), propget, helpstring("Gets an enumerator of all polygons of the polygon layer.")]
        HRESULT Polygons([out, retval] IPolygonEnumerator** pVal);
        
		[id(0x00000003), propget, helpstring("Gets bounding box of all polygons of the polygon layer.")]
        HRESULT Bounds([out, retval] IRectangle** pVal);
        
		[id(0x00000004), propget, helpstring("Indicates whether polygons of this layer can overlap. Overlaps are checked by the AcceptChanges() method.")]
        HRESULT AllowsOverlap([out, retval] VARIANT_BOOL* pVal);
        
		[id(0x00000005), helpstring("Locates the polygon closest to the specified point and containing the point or being within the specified tolerance distance from the point. Returns pointer to the Polygon or null pointer if no polygon intersects the circular area.")]
        HRESULT PolygonAtLocation(
                        [in] POINT* pPoint, 
                        [in] double dToleranceDistance, 
                        [out, retval] IPolygon** pRetVal);
        
		[id(0x00000006), helpstring("Gets an enumerator of the polygons intersecting the specified rectangle.")]
        HRESULT PolygonsIntersectingRectangle(
                        [in] IRectangle* pRectangle, 
                        [out, retval] IPolygonEnumerator** pRetVal);
        
		[id(0x00000007), helpstring("Creates an empty Polygon object, adds it to this PolygonLayer and returns pointer to it.")]
        HRESULT CreatePolygon([out, retval] IPolygon** pRetVal);
        
		[id(0x00000008), helpstring("Creates a Polygon object representing the same polygon as the specified object. Adds the new Polygon to this PolygonLayer and returns pointer to it.")]
        HRESULT CreatePolygonCopy(
                        [in] IPolygon* pPolygon, 
                        [out, retval] IPolygon** pRetVal);
        
		[id(0x00000009), helpstring("Creates a Polygon object representing the result of buffering the specified polygon by the specified distance. If the distance is negative, the buffering is performed inside the polygon. Adds the new Polygon to this PolygonLayer and returns pointer to it.")]
        HRESULT CreateBufferedPolygon(
                        [in] IPolygon* pPolygon, 
                        [in] double bufferDistance, 
                        [out, retval] IPolygon** pRetVal);
        
		[id(0x0000000a), helpstring("Creates a Polygon object representing the set-theoretic union of the specified polygons. The third parameter specifies if the Parents property of the created Polygon has to be set. Adds the new Polygon to this PolygonLayer and returns pointer to it.")]
        HRESULT CreatePolygonsUnion(
                        [in] IPolygon* pFirstPolygon, 
                        [in] IPolygon* pSecondPolygon, 
                        [in] VARIANT_BOOL bSetParents, 
                        [out, retval] IPolygon** pRetVal);
        
		[id(0x0000000b), helpstring("Creates a Polygon object representing the set-theoretic union of the specified polygons. The third parameter specifies if the Parents property of the created Polygon has to be set. Adds the new Polygon to this PolygonLayer and returns pointer to it.")]
        HRESULT CreatePolygonSetUnion(
                        [in] IPolygonEnumerator* pPolygons, 
                        [in] VARIANT_BOOL bSetParents, 
                        [out, retval] IPolygon** pRetVal);
        
		[id(0x0000000c), helpstring("Creates a Polygon object representing the set-theoretic intersection of the specified polygons. The third parameter specifies if the Parents property of the created Polygon has to be set. Adds the new Polygon to this PolygonLayer and returns pointer to it.")]
        HRESULT CreatePolygonsIntersection(
                        [in] IPolygon* pFirstPolygon, 
                        [in] IPolygon* pSecondPolygon, 
                        [in] VARIANT_BOOL bSetParents, 
                        [out, retval] IPolygon** pRetVal);
        
		[id(0x0000000d), helpstring("Creates a Polygon object representing the set-theoretic difference of the specified polygons. The third parameter specifies if the Parents property of the created Polygon has to be set. Adds the new Polygon to this PolygonLayer and returns pointer to it.")]
        HRESULT CreatePolygonsDifference(
                        [in] IPolygon* pFirstPolygon, 
                        [in] IPolygon* pSecondPolygon, 
                        [in] VARIANT_BOOL bSetParents, 
                        [out, retval] IPolygon** pRetVal);
        
		[id(0x0000000e), helpstring("Splits the specified polygon with the specified polyline and adds the result polygons to this PolygonLayer. The third parameter specifies if the Parents property of the created Polygons has to be set. Returns references to the created Polygon objects.")]
        HRESULT SplitPolygon(
                        [in] IPolygon* pPolygon, 
                        [in] IPolyline* pPolyline, 
                        [in] VARIANT_BOOL bSetParents, 
                        [out, retval] IPolygonSet** pRetVal);
        
		[id(0x0000000f), helpstring("Deletes the specified Polygon of this PolygonLayer.Raises the E_INVALID_OPERATION error if the Polygon is a parent of an other Polygon (is contained it its Parents collection).")]
        HRESULT DeletePolygon([in] IPolygon* pPolygon);
        
		[id(0x00000010), helpstring("Commits all changes made since last successful call of this method: calls AcceptChanges() of changed/created Polygons and checks polygons overlap if AllowsOverlap = false. Raises the E_INVALID_POLYGON or E_POLYGONS_OVERLAP error if the validation fails.")]
        HRESULT AcceptChanges();
        
		[id(0x00000011), helpstring("Clears the Parents collection in all polygons. The clear is required to allow change of the parent polygons, e.q. when the PolygonLayer was created as a result of a Boolean operations on other polygon layers with setting parents.")]
        HRESULT ClearParents();
    };

    [
      odl,
      uuid(E8A3BA72-4BEE-4714-9199-BFA4DEC144EB),
      helpstring("An iterator over a Polygon collection. Initially, the enumerator is positioned before the first element. The enumerator must not be used after change of the collection or their items."),
      dual,
      oleautomation
    ]
    interface IPolygonEnumerator : IDispatch {
        [id(0x00000001), propget, helpstring("Gets pointer to the Polygon at the current position of the enumerator.")]
        HRESULT Current([out, retval] IPolygon** pVal);
        
		[id(0x00000002), helpstring("Advances the enumerator position (Current property) to the next Polygon of the collection. Returns a value indicating if the enumerator was successfully advanced (there is a next Polygon).")]
        HRESULT MoveNext([out, retval] VARIANT_BOOL* pRetVal);
        
		[id(0x00000003), helpstring("Sets the enumerator pointer to its initial position, which is before the first Polygon in the collection.")]
        HRESULT Reset();
    };

    [
      odl,
      uuid(BEE04BAE-91DB-440A-B256-2C223E3B379B),
      helpstring("Represents a bounded closed set of points of a two-dimensional plane, enclosed by one or many exterior boundary loops (clockwise orientation) and zero or many interior boundary loops (counterclockwise orientation) defining holes."),
      dual,
      oleautomation
    ]
    interface IPolygon : IGeometry {
        [id(0x00000002), propget, helpstring("Gets pointer to the PolygonLayer this Polygon belongs to.")]
        HRESULT PolygonLayer([out, retval] IPolygonLayer** pRetVal);
        
		[id(0x00000003), propget, helpstring("Gets an enumerator of the Polygons that this Polygon was created from per a polygons operation and overlaps them. The collection is not empty for results of operations between polygons and can be cleared by ClearParents().")]
        HRESULT Parents([out, retval] IPolygonEnumerator** pRetVal);
        
		[id(0x00000004), propget, helpstring("Gets an enumerator of all rings of the polygon.")]
        HRESULT Rings([out, retval] IRingEnumerator** pVal);
        
		[id(0x00000005), propget, helpstring("Gets an enumerator of the exterior rings of the polygon.")]
        HRESULT ExteriorRings([out, retval] IRingEnumerator** pVal);
        
		[id(0x00000006), propget, helpstring("Gets an enumerator of the interior rings directly enclosed by the specified exterior ring of the polygon (that there is no other ring enclosing an interior ring and enclosed by the exterior ring)")]
        HRESULT InteriorRings(
                        [in] IRing* pExteriorRing, 
                        [out, retval] IRingEnumerator** pVal);
        
		[id(0x00000007), propget, helpstring("Gets minimal bounding box of the polygon.")]
        HRESULT Bounds([out, retval] IRectangle** pVal);
        
		[id(0x00000008), propget, helpstring("Gets centroid of the polygon. Raises the E_INVALID_POLYGON error if the polygon is not valid.")]
        HRESULT Centroid([out, retval] POINT* pVal);
        
		[id(0x00000009), propget, helpstring("Gets area of the polygon.")]
        HRESULT Area([out, retval] double* pVal);
        
		[id(0x0000000a), propget, helpstring("Gets perimeter of the polygon boundary (interior boundaries are considered too).")]
        HRESULT Perimeter([out, retval] double* pVal);
        
		[id(0x0000000b), propget, helpstring("Determines whether the polygon is convex.")]
        HRESULT IsConvex([out, retval] VARIANT_BOOL* pVal);
        
		[id(0x0000000c), propget, helpstring("Indicates if the Polygon is valid: rings enclose not zero areas and are simple; each interior ring is directly enclosed by an exterior ring; areas enclosed by rings of the same type do not overlap, but a ring can be directly enclosed by a ring of other type.")]
        HRESULT IsValid([out, retval] VARIANT_BOOL* pVal);
        
		[id(0x0000000d), propget, helpstring("Indicates if this Polygon is contained in the Parents collection of an other Polygon. If is true then the Polygon cannot be changed.")]
        HRESULT IsParent([out, retval] VARIANT_BOOL* pVal);
        
		[id(0x0000000e), helpstring("Determines whether the polygon is equal to the specified polygon with the specified absolute accuracy of coordinates.")]
        HRESULT Equals(
                        [in] IPolygon* pPolygon, 
                        [in] double dAccuracy, 
                        [out, retval] VARIANT_BOOL* pVal);
        
		[id(0x0000000f), helpstring("Determines whether the polygon overlaps the specified polygon (their intersection is a polygon with not zero area).")]
        HRESULT Overlaps(
                        [in] IPolygon* pPolygon, 
                        [out, retval] VARIANT_BOOL* pVal);
        
		[id(0x00000010), helpstring("Locates the border node closest to the specified point and being within the specified distance from it. Returns the results (Ring pointer and node index or null and -1 if no node is found; distance from the node to the point) per the output parameters.")]
        HRESULT LocateNode(
                        [in] POINT* pPoint, 
                        [in] double dToleranceDistance, 
                        [out] IRing** out_pRing, 
                        [out] long* out_nodeIndex, 
                        [out, optional, defaultvalue(0)] double* out_distance);
        
		[id(0x00000011), helpstring("Locates the edge closest to the specified point and being within the specified tolerance distance from it. Returns the results (Ring pointer and edge index or null and -1 if no edge is found; distance from the edge to the point) per the output parameters.")]
        HRESULT LocateEdge(
                        [in] POINT* pPoint, 
                        [in] double dToleranceDistance, 
                        [out] IRing** out_pRing, 
                        [out] long* out_edgeIndex, 
                        [out, optional, defaultvalue(0)] double* out_distance);
        
		[id(0x00000012), helpstring("Gets the polygon centroid, if it is contained in the polygon; otherwise, gets the point of the polygon boundary that is closest to the centroid.Raises the E_INVALID_POLYGON error if the polygon is not valid.")]
        HRESULT GetPointClosestToCentroid([out, retval] POINT* pRetVal);
        
		[id(0x00000013), helpstring("Clears the Parents collection. The clear is required to allow change of the parent Polygons.")]
        HRESULT ClearParents();
        
		[id(0x00000014), helpstring("Creates a Ring object and adds it to this Polygon. Returns pointer to the created Ring object.Raises the E_INVALID_OPERATION error if IsParent = true.")]
        HRESULT CreateRing([out, retval] IRing** pRetVal);
        
		[id(0x00000015), helpstring("Deletes the specified Ring of this Polygon.Raises the E_INVALID_OPERATION error if IsParent = true.")]
        HRESULT DeleteRing([in] IRing* pRing);
        
		[id(0x00000016), helpstring("Splits self-intersecting rings, removes empty edges and rings with zero area;  validates the Polygon and adds to the spatial index. Raises the E_INVALID_POLYGON or E_POLYGONS_OVERLAP error with corresponding description if the validation fails.")]
        HRESULT AcceptChanges();
    };

    [
      odl,
      uuid(C2A6BD8F-E4C9-478B-99D8-5C1A368B4360),
      helpstring("Represents a geometric figure as a set of points of a plane."),
      dual,
      oleautomation
    ]
    interface IGeometry : IDispatch {
        [id(0x00000001), propget, helpstring("Indicates whether the geometry is empty (contains no point).")]
        HRESULT IsEmpty([out, retval] VARIANT_BOOL* pVal);
    };

    [
      odl,
      uuid(FEF208DB-A5D1-4904-9551-F687DED5B624),
      helpstring("An iterator over a Ring collection. Initially, the enumerator is positioned before the first element. The enumerator must not be used after modification of the collection or their items."),
      dual,
      oleautomation
    ]
    interface IRingEnumerator : IDispatch {
        [id(0x00000001), propget, helpstring("Gets pointer to the Ring at the current position of the enumerator.")]
        HRESULT Current([out, retval] IRing** pVal);
        
		[id(0x00000002), helpstring("Advances the enumerator position (Current property) to the next Ring of the collection. Returns a value indicating if the enumerator was successfully advanced (there is a next Ring).")]
        HRESULT MoveNext([out, retval] VARIANT_BOOL* pRetVal);
        
		[id(0x00000003), helpstring("Sets the enumerator to its initial position, which is before the first Ring of the collection.")]
        HRESULT Reset();
    };

    [
      odl,
      uuid(B3BF0AE0-3F89-4786-ACFC-37F55F32D4D8),
      helpstring("Represents a polygon boundary loop defined as an auto-closed polyline (the closing edge connects its last and first vertices). The ring is valid if it encloses not zero area and is not self-intersecting."),
      dual,
      oleautomation
    ]
    interface IRing : IPolyline {
        [id(0x0000000d), propget, helpstring("Gets pointer to the Polygon this Rings belongs to.")]
        HRESULT Polygon([out, retval] IPolygon** pVal);
        
		[id(0x0000000e), propget, helpstring("Indicates if the ring is exterior (has clockwise orientation).")]
        HRESULT IsExterior([out, retval] VARIANT_BOOL* pVal);
    };

    [
      odl,
      uuid(9BDBB8BD-9F6F-4BC3-844C-E5551A9979AC),
      helpstring("Represents a polygonal chain defined as an ordered collection of vertices sequentially connected with line segments. The vertices are defined as pointers to Node objects of the Topology the Polyline belongs to."),
      dual,
      oleautomation
    ]
    interface IPolyline : IGeometry {
        [id(0x00000002), propget, helpstring("Gets count of Node pointers in the Polyline.")]
        HRESULT NodeCount([out, retval] long* pVal);
        
		[id(0x00000003), propget, helpstring("Gets Node pointer at the specified index.")]
        HRESULT Node(
                        [in] long index, 
                        [out, retval] INode** pVal);
        
		[id(0x00000003), propput, helpstring("Sets Node pointer at the specified index.")]
        HRESULT Node(
                        [in] long index, 
                        [in] INode* pVal);
        
		[id(0x00000004), propget, helpstring("Gets location (coordinates) of the node at the specified index.The property has better performacne than obtaining location per the Node property.")]
        HRESULT NodeLocation(
                        [in] long index, 
                        [out, retval] POINT* pVal);
        
		[id(0x00000005), propget, helpstring("Indicates if the last node is connected with the first node.")]
        HRESULT IsAutoClosed([out, retval] VARIANT_BOOL* pVal);
        
		[id(0x00000006), propget, helpstring("Grets the length of the polyline.")]
        HRESULT Length([out, retval] double* pVal);
        
		[id(0x00000007), helpstring("Gets index of the first occurrence of the specified Node in the Poyline's Node collection, or -1 if the node is not contained in the Polyline.")]
        HRESULT IndexOfNode(
                        [in] INode* pNode, 
                        [out, retval] long* pRetVal);
        
		[id(0x00000008), helpstring("Adds the specified Node pointer to the end of the Polyline's Node collection.The Node must belong to the same Topology as this Polyline.")]
        HRESULT AddNode([in] INode* pNode);
        
		[id(0x00000009), helpstring("Adds the pointer to the Topology Node at the specified location to the end of the Polyline's Node collection. Creates new Node in the Topology if there is no Node at the location.")]
        HRESULT AddNodeAtLocation([in] POINT* pPoint);
        
		[id(0x0000000a), helpstring("Inserts the specified Node pointer into the Polyline's Node collection at the specified index shifting up the existing item at the specified index and all subsequent items.The Node must belong to the same Topology as this Polyline.")]
        HRESULT InsertNode(
                        [in] long index, 
                        [in] INode* pNode);
        
		[id(0x0000000b), helpstring("Inserts pointer to the Topology Node at the specified location into the Polyline's Node collection at the specified index, shifting up the existing item at the specified index and all subsequent items. Creates new Node if there is no such Node.")]
        HRESULT InsertNodeAtLocation(
                        [in] long index, 
                        [in] POINT* pPoint);
        
		[id(0x0000000c), helpstring("Removes the Node pointer at the specified index from the Polyline's Node collection shifting down all subsequent items. Deletes the Node if there is mo more pointer to it any Polyline.")]
        HRESULT RemoveNode([in] long index);
    };

    [
      odl,
      uuid(E5FD6615-D019-47BF-89D7-8F433210D062),
      helpstring("A set of pointers to Polygon objects,  that contains no duplicate element."),
      dual,
      oleautomation
    ]
    interface IPolygonSet : IDispatch {
        [id(0x00000001), propget, helpstring("Gets count of the Polygons in this set.")]
        HRESULT Count([out, retval] long* pVal);
        
		[id(0x00000002), helpstring("Gets an enumerator of Polygons of this set.")]
        HRESULT GetEnumerator([out, retval] IPolygonEnumerator** pRetVal);
        
		[id(0x00000003), helpstring("Indicates if the specified Polygon is contained in this set. ")]
        HRESULT Contains(
                        [in] IPolygon* pPolygon, 
                        [out, retval] VARIANT_BOOL* pRetVal);
        
		[id(0x00000004), helpstring("Adds the specified Polygon to this set if it is not contained in it. Returns a value indicating if the specified Polygon has been added to the set as a result of the call.")]
        HRESULT Add(
                        [in] IPolygon* pPolygon, 
                        [out, retval] VARIANT_BOOL* pRetVal);
        
		[id(0x00000005), helpstring("Adds those of the specified Polygons to this set, that are not contained in it. Returns a value indicating if a Polygon has been added to the set as a result of the call.")]
        HRESULT AddRange(
                        [in] IPolygonEnumerator* pPolygonEnumerator, 
                        [out, retval] VARIANT_BOOL* pRetVal);
        
		[id(0x00000006), helpstring("Removes the specified Polygon from this set if it is contained in it. Returns a value indicating if the specified Polygon was contained in the set.")]
        HRESULT Remove(
                        [in] IPolygon* pPolygon, 
                        [out, retval] VARIANT_BOOL* pRetVal);
    };

    [
      odl,
      uuid(FC54A601-A8DE-4BC8-B7A6-167ED53DFFA3),
      helpstring("A container of Polyline objects of a Topology."),
      dual,
      oleautomation
    ]
    interface IPolylineLayer : IDispatch {
        [id(0x00000001), propget, helpstring("Gets pointer to the Topology this PolylineLayer belongs to.")]
        HRESULT Topology([out, retval] ITopology** pVal);
        
		[id(0x00000002), helpstring("Creates an empty Polyline object, adds it to this PolygonLayer and returns pointer to it.")]
        HRESULT CreatePolyline([out, retval] IPolyline** pRetVal);
        
		[id(0x00000003), helpstring("Creates Polyline objects that represent result of splitting boundary of the specified polygon at vertices whose angles are equal to or greater than the specified value (in radians). Adds the created objects to this PolylineLayer and returns pointers to them.")]
        HRESULT CreatePolylinesFromPolygon(
                        [in] IPolygon* pPolygon, 
                        [in] double splitMinAngle, 
                        [out, retval] IPolylineCollection** pRetVal);
        
		[id(0x00000004), helpstring("Deletes the specified Polyline of this PolygonLayer.")]
        HRESULT DeletePolyline([in] IPolyline* pPolyline);
        
		[id(0x00000005), helpstring("Commits all changes made since last successful call of this method.")]
        HRESULT AcceptChanges();
    };

    [
      odl,
      uuid(94BDF9B6-D8F0-4A1A-8528-ABAA4AC719C1),
      helpstring("A collection of pointers to Polyline objects."),
      dual,
      oleautomation
    ]
    interface IPolylineCollection : IDispatch {
        [id(0x00000001), propget, helpstring("Gets the count of polylines in the collection.")]
        HRESULT Count([out, retval] long* pVal);
        
		[id(0x00000002), propget, helpstring("Gets the Polyline pointer at the specified index.")]
        HRESULT Item(
                        [in] long index, 
                        [out, retval] IPolyline** pVal);
    };

    [
      uuid(0E90FD64-1FA7-4906-A560-62CD5A372D6E),
      version(1.0),
      helpstring("Represents a rectangle whose sides are parallel to the coordinate axises.")
    ]
    coclass Rectangle {
        [default] interface IRectangle;
    };

    [
      uuid(41A220A9-9F52-4E60-AA98-FA1DE7EBEEFB),
      version(1.0),
      helpstring("Represents a polygonal chain defined as an ordered collection of vertices sequentially connected with line segments. The vertices are defined as pointers to Node objects of the Topology the Polyline belongs to."),
      noncreatable
    ]
    coclass Polyline {
        [default] interface IPolyline;
        interface IGeometry;
    };

    [
      uuid(124F0395-EED4-4C0E-A552-10CB87608837),
      version(1.0),
      helpstring("Represents a polygon boundary loop defined as an auto-closed polyline (the closing edge connects its last and first vertices). The ring is valid if it encloses not zero area and is not self-intersecting."),
      noncreatable
    ]
    coclass Ring {
        [default] interface IRing;
        interface IPolyline;
        interface IGeometry;
    };

    [
      uuid(B138FAE5-18FE-438E-8984-C992D10C9D8E),
      version(1.0),
      helpstring("An iterator over a Ring collection. Initially, the enumerator is positioned before the first element. The enumerator must not be used after modification of the collection or their items."),
      noncreatable
    ]
    coclass RingEnumerator {
        [default] interface IRingEnumerator;
    };

    [
      uuid(C75000D7-372C-41E5-9F8B-C948EC6F891C),
      version(1.0),
      helpstring("Represents a bounded closed set of points of a two-dimensional plane, enclosed by one or many exterior boundary loops (clockwise orientation) and zero or many interior boundary loops (counterclockwise orientation) defining holes."),
      noncreatable
    ]
    coclass Polygon {
        [default] interface IPolygon;
        interface IGeometry;
    };

    [
      uuid(37B8078E-0B13-49EF-BB7E-05B578AA835F),
      version(1.0),
      helpstring("An iterator over a Polygon collection. Initially, the enumerator is positioned before the first element. The enumerator must not be used after change of the collection or their items."),
      noncreatable
    ]
    coclass PolygonEnumerator {
        [default] interface IPolygonEnumerator;
    };

    [
      uuid(E6F01915-6BC4-4B08-A677-D501EB2EE1F7),
      version(1.0),
      helpstring("A set of pointers to Polygon objects,  that contains no duplicate element.")
    ]
    coclass PolygonSet {
        [default] interface IPolygonSet;
    };

    [
      uuid(06896258-6A8E-456B-A3B7-9F00CE6B74B3),
      version(1.0),
      helpstring("A storage of Polygon objects of a Topology."),
      noncreatable
    ]
    coclass PolygonLayer {
        [default] interface IPolygonLayer;
    };

    [
      uuid(3AFBD679-572E-4EB1-9559-7F980AEFA6FF),
      version(1.0),
      helpstring("A collection of pointers to Polyline objects.")
    ]
    coclass PolylineCollection {
        [default] interface IPolylineCollection;
    };

    [
      uuid(EE85F53D-03DE-4358-9111-9A61D84FA96F),
      version(1.0),
      helpstring("A storage of Polylines of a Topology."),
      noncreatable
    ]
    coclass PolylineLayer {
        [default] interface IPolylineLayer;
    };

    [
      uuid(60232D5B-C2A1-4128-8E36-8CABD31E72AB),
      version(1.0),
      helpstring("A container of geometric objects that share Node objects representing vertices of the geometries. Each Node is unique in the Topology (there is no other Node with the same coordinates)."),
      noncreatable
    ]
    coclass Topology {
        [default] interface ITopology;
    };

    [
      uuid(229377E7-B118-437A-9896-6282566BADA4),
      version(1.0),
      helpstring("Represents a container of Topology objects, that allows to create and delete them.")
    ]
    coclass TopologyContainer {
        [default] interface ITopologyContainer;
    };

    [
      odl,
      uuid(2DB42637-01B9-42B9-8A3E-178BF5C800CE),
      helpstring("Represents a container of Topology objects, that allows to create and delete them."),
      dual,
      oleautomation
    ]
    interface ITopologyContainer : IDispatch {
        [id(0x00000001), propget, helpstring("Gets count of the Topology objects in the container.")]
        HRESULT Count([out, retval] long* pVal);
        
		[id(0x00000002), propget, helpstring("Gets pointer to the Topology at the specified index.")]
        HRESULT Topology(
                        [in] long nIndex, 
                        [out, retval] ITopology** pVal);
        
		[id(0x00000003), helpstring("Creates a Topology object and adds to to the end of the Topology collection. Returns pointer to the created object. Raises the E_INVALID_OPERATION error if the maximal allowed number of Topology objects is reached.")]
        HRESULT CreateTopology([out, retval] ITopology** pVal);
        
		[id(0x00000004), helpstring("Deletes the specified Topology object. Raises the E_INVALID_OPERATION error if a Polygon of the Topology cannot be deleted because is contained  in the Parents collection of a Polygon of an other Topology.")]
        HRESULT DeleteTopology([in] ITopology* pTopology);
    };
};
