Schema: Extended_basic_geometry_arm



SCHEMA Extended_basic_geometry_arm;

USE FROM Basic_geometry_arm;    -- ISO/TS 10303-1652

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

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


ENTITY Axis_placement_2d
  SUBTYPE OF (Axis_placement);
END_ENTITY;

ENTITY Axis_placement_3d
  SUBTYPE OF (Axis_placement);
END_ENTITY;

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 Detailed_geometric_model_element_relationship;
  item_1 : Detailed_geometric_model_element;
  item_2 : Detailed_geometric_model_element;
WHERE
  WR1: item_1 <> item_2;
END_ENTITY;

ENTITY Geometric_model_element_relationship
  SUBTYPE OF (Detailed_geometric_model_element_relationship, Detailed_geometric_model_element);
END_ENTITY;

ENTITY Geometric_model_relationship
  SUBTYPE OF (Representation_relationship);
  SELF\Representation_relationship.rep_1 : Geometric_model;
  SELF\Representation_relationship.rep_2 : Geometric_model;
WHERE
  WR1: rep_1 <> rep_2;
END_ENTITY;

ENTITY Vector
  SUBTYPE OF (Detailed_geometric_model_element);
  orientation : Direction;
  magnitude : length_measure;
WHERE
  WR1: magnitude >= 0.0;
END_ENTITY;

SUBTYPE_CONSTRAINT alternate_extended_geometry_items FOR Detailed_geometric_model_element;
  ONEOF (Cartesian_point,
         Direction,
         Axis_placement,
         Cartesian_transformation_2d,
         Cartesian_transformation_3d,
         Curve,
         Point_on_curve,
         Point_on_surface,
         Surface,
         Vector);
END_SUBTYPE_CONSTRAINT;

SUBTYPE_CONSTRAINT axis_placement_subtypes FOR Axis_placement;
  ONEOF (Axis_placement_2d,
         Axis_placement_3d);
END_SUBTYPE_CONSTRAINT;

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;  -- Extended_basic_geometry_arm