(*
	$Id$
	ISO TC184/SC4/WG12 N4751 - ISO/CD-TS 10303-1008 Layer assignment - EXPRESS MIM
	Supersedes ISO TC184/SC4/WG12 N667
*) 

SCHEMA Layer_assignment_mim; 

USE FROM Foundation_representation_mim;    -- ISO/TS 10303-1006

USE FROM Group_mim;	-- ISO/TS 10303-1113

USE FROM presentation_organization_schema   -- ISO 10303-46
  (presentation_layer_assignment); 

USE FROM geometry_schema(geometric_representation_item); -- ISO 10303-42

USE FROM topology_schema(topological_representation_item); -- ISO 10303-42


  ENTITY rep_item_group
    SUBTYPE OF (group, representation_item);
    WHERE
      WR1: SIZEOF(USEDIN(SELF,'LAYER_ASSIGNMENT_MIM.' + 'PRESENTATION_LAYER_ASSIGNMENT.' + 'ASSIGNED_ITEMS')) > 0;
      WR2: SIZEOF(QUERY(r <* USEDIN(SELF,'LAYER_ASSIGNMENT_MIM.' + 'REPRESENTATION.' + 'ITEMS') | r.name = 'group representation')) > 0;
      WR3: SIZEOF(QUERY(ga <* USEDIN(SELF,'LAYER_ASSIGNMENT_MIM.' + 'GROUP_ASSIGNMENT.' + 'ASSIGNED_GROUP') | ga.role.name <> 'group membership')) = 0;
      WR4: SIZEOF(['LAYER_ASSIGNMENT_MIM.' + 'GEOMETRIC_REPRESENTATION_ITEM', 'LAYER_ASSIGNMENT_MIM.' + 'TOPOLOGICAL_REPRESENTATION_ITEM', 'LAYER_ASSIGNMENT_MIM.' + 'MAPPED_ITEM','LAYER_ASSIGNMENT_MIM.' + 'STYLED_ITEM'] * TYPEOF(SELF)) = 1;
  END_ENTITY;

END_SCHEMA; 