------------------------------------------------------------------------------
--                                                                          --
--                             SYSTEM ET                                    --
--                                                                          --
--                             STOP MASK                                    --
--                                                                          --
--                              S p e c                                     --
--                                                                          --
--         Copyright (C) 2017 - 2022 Mario Blunk, Blunk electronic          --
--                                                                          --
--    This program is free software: you can redistribute it and/or modify  --
--    it under the terms of the GNU General Public License as published by  --
--    the Free Software Foundation, either version 3 of the License, or     --
--    (at your option) any later version.                                   --
--                                                                          --
--    This program is distributed in the hope that it will be useful,       --
--    but WITHOUT ANY WARRANTY; without even the implied warranty of        --
--    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         --
--    GNU General Public License for more details.                          --
--                                                                          --
--    You should have received a copy of the GNU General Public License     --
--    along with this program.  If not, see <http://www.gnu.org/licenses/>. --
------------------------------------------------------------------------------

--   For correct displaying set tab width in your edtior to 4.

--   The two letters "CS" indicate a "construction site" where things are not
--   finished yet or intended for the future.

--   Please send your questions and comments to:
--
--   info@blunk-electronic.de
--   or visit <http://www.blunk-electronic.de> for more contact data
--
--   history of changes:
--
--   to do:

with ada.containers; 			use ada.containers;
with ada.containers.doubly_linked_lists;
with ada.strings;				use ada.strings;

with et_pcb_coordinates_2;		use et_pcb_coordinates_2;
with et_geometry;				use et_geometry;
with et_board_shapes_and_text;	use et_board_shapes_and_text;
with et_conductor_segment;
with et_text;

with et_logging;				use et_logging;


package et_stop_mask is

	use pac_geometry_2;
	use pac_contours;
	use pac_text_board;


-- LINES:
	
	type type_stop_line is new		
		et_conductor_segment.type_conductor_line with null record;
	-- CS inherits a linewidth of type_track_width. Use a dedicated type
	-- for linewidth if requried.

	package pac_stop_lines is new doubly_linked_lists (type_stop_line);
	use pac_stop_lines;

	
	-- Mirrors a list of lines along the given axis:
	procedure mirror_lines (
		lines	: in out pac_stop_lines.list;
		axis	: in type_axis_2d := Y);					

	-- Rotates a list of lines by the given angle:
	procedure rotate_lines (
		lines	: in out pac_stop_lines.list;
		angle	: in type_rotation_model);					

	-- Moves a list of lines by the given offset:
	procedure move_lines (
		lines	: in out pac_stop_lines.list;
		offset	: in type_distance_relative);					


	

-- ARCS:
	
	type type_stop_arc is new
		et_conductor_segment.type_conductor_arc with null record;
	-- CS inherits a linewidth of type_track_width. Use a dedicated type
	-- for linewidth if requried.

	package pac_stop_arcs is new doubly_linked_lists (type_stop_arc);
	use pac_stop_arcs;	


	-- Mirrors a list of arcs along the given axis:
	procedure mirror_arcs (
		arcs	: in out pac_stop_arcs.list;
		axis	: in type_axis_2d := Y);					

	-- Rotates a list of arcs by the given angle:
	procedure rotate_arcs (
		arcs	: in out pac_stop_arcs.list;
		angle	: in type_rotation_model);					

	-- Moves a list of arcs by the given offset:
	procedure move_arcs (
		arcs	: in out pac_stop_arcs.list;
		offset	: in type_distance_relative);					



-- CIRCLES:
	
	type type_stop_circle is new
		et_conductor_segment.type_conductor_circle with null record;
	-- CS inherits a linewidth of type_track_width. Use a dedicated type
	-- for linewidth if requried.

	package pac_stop_circles is new doubly_linked_lists (type_stop_circle);
	use pac_stop_circles;

	-- Mirrors a list of circles along the given axis:
	procedure mirror_circles (
		circles	: in out pac_stop_circles.list;
		axis	: in type_axis_2d := Y);					

	-- Rotates a list of circles by the given angle:
	procedure rotate_circles (
		circles	: in out pac_stop_circles.list;
		angle	: in type_rotation_model);					

	-- Moves a list of circles by the given offset:
	procedure move_circles (
		circles	: in out pac_stop_circles.list;
		offset	: in type_distance_relative);					


	
-- CONTOURS:
	
	type type_stop_contour is new type_contour with null record;
	package pac_stop_contours is new doubly_linked_lists (type_stop_contour);
	use pac_stop_contours;

	-- Mirrors a list of contours along the given axis:
	procedure mirror_contours (
		contours	: in out pac_stop_contours.list;
		axis		: in type_axis_2d := Y);					

	-- Rotates a list of contours by the given angle:
	procedure rotate_contours (
		contours	: in out pac_stop_contours.list;
		angle		: in type_rotation_model);					

	-- Moves a list of contours by the given offset:
	procedure move_contours (
		contours	: in out pac_stop_contours.list;
		offset		: in type_distance_relative);					






-- TEXTS:
	
	-- for texts in conductor layer to be exposed:
	type type_stop_text is new type_text_fab_with_content with record
		vectors	: type_vector_text;
	end record;	

	package pac_stop_texts is new doubly_linked_lists (type_stop_text);
	use pac_stop_texts;

	-- Mirrors a list of texts along the given axis:
	procedure mirror_texts (
		texts	: in out pac_stop_texts.list;
		axis	: in type_axis_2d := Y);					

	-- Rotates a list of texts by the given angle:
	procedure rotate_texts (
		texts	: in out pac_stop_texts.list;
		angle	: in type_rotation_model);					

	-- Moves a list of texts by the given offset:
	procedure move_texts (
		texts	: in out pac_stop_texts.list;
		offset	: in type_distance_relative);					


	
	-- This is the type for stopmask objects in general.
	-- This has nothing to do with the stop mask of pads.
	type type_stopmask is tagged record
		lines 		: pac_stop_lines.list;
		arcs		: pac_stop_arcs.list;
		circles		: pac_stop_circles.list;
		contours	: pac_stop_contours.list;
		texts		: pac_stop_texts.list;
	end record;


	
	-- Logs the properties of the given arc of stop mask
	procedure arc_stop_mask_properties (
		face			: in type_face;
		cursor			: in pac_stop_arcs.cursor;
		log_threshold 	: in type_log_level);

	-- Logs the properties of the given circle of stop mask
	procedure circle_stop_mask_properties (
		face			: in type_face;
		cursor			: in pac_stop_circles.cursor;
		log_threshold 	: in type_log_level);

	-- Logs the properties of the given line of stop mask
	procedure line_stop_mask_properties (
		face			: in type_face;
		cursor			: in pac_stop_lines.cursor;
		log_threshold 	: in type_log_level);

	-- Logs the properties of the given stop mask text
	procedure text_stop_mask_properties (
		face			: in type_face;
		cursor			: in pac_stop_texts.cursor;
		log_threshold 	: in type_log_level);

	
end et_stop_mask;

-- Soli Deo Gloria

-- For God so loved the world that he gave 
-- his one and only Son, that whoever believes in him 
-- shall not perish but have eternal life.
-- The Bible, John 3.16
