(*
 * $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 physical_unit_usage_view(Physical_unit_usage_view_arm, Physical_unit_usage_view_mim);*)


entity_mapping Derived_part_view_definition_relationship(Derived_part_view_definition_relationship, product_definition_relationship);

mapping_constraints;
product_definition_relationship
{product_definition_relationship.name = 'derived part view definition relationship'}

end_mapping_constraints;

attribute_mapping related_product_definition(related_product_definition, $PATH, Part_view_definition);
product_definition_relationship
product_definition_relationship.related_product_definition ->
product_definition

end_attribute_mapping;

attribute_mapping relating_product_definition(relating_product_definition, $PATH, Part_view_definition);
product_definition_relationship
product_definition_relationship.relating_product_definition ->
product_definition

end_attribute_mapping;

end_entity_mapping;


entity_mapping Connection_zone_in_usage_view(Connection_zone_in_usage_view, shape_aspect);

mapping_constraints;
{shape_aspect
shape_aspect.name = 'connection zone in usage view'}

end_mapping_constraints;

end_entity_mapping;

entity_mapping Connection_zone_map_identification_armx(Connection_zone_map_identification_armx, connection_zone_map_identification);

mapping_constraints;
{connection_zone_map_identification <=
[representation_relationship]
[shape_aspect]}

end_mapping_constraints;

attribute_mapping reference_connection_zone_shape(reference_connection_zone_shape, $PATH, Usage_view_connection_zone_terminal_shape_relationship_armx);
connection_zone_map_identification <=
representation_relationship
representation_relationship.rep_1 ->
representation =>
usage_view_connection_zone_terminal_shape_relationship

end_attribute_mapping;

attribute_mapping mapped_connection_zone_shape(mapped_connection_zone_shape, $PATH, Usage_view_connection_zone_terminal_shape_relationship_armx);
connection_zone_map_identification <=
representation_relationship
representation_relationship.rep_2 ->
representation =>
usage_view_connection_zone_terminal_shape_relationship

end_attribute_mapping;

end_entity_mapping;

entity_mapping Shape_feature(Shape_feature, 
			[/SUBTYPE(Part_feature)/]
		)
extended;

end_entity_mapping;

entity_mapping Part_feature(Part_feature, shape_aspect);

mapping_constraints;
(shape_aspect
{shape_aspect.description = 'part generic feature'})

end_mapping_constraints;

attribute_mapping material_state_change(material_state_change, $PATH);
shape_aspect
shape_definition = shape_aspect
shape_definition
characterized_definition = shape_definition
characterized_definition <-
property_definition.definition
property_definition <-
property_definition_representation.definition
property_definition_representation
property_definition_representation.used_representation ->
representation
{[representation
representation.name = 'material state change']
[representation
representation.items[i] ->
representation_item 
{(representation_item.name = 'material addition')
(representation_item.name = 'material removal')}]}

end_attribute_mapping;

attribute_mapping precedent_feature(precedent_feature, $PATH, Part_feature);

shape_aspect <-
shape_aspect_relationship.related_shape_aspect
{shape_aspect_relationship
shape_aspect_relationship.name = 'precedent feature'}
shape_aspect_relationship.relating_shape_aspect ->
shape_aspect

end_attribute_mapping;

attribute_mapping associated_definition(associated_definition, $PATH, Part_usage_view);
shape_aspect
shape_aspect.of_shape ->
product_definition_shape =>
physical_unit

end_attribute_mapping;

end_entity_mapping;

entity_mapping Part_feature_make_from_relationship(Part_feature_make_from_relationship, make_from_part_feature_relationship);

mapping_constraints;
{[make_from_part_feature_relationship <=
shape_aspect_relationship]
[make_from_part_feature_relationship <=
shape_aspect]}

end_mapping_constraints;

attribute_mapping associated_make_from(associated_make_from, $PATH, product_definition_relationship);
make_from_part_feature_relationship <=
shape_aspect
shape_aspect.of_shape ->
product_definition_shape <=
property_definition
property_definition.definition ->
characterized_definition 
characterized_definition = characterized_product_definition
characterized_product_definition
characterized_product_definition = product_definition_relationship
product_definition_relationship 

end_attribute_mapping;

attribute_mapping reusable_feature(reusable_feature, $PATH, Part_feature);
make_from_part_feature_relationship <=
shape_aspect_relationship
shape_aspect_relationship.relating_shape_aspect ->
shape_aspect

end_attribute_mapping;

attribute_mapping resultant_feature(resultant_feature, $PATH, Part_feature);
make_from_part_feature_relationship <=
shape_aspect_relationship
shape_aspect_relationship.related_shape_aspect ->
shape_aspect

end_attribute_mapping;

end_entity_mapping;

entity_mapping Part_feature_template_definition_armx(Part_feature_template_definition_armx, part_feature_template_definition);

mapping_constraints;
part_feature_template_definition <=
[shape_feature_definition <=
characterized_object]
[group]
end_mapping_constraints;

attribute_mapping id(id, group.id);
part_feature_template_definition <=
group
group.id
end_attribute_mapping;
(* Made derived
attribute_mapping feature_model(feature_model, $PATH, Part_feature_template_shape_model);
part_feature_template_definition <=
shape_feature_definition <=
characterized_object
characterized_definition = characterized_object
characterized_definition <-
property_definition.definition
property_definition <-
property_definition_representation.definition
property_definition_representation
property_definition_representation.used_representation ->
representation =>
shape_representation

end_attribute_mapping;
*)
end_entity_mapping;

