/******************************************************************************  		
 * Company:         SINED GmbH
 * Author:          Andriy Kurhanevych
 * Created:         4.10.2004
 * Last modified:   $Modtime: 01.03.13 21:45  $
 * Purpose:         Declaration of the Ring class
 ******************************************************************************/

#pragma once 
#ifndef POLYGONLIBRARY_RING_H
#define POLYGONLIBRARY_RING_H

#include "Polyline.h"

namespace PolygonLibrary
{
	class  Point;
	class  Rectangle;
	class  Node;
	class  Polygon;

	//////////////////////////////////////////////////////////////////////////
	/// Represents a polygon boundary loop defined as an auto-closed polyline
	/// (the closing edge of the ring connects its last and first vertices).
	/// 
	/// The Ring is valid if it encloses a not zero area and is simple 
	/// (not self-intersecting).
	/// 
	/// The Ring is a part of a Polygon and can be changed 
	/// only when the Polygon is editable (is not contained in the Parents collection 
	/// of an other Polygon).
	//////////////////////////////////////////////////////////////////////////
	class Ring : public Polyline
	{
	
	// ------------------------------ Interface -------------------------------
	public:
		
		/// Returns pointer to the Polygon this Ring belongs to.
		Polygon* Polygon() const;		

		/// Indicates if the ring is exterior (ring orientation is clockwise).
		bool      IsExterior() const;			
	
		// --- disable construction, destruction, copying, assignment ---
	private:
		Ring();
		Ring(const Ring&);
		~Ring();
		Ring& operator=(const Ring&);
	
	private:
	// --------------------------- Implementation ------------------------------
		friend class RingImpl;
		friend class RingEnumerator;
		friend class PolygonImpl;
		friend class PolygonLayerImpl;
		friend class PolygonOperations;
		friend class PolygonOperationsImpl;
		friend class PolylineLayerImpl;

		const RingImpl* impl() const; 
		RingImpl*       impl(); 
	};

}
#endif