(*
 $Id$
 ISO TC184/SC4/WG12 N4654 - ISO/CD-TS 10303-1001 Appearance assignment - EXPRESS ARM
 Supersedes ISO TC184/SC4/WG12 N4239
*)


SCHEMA Appearance_assignment_arm;

USE FROM Elemental_geometric_shape_arm;    -- ISO/TS 10303-1004

REFERENCE FROM Characterizable_object_arm(bag_to_set);  -- ISO/TS 10303-1765

  TYPE appearance_context = EXTENSIBLE GENERIC_ENTITY SELECT
    (Representation);
  END_TYPE; 

  TYPE appearance_select = EXTENSIBLE GENERIC_ENTITY SELECT;
  END_TYPE; 

  TYPE context_dependent_appearance_assignment_set = SET [2:?] OF Context_dependent_appearance_assignment; 
  END_TYPE;

  TYPE overriding_style_context = EXTENSIBLE GENERIC_ENTITY SELECT
    (Detailed_geometric_model_element, 
     Styled_model);
  END_TYPE;

  TYPE presented_model_select = EXTENSIBLE GENERIC_ENTITY SELECT
    (Styled_model); 
  END_TYPE;  

  TYPE styled_element_appearance = SELECT (
    Appearance_assignment, 
    context_dependent_appearance_assignment_set);
  END_TYPE;

  ENTITY Appearance_assignment;
    appearance_components : SET[1:?] OF appearance_select;
  END_ENTITY;

  ENTITY Context_dependent_appearance_assignment
    SUBTYPE OF (Appearance_assignment);
      context_definition : appearance_context;
  END_ENTITY;
  
  ENTITY Context_dependent_over_riding_styled_element
    SUBTYPE OF (Over_riding_styled_element);
      context_definition : LIST [1:?] OF overriding_style_context;
  END_ENTITY;

  ENTITY Over_riding_styled_element
    SUBTYPE OF (Styled_element);
      over_ridden_element : Styled_element;
  END_ENTITY;

  ENTITY Planar_box
    SUBTYPE OF (Detailed_geometric_model_element);
      size_in_x : length_measure;
      size_in_y : length_measure;
      placement : Axis_placement; 
  END_ENTITY;

  ENTITY Styled_element
    SUBTYPE OF (Representation_item);
      appearance : styled_element_appearance;
      element : Detailed_geometric_model_element;
      invisible : BOOLEAN;
  END_ENTITY;

  ENTITY Styled_model
    ABSTRACT SUPERTYPE
    SUBTYPE OF (Representation);
      version_id : OPTIONAL STRING;
      SELF\Representation.context_of_items : Geometric_coordinate_space;
    DERIVE
      styled_geometry : SET[0:?] OF Geometric_model := 
      bag_to_set(QUERY (r <* (USEDIN(SELF\Representation.context_of_items,
	 	'FOUNDATION_REPRESENTATION_ARM.' + 
	 	'REPRESENTATION.' + 'CONTEXT_OF_ITEMS')) | 
	 	'ELEMENTAL_GEOMETRIC_SHAPE_ARM.GEOMETRIC_MODEL' IN TYPEOF(r)));
  END_ENTITY;

  ENTITY Styled_model_replication 
    SUBTYPE OF (Representation_item); 
      replicated_model : Styled_model; 
      source : Axis_placement; 
      target : geometric_mapping_target; 
  END_ENTITY;

  SUBTYPE_CONSTRAINT aa_representation_item_subtypes FOR Representation_item;
    ONEOF (Styled_element,
           Styled_model_replication);
  END_SUBTYPE_CONSTRAINT;

END_SCHEMA;  
