(*
 $Id$
 ISO TC184/SC4/WG12 N4657 - ISO/CD-TS 10303-1311 Associative draughting elements - EXPRESS ARM
*)

SCHEMA Associative_draughting_elements_arm;

USE FROM Shape_property_assignment_arm; -- ISO/CD-TS 10303-1032

USE FROM Draughting_element_arm; -- ISO/CD-TS 10303-1310

  TYPE annotation_occurrence_associativity_item = SELECT
    (Fill_area,
     Leader,
     Projection_curve);
  END_TYPE;

  TYPE draughting_model_element_select = EXTENSIBLE GENERIC_ENTITY SELECT
    (Annotation_element,
     Axis_placement,
     Draughting_callout,
     Styled_model_replication);
  END_TYPE;

  TYPE draughting_model_item_association_select = SELECT
    (Annotation_element,
     Draughting_callout);
  END_TYPE;

  ENTITY Annotation_occurrence_associativity;
    relating_element : Annotation_element;
    related_element  : annotation_occurrence_associativity_item;
  END_ENTITY;

  ENTITY Draughting_model
    SUBTYPE OF (Styled_model);
      SELF\Representation.items : SET[1:?] OF draughting_model_element_select;
  UNIQUE
    UR1:  SELF\Representation.name;
  END_ENTITY;

  ENTITY Draughting_model_item_association;
    name            : STRING;
    definition      : Shape_element;
    identified_item : draughting_model_item_association_select;
    used_model      : Draughting_model;
    WHERE 
	  WR1: (NOT('DRAUGHTING_ELEMENT_SPECIALISATIONS_ARM.'+'DATUM_TARGET_CALLOUT' IN TYPEOF(identified_item)) OR
	       ('GEOMETRIC_TOLERANCE_ARM.'+'DATUM_TARGET' IN TYPEOF(definition)));
	  WR2: (NOT('DRAUGHTING_ELEMENT_SPECIALISATIONS_ARM.'+'GEOMETRIC_TOLERANCE_CALLOUT' IN TYPEOF(identified_item)) OR
	       ('GEOMETRIC_TOLERANCE_ARM.'+'GEOMETRIC_TOLERANCE' IN TYPEOF(definition)));
	  -- WRs capturing callout <- GD&T type for N:1 links and       
	  WR3: (NOT('DIMENSION_TOLERANCE_ARM.'+'SIZE_DIMENSION' IN TYPEOF(definition)) OR
	        (('DRAUGHTING_ELEMENT_SPECIALISATIONS_ARM.'+'DIMENSION_CALLOUT' IN TYPEOF(identified_item)) OR
	        ('DRAUGHTING_ELEMENT_ARM.'+'DIMENSION_CURVE_DIRECTED_CALLOUT' IN TYPEOF(identified_item)) OR
	        ('DRAUGHTING_ELEMENT_SPECIALISATIONS_ARM.'+'STRUCTURED_DIMENSION_CALLOUT' IN TYPEOF(identified_item))));
  END_ENTITY;

END_SCHEMA;