(*
   $Id$
   ISO TC184/SC4/WG12 N3834 - ISO/TS 10303-1613 Physical unit non planar design view - EXPRESS ARM
   Supersedes ISO TC184/SC4/WG12 N3573
*)

SCHEMA Physical_unit_non_planar_design_view_arm;
  
	USE FROM Manifold_subsurface_arm;	-- ISO/TS 10303-1702
	USE FROM Physical_unit_design_view_arm;	-- ISO/TS 10303-1728

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

  ENTITY Assembly_component_non_planar_shape_model
    SUBTYPE OF (Manifold_subsurface_model);
      shape_characterized_component : SET[1:?] OF Assembly_component;
    DERIVE
      equivalent_reference_shape_model : SET [0:1] OF Geometric_model_relationship :=
        bag_to_set(QUERY( gmr <* USEDIN(SELF, 'EXTENDED_BASIC_GEOMETRY_ARM.GEOMETRIC_MODEL_RELATIONSHIP.REP_2') |
        (gmr\Representation_relationship.relation_type = 'equivalent reference shape model')));      
    WHERE
      WR1 : NOT EXISTS(SELF\Representation.description);
      WR2 : SIZEOF(equivalent_reference_shape_model) < 2;
  END_ENTITY;


  RULE unique_assembly_component_non_planar_shape_model FOR (Assembly_component_non_planar_shape_model);
   LOCAL
     ac : BAG OF Assembly_component := [];
   END_LOCAL;
   REPEAT i := 1 to SIZEOF(Assembly_component_non_planar_shape_model) by 1;
     ac  := ac + Assembly_component_non_planar_shape_model[i].shape_characterized_component;
   END_REPEAT;  
  WHERE
   WR1 : SIZEOF(ac) = SIZEOF(bag_to_set(ac));
  END_RULE;

END_SCHEMA;
