(*
 * $Id$
 *
 * JSDAI(TM), a way to implement STEP, ISO 10303
 * Copyright (C) 1997-2008, LKSoftWare GmbH, Germany
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License
 * version 3 as published by the Free Software Foundation (AGPL v3).
 *
 * 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * JSDAI is a registered trademark of LKSoftWare GmbH, Germany
 * This software is also available under commercial licenses.
 * See also http://www.jsdai.net/
 *)

(*schema_mapping curve_appearance(Curve_appearance_arm, Curve_appearance_mim);*)

(* Moved to styled_curve
entity_mapping Curve_appearance(Curve_appearance, curve_style);

attribute_mapping colour(colour, $PATH, Colour);
curve_style
curve_style.curve_colour ->
colour
end_attribute_mapping;

attribute_mapping width(width, curve_style.curve_width);

end_attribute_mapping;

attribute_mapping font(font, Curve_font);
curve_style
curve_style.curve_font -> curve_font_or_scaled_curve_font_select
curve_font_or_scaled_curve_font_select = curve_style_font_select
curve_style_font_select = curve_style_font
curve_style_font
end_attribute_mapping;

attribute_mapping font(font, User_defined_curve_font_armx);
curve_style
curve_style.curve_font -> curve_font_or_scaled_curve_font_select
curve_font_or_scaled_curve_font_select = curve_style_font_select
curve_style_font_select = curve_style_font
curve_style_font => user_defined_curve_font
end_attribute_mapping;

attribute_mapping font(font, Predefined_curve_font);
curve_style 
curve_style.curve_font
curve_style.curve_font -> curve_font_or_scaled_curve_font_select
curve_font_or_scaled_curve_font_select = curve_style_font_select
curve_style_font_select = pre_defined_curve_font
pre_defined_curve_font => draughting_pre_defined_curve_font
end_attribute_mapping;

attribute_mapping font(font, Externally_defined_curve_font_armx);
curve_style 
curve_style.curve_font
curve_style.curve_font -> curve_font_or_scaled_curve_font_select
curve_font_or_scaled_curve_font_select = curve_style_font_select
curve_style_font_select = externally_defined_curve_font
end_attribute_mapping;

end_entity_mapping;

entity_mapping Curve_font(Curve_font, curve_style_font);

attribute_mapping curve_font_name(curve_font_name, curve_style_font.name);

end_attribute_mapping;

end_entity_mapping;

entity_mapping Curve_font_pattern(Curve_font_pattern, curve_style_font_pattern);

attribute_mapping on_segment(on_segment, curve_style_font_pattern.visible_segment_length);

end_attribute_mapping;

attribute_mapping off_segment(off_segment, curve_style_font_pattern.invisible_segment_length);

end_attribute_mapping;

end_entity_mapping;
*)
(* Moved to styled_curve module
entity_mapping Externally_defined_curve_font_armx(Externally_defined_curve_font_armx, externally_defined_curve_font);

attribute_mapping curve_font_reference(curve_font_reference, externally_defined_item.source);
curve_style
curve_style.curve_font ->
curve_font_or_scaled_curve_font_select
curve_font_or_scaled_curve_font_select =
curve_style_font_select
curve_style_font_select
curve_style_font_select = externally_defined_curve_font
externally_defined_curve_font <=
externally_defined_item
externally_defined_item.source
end_attribute_mapping;

end_entity_mapping;
*)
(* Take from AIM
entity_mapping Externally_defined_marker(Externally_defined_marker, externally_defined_marker);

mapping_constraints;
externally_defined_marker <= 
[pre_defined_marker]
[externally_defined_symbol]
end_mapping_constraints;

attribute_mapping marker_reference(marker_reference, $PATH);
externally_defined_marker <=
externally_defined_symbol <=
externally_defined_item
externally_defined_item.source ->
external_source
external_source.source_id
end_attribute_mapping;

end_entity_mapping;
*)
entity_mapping Externally_defined_terminator(Externally_defined_terminator, externally_defined_terminator_symbol);

mapping_constraints;
externally_defined_terminator_symbol <= 
externally_defined_symbol
end_mapping_constraints;