entity_mapping Part_feature_template_shape_model(Part_feature_template_shape_model, shape_representation);

mapping_constraints;
{shape_representation <=
[representation
representation.description = 'part feature template shape model']
[representation <-
property_definition_representation.used_representation
property_definition_representation
property_definition_representation.definition ->
property_definition
property_definition.definition ->
characterized_definition
characterized_definition = characterized_object
characterized_object =>
shape_feature_definition =>
part_feature_template_definition]}
			
end_mapping_constraints;
(* Removed attribute
attribute_mapping shape_characterized_template(shape_characterized_template, $PATH, Part_feature_template_definition);

				shape_representation <=
				representation <-
				property_definition_representation.used_representation
				property_definition_representation
				property_definition_representation.definition ->
				property_definition
				property_definition.definition ->
				characterized_definition = characterized_object
				characterized_object =>
				shape_feature_definition =>
				part_feature_template_definition
				
end_attribute_mapping;
*)
end_entity_mapping;

entity_mapping Part_usage_view(Part_usage_view, physical_unit);

mapping_constraints;
physical_unit <=
product_definition
{product_definition <-
product_definition_context_association.definition
product_definition_context_association
{product_definition_context_association.role ->
product_definition_context_role
product_definition_context_role.name = 'part definition type'}
product_definition_context_association.frame_of_reference ->
product_definition_context <=
application_context_element
application_context_element.name = 'physical design usage'}

end_mapping_constraints;

end_entity_mapping;

entity_mapping Requirement_assignment_armx(Requirement_assignment_armx, requirement_assignment)
extended;

attribute_mapping assigned_to(assigned_to, , Part_feature);

					requirement_assigned_item *> puuv_requirement_assigned_item
					puuv_requirement_assigned_item = shape_aspect
				
end_attribute_mapping;

attribute_mapping assigned_to(assigned_to, , Interconnect_module);

					requirement_assigned_item *> puuv_requirement_assigned_item
					puuv_requirement_assigned_item = shape_aspect
					shape_aspect.of_shape ->
					product_definition_shape =>
					physical_unit
				
end_attribute_mapping;

end_entity_mapping;


entity_mapping Document_assignment(Document_assignment, applied_document_reference)
extended;

attribute_mapping is_assigned_to(is_assigned_to, , Part_feature);
						document_reference_item *> puuv_document_reference_item
						puuv_document_reference_item = shape_aspect
end_attribute_mapping;

end_entity_mapping;

entity_mapping Usage_concept_usage_relationship_armx(Usage_concept_usage_relationship_armx, usage_concept_usage_relationship)
extended;

attribute_mapping associated_usage(associated_usage, $PATH, Part_feature);

usage_concept_usage_relationship <=
item_identified_representation_usage
item_identified_representation_usage.definition ->
represented_definition 
represented_definition = shape_aspect                
shape_aspect
				
end_attribute_mapping;

end_entity_mapping;

entity_mapping Usage_view_connection_zone_terminal_shape_relationship_armx(Usage_view_connection_zone_terminal_shape_relationship_armx, usage_view_connection_zone_terminal_shape_relationship);

mapping_constraints;
{[usage_view_connection_zone_terminal_shape_relationship <=
representation_relationship_with_transformation]
[usage_view_connection_zone_terminal_shape_relationship <=
representation_relationship_with_transformation <=
representation_relationship
representation_relationship.name = 'usage view connection zone terminal shape relationship']
[usage_view_connection_zone_terminal_shape_relationship <=
representation]}

end_mapping_constraints;

attribute_mapping associated_usage_placement(associated_usage_placement, $PATH, axis2_placement);
usage_view_connection_zone_terminal_shape_relationship <=
representation_relationship_with_transformation
representation_relationship_with_transformation.transformation_operator ->
transformation
transformation = item_defined_transformation
item_defined_transformation.transform_item_1 ->
representation_item =>
geometric_representation_item =>
placement

end_attribute_mapping;

attribute_mapping associating_terminal_shape(associating_terminal_shape, $PATH, Shape_representation);
usage_view_connection_zone_terminal_shape_relationship <=
representation_relationship_with_transformation <=
representation_relationship
representation_relationship.rep_1 ->
representation =>
shape_representation

end_attribute_mapping;

attribute_mapping associated_usage(associated_usage, $PATH, Connection_zone_in_usage_view);
usage_view_connection_zone_terminal_shape_relationship <=
representation_relationship_with_transformation <=
representation_relationship
representation_relationship.rep_2 ->
{representation
representation.name = 'zone shape'}
{representation =>
shape_representation}
representation <-
property_definition_representation.used_representation
property_definition_representation
property_definition_representation.definition ->
property_definition
property_definition.definition ->
characterized_definition
characterized_definition = shape_definition
shape_definition
shape_definition = shape_aspect
shape_aspect
{shape_aspect
shape_aspect.description = 'connection zone'}

end_attribute_mapping;

attribute_mapping associated_connection_zone_shape_definition(associated_connection_zone_shape_definition, $PATH, Shape_representation);
usage_view_connection_zone_terminal_shape_relationship <=
representation_relationship_with_transformation <=
representation_relationship
representation_relationship.rep_2 ->
{representation
representation.name = 'zone shape'}
representation =>
shape_representation

end_attribute_mapping;

end_entity_mapping;
(*end_schema_mapping;*)
