(*
   $Id$
   ISO TC184/SC4/WG12 N3918 - ISO/TS 10303-1657 Component feature - EXPRESS ARM
   Supersedes ISO TC184/SC4/WG12 N3324
*)

SCHEMA Component_feature_arm;

	USE FROM Physical_unit_design_view_arm;	-- ISO/TS 10303-1728

	TYPE cf_groupable_item = SELECT BASED_ON groupable_item WITH 
	   (Component_feature);
	END_TYPE; 

	TYPE feature_select = EXTENSIBLE GENERIC_ENTITY SELECT
		(Part_feature);
	END_TYPE;

  ENTITY Component_feature
    ABSTRACT SUPERTYPE
    SUBTYPE OF (Shape_element);
      definition           : OPTIONAL feature_select;
      SELF\Shape_element.containing_shape RENAMED associated_component : Assembly_component;
      SELF\Shape_element.element_name : STRING;
    UNIQUE
      UR1 : definition,associated_component;
      UR2 : SELF\Shape_element.element_name, associated_component;
  END_ENTITY;

  ENTITY Component_feature_joint
     ABSTRACT SUPERTYPE
  SUBTYPE OF (Component_feature_relationship, Shape_element);
    SELF\Shape_element.element_name : STRING;
    SELF\Shape_element_relationship.relating RENAMED feature_1 : Component_feature;
    SELF\Shape_element_relationship.related RENAMED feature_2 : Component_feature;
    SELF\Shape_element.containing_shape RENAMED associated_definition : Item_shape;
    WHERE
      WR1 : feature_1 <> feature_2;
      WR2 : 'PRODUCT_VIEW_DEFINITION_ARM.PRODUCT_VIEW_DEFINITION' in TYPEOF(associated_definition);
      WR3 : SELF\Shape_element.containing_shape\Item_shape.described_element = feature_1\Shape_element.containing_shape\Item_shape.described_element;      
  END_ENTITY;

  ENTITY Component_feature_make_from_relationship
		SUBTYPE OF (Component_feature_relationship);
      SELF\Shape_element_relationship.relating RENAMED reusable_feature	: Component_feature;
      SELF\Shape_element_relationship.related RENAMED resultant_feature	: Component_feature;
  END_ENTITY;

  ENTITY Component_feature_relationship
    SUPERTYPE OF (ONEOF(Component_feature_joint,
      Component_feature_make_from_relationship))
  	SUBTYPE OF (Shape_element_relationship);
      SELF\Shape_element_relationship.relating : Component_feature;  	
      SELF\Shape_element_relationship.related  : Component_feature;
  END_ENTITY;

  ENTITY Component_feature_to_physical_usage_view_assignment;
      defined_part_feature   : Part_feature;
      assigned_design_object : Component_feature;
    UNIQUE 
    	UR1 : assigned_design_object;
    	UR2 : defined_part_feature;
  END_ENTITY;

  ENTITY Component_terminal
    SUBTYPE OF (Component_feature);
      local_swappable  : OPTIONAL BOOLEAN;
      global_swappable : OPTIONAL BOOLEAN;
      swap_code        : OPTIONAL STRING;
  END_ENTITY;

END_SCHEMA;
