(*
   $Id$
   ISO TC184/SC4/WG12 N4988 - ISO/CD-TS 10303-1027 Contextual shape positioning - EXPRESS ARM
   Supersedes ISO TC184/SC4/WG12 N4251
*) 

SCHEMA Contextual_shape_positioning_arm;

USE FROM Extended_basic_geometry_arm; -- ISO/TS 10303-1667
USE FROM Shape_property_assignment_arm;    --  ISO/TS 10303-1032


  TYPE template_instance = SELECT
    (Geometric_placement_operation, 
     Geometric_model_relationship_with_transformation);
  END_TYPE; 

  TYPE template_definition_select = EXTENSIBLE SELECT (Geometric_model);
  END_TYPE; 

  ENTITY Contextual_shape_representation;
      contextual_shape          : Contextual_item_shape;
      representing_relationship : Geometric_model_relationship;
    DERIVE
      context_representation    : Geometric_model := representing_relationship.rep_2 ;
      positioned_representation : Geometric_model := representing_relationship.rep_1 ;
  END_ENTITY;

  ENTITY Geometric_composition_with_operator_transformation
    SUBTYPE OF (Geometric_relationship_with_operator_transformation,
      Definitional_representation_relationship);
  END_ENTITY;

  ENTITY Geometric_composition_with_placement_transformation
    SUBTYPE OF (Geometric_relationship_with_placement_transformation,
      Definitional_representation_relationship);
  END_ENTITY; 

  ENTITY Geometric_placement
    SUBTYPE OF (Geometric_placement_operation);
      target : Axis_placement;
  END_ENTITY; 

  ENTITY Geometric_placement_model
    SUBTYPE OF (Geometric_model);
      SELF\Representation.items : SET[1:1] OF Geometric_placement_operation;
  END_ENTITY;

  ENTITY Geometric_placement_operation
    ABSTRACT SUPERTYPE OF ( ONEOF (Geometric_placement,
      Geometric_operator_transformation))
    SUBTYPE OF (Detailed_geometric_model_element);
      source : Axis_placement;  
      template_definition : template_definition_select;
  END_ENTITY; 

  ENTITY Geometric_model_relationship_with_transformation
    ABSTRACT SUPERTYPE OF (ONEOF (Geometric_relationship_with_placement_transformation,
      Geometric_relationship_with_operator_transformation))
    SUBTYPE OF (Geometric_model_relationship);
    WHERE  
      WR1: rep_1.context_of_items :<>: rep_2.context_of_items;
  END_ENTITY;

  ENTITY Geometric_operator_transformation
    SUBTYPE OF (Geometric_placement_operation);
      target : cartesian_transformation;
  END_ENTITY; 

  ENTITY Geometric_relationship_with_operator_transformation
    SUBTYPE OF (Geometric_model_relationship_with_transformation);
      transformation: cartesian_transformation;
    WHERE
      WR1:  rep_1.context_of_items\Geometric_coordinate_space.dimension_count :=:
        rep_2.context_of_items\Geometric_coordinate_space.dimension_count;
  END_ENTITY;

  ENTITY Geometric_relationship_with_placement_transformation
    SUBTYPE OF (Geometric_model_relationship_with_transformation);
      transformation: Axis_placement_mapping;
    WHERE
      WR1:  rep_1.context_of_items\Geometric_coordinate_space.dimension_count :=:
        rep_2.context_of_items\Geometric_coordinate_space.dimension_count;
  END_ENTITY;

  ENTITY Shape_placement_association
    SUBTYPE OF (Shape_description_association);
      SELF\Shape_description_association.representation             : Geometric_placement_model;
      SELF\Shape_description_association.represented_characteristic : Contextual_item_shape;
END_ENTITY;

END_SCHEMA;