attribute_mapping terminator_reference(terminator_reference, $PATH);
externally_defined_terminator_symbol <=
externally_defined_symbol <=
externally_defined_item
externally_defined_item.source ->
external_source
external_source.source_id
end_attribute_mapping;

end_entity_mapping;
(* Use AIM entity instead
entity_mapping Marker(Marker, marker_select);

mapping_constraints;
point_style.marker -> 
        marker_select
end_mapping_constraints;

attribute_mapping marker_name(marker_name, NO MAPPING);

end_attribute_mapping;

end_entity_mapping;
*)
entity_mapping Point_appearance(Point_appearance, point_style);

attribute_mapping size(size, point_style.marker_size, positive_length_measure);

end_attribute_mapping;

attribute_mapping colour(colour, , Colour);
point_style
point_style.marker_colour ->
colour
end_attribute_mapping;

attribute_mapping marker(marker, , marker_select);
point_style
point_style.marker -> 
marker_select
(marker_select = marker_type)
(marker_select = pre_defined_marker
pre_defined_marker =>
externally_defined_marker)
(marker_select = pre_defined_marker
pre_defined_marker =>
user_defined_marker)
end_attribute_mapping;

end_entity_mapping;
(* Moved to styled_curve
entity_mapping Predefined_curve_font(Predefined_curve_font, draughting_pre_defined_curve_font);

attribute_mapping curve_font_name(curve_font_name, $PATH);
draughting_pre_defined_curve_font <=
pre_defined_curve_font <=
pre_defined_item
pre_defined_item.name
end_attribute_mapping;

end_entity_mapping;
*)

(* Take from AIM
entity_mapping Predefined_marker(Predefined_marker, marker_type);

end_entity_mapping;

entity_mapping Predefined_terminator(Predefined_terminator, predefined_terminator_symbol);

mapping_constraints;
pre_defined_terminator_symbol <=
pre_defined_symbol

end_mapping_constraints;

end_entity_mapping;

entity_mapping Terminator(Terminator, terminator);

attribute_mapping terminator_name(terminator_name, NO MAPPING);

end_attribute_mapping;

end_entity_mapping;
*)
(* Moved to styled_curve
entity_mapping User_defined_curve_font_armx(User_defined_curve_font_armx, user_defined_curve_font);

mapping_constraints;
user_defined_curve_font <=
[curve_style_font]
[mapped_item]

end_mapping_constraints;

attribute_mapping pattern(pattern, $PATH, Curve_font_pattern);
user_defined_curve_font <=
curve_style_font
curve_style_font.pattern_list ->
curve_style_font_pattern
end_attribute_mapping;

attribute_mapping segment_symbol(segment_symbol, $PATH, Shape_representation);
user_defined_curve_font <=
mapped_item
mapped_item.mapping_source ->
representation_map.mapped_representation ->
representation =>
shape_representation
end_attribute_mapping;

end_entity_mapping;
*)
entity_mapping User_defined_marker_armx(User_defined_marker_armx, user_defined_marker);

mapping_constraints;
user_defined_marker <=
[pre_defined_marker][mapped_item]

end_mapping_constraints;

attribute_mapping symbol(symbol, $PATH, Shape_representation);
user_defined_marker <=
mapped_item
mapped_item.mapping_source ->
representation_map.mapped_representation ->
representation =>
shape_representation
end_attribute_mapping;

end_entity_mapping;

entity_mapping User_defined_terminator(User_defined_terminator, user_defined_terminator_symbol);

mapping_constraints;
user_defined_terminator_symbol <=
[pre_defined_symbol]
[mapped_item]

end_mapping_constraints;

attribute_mapping symbol(symbol, $PATH, Shape_representation);
user_defined_terminator_symbol <=
mapped_item
mapped_item.mapping_source ->
representation_map.mapped_representation ->
representation =>
shape_representation
end_attribute_mapping;

end_entity_mapping;

entity_mapping Vector_appearance(Vector_appearance, vector_style);

mapping_constraints;
vector_style <=
[pre_defined_terminator_symbol <= 
pre_defined_symbol]
[curve_style] 

end_mapping_constraints;

attribute_mapping terminator_type(terminator_type, $PATH, Terminator);
vector_style <=
pre_defined_terminator_symbol <=
pre_defined_symbol
end_attribute_mapping;

end_entity_mapping;
(*end_schema_mapping;*)
