(*
   $Id$
   ISO TC184/SC4/WG12 N4777 - ISO/CD-TS 10303-1308 Picture representation - EXPRESS ARM
*)

SCHEMA Picture_representation_arm;

USE FROM Binary_representation_arm; -- ISO/CD-TS 10303-1369

USE FROM Presentation_hierarchy_arm; -- ISO/CD-TS 10303-1330
   
  CONSTANT 
    pre_defined_picture_representation_types : SET [0:?] OF STRING := [ 'JPEG', 'PNG', 'TIFF', 'BMP', 'GIF']; 
  END_CONSTANT;  
 
  TYPE picture_representation_element_select = EXTENSIBLE GENERIC_ENTITY SELECT
    (Styled_element, 
     Picture_representation_item, 
     Axis_placement_2d);
  END_TYPE; 

  TYPE pr_external_identification_item = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON external_identification_item WITH  
		(Externally_defined_picture_representation_item);
  END_TYPE;
  
  ENTITY Externally_defined_picture_representation_item 
    SUBTYPE OF (Picture_representation_item); 
    INVERSE 
      source : External_source_identification FOR item; 
    WHERE 
      WR1: NOT (SELF\Representation_item.name IN pre_defined_picture_representation_types); 
  END_ENTITY; 

  ENTITY Picture_representation 
    SUBTYPE OF (View_area); 
      SELF\Representation.items : SET[1:?] OF picture_representation_element_select;
    WHERE
      WR1: SIZEOF(QUERY(item <* items | 
        'PICTURE_REPRESENTATION_ARM.'+'PICTURE_REPRESENTATION_ITEM' IN TYPEOF(item))) = 1;
  END_ENTITY; 
 
  ENTITY Picture_representation_item 
    ABSTRACT SUPERTYPE OF( ONEOF (
    	Externally_defined_picture_representation_item,
    	Predefined_picture_representation_item))
    SUBTYPE OF (Bytes_representation_item);
  END_ENTITY; 
 
  ENTITY Predefined_picture_representation_item 
    SUBTYPE OF (Picture_representation_item); 
    WHERE 
      WR1: SELF\Representation_item.name IN pre_defined_picture_representation_types; 
  END_ENTITY; 

END_SCHEMA;