note
	description: "[
		Provides functions to clip one polygon against another.
		]"
	author: "Jimmy J. Johnson"

class
	POLYGON_CLIPPER

inherit

	ANY
		redefine
			default_create
		end

create
	default_create

feature {NONE} -- Initialization

	default_create
			-- Set up Current
		do
			create clipping_results.make
		end

feature -- Query

	clipped (polygon, other: EV_MODEL_POLYGON): LINKED_LIST [EV_MODEL_POLYGON]
			-- The polygon representing the intersection of `polygon' and `other'
		local
			e_count, other_e_count: INTEGER
			i, j: INTEGER
		do
			create Result.make
			e_count := polygon.point_count - 1
			other_e_count := other.point_count - 1
			from i := 1
			until i > e_count
			loop
				from j := 1
				until j > other_e_count
				loop
					j := j + 1
				end
			i := i + 1
			end
		end

feature {NONE} -- Implementation

	clipping_results: LINKED_LIST [EV_MODEL_POLYGON]
			-- Holds intermediate calculations

end
