(*
   $Id$
   ISO TC184/SC4/WG12 N3849 - ISO/TS 10303-1634 Assembly component placement requirements - EXPRESS ARM
   Supersedes ISO TC184/SC4/WG12 N3291
*)

SCHEMA Assembly_component_placement_requirements_arm;

USE FROM Assembly_module_with_interconnect_component_arm;	-- ISO/TS 10303-1643
REFERENCE FROM Requirement_decomposition_arm(get_rvd);	-- ISO/TS 10303-1740
REFERENCE FROM Characterizable_object_arm(bag_to_set);  -- ISO/TS 10303-1765

  SUBTYPE_CONSTRAINT acpr_predefined_requirement_view_definition_subtypes FOR Predefined_requirement_view_definition;   
    (ONEOF (Assembly_spacing_requirement_occurrence,
 	 Assembly_group_spacing_requirement_occurrence,
 	 Item_restricted_requirement_occurrence));
  END_SUBTYPE_CONSTRAINT;  
 
  TYPE restriction_basis_item = EXTENSIBLE SELECT(
    Predefined_requirement_view_definition,
    Part_feature);
  END_TYPE;

  TYPE acpr_requirement_assignment_item = EXTENSIBLE SELECT BASED_ON requirement_assignment_item WITH 
    (restriction_basis_item,
     Placement_group_requirement_definition);
  END_TYPE; 

  TYPE assembly_product_design_object_category = EXTENSIBLE ENUMERATION OF
    (assembly_component_category,
     assembly_module_component_category,
     assembly_module_component_terminal_category,
     assembly_module_macro_component_category,
     assembly_module_macro_component_join_terminal_category,
     bare_die_component_category,
     bare_die_component_terminal_category,
     buried_via_category,
     cable_component_category,
     component_feature_category,
     component_termination_passage_category,
     conductive_interconnect_element_with_pre_defined_transitions_category,
     cutout_category,
     cutout_edge_segment_category,
     dielectric_material_passage_category,
     embedded_physical_component_terminal_category,
     fiducial_category,
     fill_area_category,
     inter_stratum_feature_category,
     interconnect_component_interface_terminal_category,
     interconnect_component_join_terminal_category,
     interconnect_module_component_category,
     interconnect_module_component_stratum_based_terminal_category,
     interconnect_module_component_surface_feature_category,
     interconnect_module_component_terminal_category,
     interconnect_module_edge_category,
     interconnect_module_edge_segment_category,
     interconnect_module_macro_component_category,
     interconnect_module_macro_component_join_terminal_category,
     interface_access_material_removal_laminate_component_category,
     interface_access_stratum_feature_template_component_category,
     interface_component_category,
     interfacial_connection_category,
     internal_probe_access_area_category,
     laminate_component_category,
     minimally_defined_component_terminal_category,
     packaged_component_category,
     packaged_component_join_terminal_category,
     packaged_connector_component_category,
     packaged_connector_component_interface_terminal_category,
     physical_component_category,
     plated_passage_or_unsupported_passage_category,
     routed_interconnect_component_category,
     routed_physical_component_category,
     stratum_feature_category,
     via_category);
  END_TYPE;

  TYPE assembly_product_design_object_category_or_group = SELECT(
    assembly_product_design_object_category,
    Group);
  END_TYPE;    

  TYPE assembly_component_or_component_feature = SELECT(
    Assembly_component,
    Component_feature);
  END_TYPE;    

  TYPE assembly_spacing_type = EXTENSIBLE ENUMERATION OF
    (nearest_boundary,
     centroid,
     furthest_boundary);
  END_TYPE;

  ENTITY Assembly_group_spacing_requirement_occurrence
    SUBTYPE OF (Predefined_requirement_view_definition);
      dependent_group                                                     : Placement_group_requirement_definition;
      of_spacing_type                                                     : assembly_spacing_type;
      reference_group                                                     : Placement_group_requirement_definition;
      SELF\Predefined_requirement_view_definition.required_characteristic : Length_tolerance_characteristic;
   END_ENTITY;

  ENTITY Assembly_spacing_requirement_occurrence
    SUBTYPE OF (Predefined_requirement_view_definition);
      reference_design_object_category                                    : assembly_product_design_object_category_or_group;
      dependent_design_object_category                                    : assembly_product_design_object_category_or_group;
      SELF\Predefined_requirement_view_definition.required_characteristic : Length_tolerance_characteristic;
      of_spacing_type                                                     : assembly_spacing_type;
  END_ENTITY;

  ENTITY Component_group_assignment;
      associated_group   : Placement_group_requirement_definition;
      assigned_component : assembly_component_or_component_feature;
  END_ENTITY;

  ENTITY Component_placement_restriction_assignment;
      maximum_negative_component_height : OPTIONAL Length_tolerance_characteristic;
      maximum_positive_component_height : OPTIONAL Length_tolerance_characteristic;
      area                              : OPTIONAL Mounting_restriction_area;
      volume                            : OPTIONAL Mounting_restriction_volume;
      requirement                       : Item_restricted_requirement_occurrence;
      components_permitted              : BOOLEAN;
      mounting_clearance                : OPTIONAL Length_tolerance_characteristic;
    WHERE
      WR1 : EXISTS(area) OR EXISTS(volume);
  END_ENTITY;

  ENTITY Item_restricted_requirement_occurrence
    SUBTYPE OF (Predefined_requirement_view_definition);
      basis : restriction_basis_item;
    WHERE
      WR1 : SELF :<>: basis;
  END_ENTITY;

  ENTITY Mounting_restriction_area
    SUBTYPE OF (Non_feature_shape_element);
      mounting_surface                     : Interconnect_module_component_surface_feature;
      SELF\Non_feature_shape_element.scope : Assembly_module;
    WHERE
      WR1 : (SIZEOF(SELF\Non_feature_shape_element.element_shape) = 0) OR
            (SIZEOF(QUERY(es <* SELF\Non_feature_shape_element.element_shape | 
             NOT ('CONSTRUCTION_GEOMETRY_ARM.CONSTRUCTIVE_GEOMETRY' IN TYPEOF(es))
                  )) = 0);      
  END_ENTITY;

  ENTITY Mounting_restriction_volume
    SUBTYPE OF (Non_feature_shape_element);
      mounting_surface                     : Interconnect_module_component_surface_feature;
      SELF\Non_feature_shape_element.scope : Assembly_module;
    INVERSE
      volume : non_feature_shape_model FOR associated_element;
  END_ENTITY;

  ENTITY Placement_group_requirement_definition
    SUBTYPE OF (Requirement_view_definition);
      design_specific_usage : STRING; 
	DERIVE
  		requirement: SET[0:?] OF Requirement_view_definition :=
  		bag_to_set((QUERY(rvdr <* USEDIN (SELF, 'REQUIREMENT_DECOMPOSITION_ARM.'+
	'REQUIREMENT_VIEW_DEFINITION_RELATIONSHIP.PRIMARY') | (rvdr.relation_type = 'derived_from'))));
    INVERSE
      composition : SET [1:?] OF Component_group_assignment FOR associated_group;
	WHERE
   		WR1: EXISTS (requirement) AND (SIZEOF(requirement) >= 1);
        WR2: NOT EXISTS (SELF\Product_view_definition.name);
  END_ENTITY;

  ENTITY Placement_group_area_assignment;
      placed_group : Placement_group_requirement_definition;
      area         : Mounting_restriction_area;
  END_ENTITY;

  ENTITY Placement_group_volume_assignment;
      placed_group : Placement_group_requirement_definition;
      volume       : Mounting_restriction_volume;
  END_ENTITY;

END_SCHEMA;

