(*
 * $Id$
 *
 * JSDAI(TM), a way to implement STEP, ISO 10303
 * Copyright (C) 1997-2008, LKSoftWare GmbH, Germany
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License
 * version 3 as published by the Free Software Foundation (AGPL v3).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * JSDAI is a registered trademark of LKSoftWare GmbH, Germany
 * This software is also available under commercial licenses.
 * See also http://www.jsdai.net/
 *)

(* 
   Derived from ISO/TC184/SC4 WG12N2607 - ISO/TS 10303-1343 Product_placement - EXPRESS ARM
   by LKSoftWare GmbH for implementation purpose within IDA-STEP(TM)
*)

SCHEMA Product_placement_xim;

USE FROM Contextual_shape_positioning_xim;
USE FROM Physical_breakdown_xim;
USE FROM Product_occurrence_xim;

USE FROM representation_schema(representation_map);

(* All 3 entities from ARM are splitted into 2 - xxx__mi and xxx__rrwt according suprtype in the AIM *)

ENTITY Occurrence_placement__mi
	ABSTRACT SUPERTYPE OF (ONEOF(Part_occurrence_placement__mi,Physical_element_placement__mi))
	(* CONNOTATIONAL *) SUBTYPE OF (mapped_item);
  reference_physical_element: Physical_element_definition;
  reference_geometric_space : shape_representation;
  positioned_representation : template_instance;
  (* attribute below is overlapping with positioned_representation *)
 DERIVE
  SELF\mapped_item.mapping_source : representation_map :=?;
END_ENTITY;

ENTITY Occurrence_placement__rrwt
	ABSTRACT SUPERTYPE OF (ONEOF(Part_occurrence_placement__rrwt,Physical_element_placement__rrwt))
	(* CONNOTATIONAL *) SUBTYPE OF (representation_relationship_with_transformation);
  reference_physical_element                                               : Physical_element_definition;
  SELF\representation_relationship.rep_2 RENAMED reference_geometric_space : shape_representation;
  SELF\representation_relationship.rep_1 RENAMED positioned_representation : template_instance;
END_ENTITY;

ENTITY Part_occurrence_placement__mi
SUBTYPE OF(Occurrence_placement__mi);
  placed_part_occurrence: Single_instance;
END_ENTITY;

ENTITY Part_occurrence_placement__rrwt
SUBTYPE OF(Occurrence_placement__rrwt);
  placed_part_occurrence: Single_instance;
 DERIVE
  SELF\representation_relationship.name : label := 'instance placement';
END_ENTITY;

ENTITY Physical_element_placement__mi
SUBTYPE OF(Occurrence_placement__mi);
  placed_physical_element: Physical_element_definition;
WHERE
WR1: placed_physical_element\product_definition.formation :<>: 
	SELF\Occurrence_placement__mi.reference_physical_element\product_definition.formation;
END_ENTITY;

ENTITY Physical_element_placement__rrwt
SUBTYPE OF(Occurrence_placement__rrwt);
  placed_physical_element: Physical_element_definition;
 DERIVE
  SELF\representation_relationship.name : label := 'component placement';
WHERE
WR1: placed_physical_element\product_definition.formation :<>: 
	SELF\Occurrence_placement__rrwt.reference_physical_element\product_definition.formation;
END_ENTITY;

END_SCHEMA;
