| Application module: Geometric model relationship | ISO/TS 10303-1403:2014-02(E)  © ISO  | 
         
         (*
ISO TC184/SC4/WG12 N8023 - ISO/TS 10303-1403 Geometric model relationship - EXPRESS ARM
Supersedes 
         ISO TC184/SC4/WG12 N6905
*)
         
SCHEMA Geometric_model_relationship_arm;
         USE FROM
         Elemental_geometric_shape_arm;
            -- ISO/TS 10303-1004
         REFERENCE FROM 
         Support_resource_arm   -- ISO/TS 10303-1800
  (bag_to_set);
         
TYPE geometric_representation_select =
         
         EXTENSIBLE
         
         GENERIC_ENTITY
         
         
         SELECT
            (Geometric_model);
         END_TYPE; 
         
ENTITY Definitional_representation_relationship
           SUBTYPE OF (Representation_relationship);
WHERE
           WR1: acyclic_representation_relationship(SELF,
            [SELF\representation_relationship.rep_2],
            'FOUNDATION_REPRESENTATION_ARM.'+
            'REPRESENTATION');
         
         END_ENTITY;
ENTITY Geometric_model_relationship
           SUBTYPE OF (Representation_relationship);
           SELF\Representation_relationship.rep_1 : geometric_representation_select;
           SELF\Representation_relationship.rep_2 : geometric_representation_select;
WHERE
           WR1: rep_1 <> rep_2;
         
         END_ENTITY;
FUNCTION acyclic_representation_relationship
 (relation : Representation_relationship; relatives : SET[1:?] OF Representation; specific_relation : STRING) : BOOLEAN;
         LOCAL
    x : SET OF representation_relationship;
  END_LOCAL;
  IF relation.rep_1 IN relatives THEN
    RETURN (FALSE);
  END_IF;
  x := QUERY(r <* bag_to_set(USEDIN(relation.rep_1, 'FOUNDATION_REPRESENTATION_ARM.' + 'REPRESENTATION_RELATIONSHIP.' + 'REP_2')) | specific_relation IN TYPEOF(r));
  REPEAT i := 1 TO HIINDEX(x);
    IF NOT acyclic_representation_relationship(x[i], relatives + relation.rep_1, specific_relation) THEN
      RETURN (FALSE);
    END_IF;
  END_REPEAT;
  RETURN (TRUE);
         END_FUNCTION;
         
         END_SCHEMA;  -- Geometric_model_relationship_arm
© ISO 2014 — All rights reserved