(*
 * $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/WG12 N - ISO/CD-TS 10303-xxxx Assembly 2d shape - EXPRESS ARM
   by LKSoftWare GmbH for implementation purpose within IDA-STEP(TM)
*)

SCHEMA Assembly_2d_shape_xim;

USE FROM Physical_unit_2d_design_view_xim;

USE FROM Assembly_technology_xim;

	SUBTYPE_CONSTRAINT a2ds_component_2d_location_armx_subtypes FOR Component_2d_location_armx;         
	    ONEOF (Component_2d_edge_location,
	 Component_2d_stacked_location,
	 Component_2d_surface_location);    
	END_SUBTYPE_CONSTRAINT;

  ENTITY Bond_assembly_2d_position
  	(* CONNOTATIONAL *) SUBTYPE OF (mapped_item);
      bond                      : Assembled_with_bonding;
      assembly_model            : Physical_unit_planar_shape_model;
      bond_model                : Default_assembly_bond_shape_model;
      SELF\mapped_item.mapping_target RENAMED bond_definition_placement : axis2_placement_2d;
    DERIVE
    	SELF\representation_item.name : label := '';
    	SELF\mapped_item.mapping_source : representation_map := ?;
   UNIQUE
   	UR1 : bond;
  END_ENTITY;

  ENTITY Component_2d_edge_location
    (* CONNOTATIONAL *) SUBTYPE OF (Component_2d_location_armx);
      reference_terminal_assembly_joint : Assembly_joint_armx;
      mounting_surface_assembly_joint   : Assembly_joint_armx;
    DERIVE
      SELF\Representation_relationship.description : text := 'component edge';
    WHERE
      WR1 : reference_terminal_assembly_joint <> mounting_surface_assembly_joint;
      WR2 : SELF\Component_2d_location_armx.substrate_location = FALSE;
      WR3 : SIZEOF(['ASSEMBLY_MODULE_WITH_INTERCONNECT_COMPONENT_XIM.INTERCONNECT_MODULE_COMPONENT_TERMINAL',
                    'ASSEMBLY_MODULE_WITH_INTERCONNECT_COMPONENT_XIM.INTERCONNECT_MODULE_COMPONENT_SURFACE_FEATURE'] * TYPEOF(mounting_surface_assembly_joint.assembly_feature_1)) >= 1;
      WR4 : 'PACKAGE_XIM.PRIMARY_REFERENCE_TERMINAL_ARMX' IN TYPEOF(reference_terminal_assembly_joint\assembly_joint_armx.assembly_feature_1); 
  END_ENTITY;

  ENTITY Component_2d_stacked_location
    (* CONNOTATIONAL *) SUBTYPE OF (Component_2d_location_armx);
      mounting_joint : Assembly_joint_armx;
    DERIVE
      SELF\Representation_relationship.description : text := 'component stacked';
    WHERE
      WR1 : SIZEOF(['ASSEMBLY_MODULE_WITH_INTERCONNECT_COMPONENT_XIM.INTERCONNECT_MODULE_COMPONENT_TERMINAL',
                    'ASSEMBLY_MODULE_WITH_INTERCONNECT_COMPONENT_XIM.INTERCONNECT_MODULE_COMPONENT_SURFACE_FEATURE'] * TYPEOF(mounting_joint.assembly_feature_1)) = 0;
      WR2 : SIZEOF(['ASSEMBLY_MODULE_WITH_INTERCONNECT_COMPONENT_XIM.INTERCONNECT_MODULE_COMPONENT_TERMINAL',
                    'ASSEMBLY_MODULE_WITH_INTERCONNECT_COMPONENT_XIM.INTERCONNECT_MODULE_COMPONENT_SURFACE_FEATURE'] * TYPEOF(mounting_joint.assembly_feature_2)) = 0;
      WR3 : SELF\Component_2d_location_armx.substrate_location = FALSE;
  END_ENTITY;

  ENTITY Component_2d_surface_location
    (* CONNOTATIONAL *) SUBTYPE OF (Component_2d_location_armx);
      mounting_surface_assembly_joint : Assembly_joint_armx;
    DERIVE
      SELF\Representation_relationship.description : text := 'component surface';
    WHERE
      WR1 : SELF\Component_2d_location_armx.substrate_location = FALSE;
      WR2 : SIZEOF(['ASSEMBLY_MODULE_WITH_INTERCONNECT_COMPONENT_XIM.INTERCONNECT_MODULE_COMPONENT_TERMINAL',
                    'ASSEMBLY_MODULE_WITH_INTERCONNECT_COMPONENT_XIM.INTERCONNECT_MODULE_COMPONENT_SURFACE_FEATURE'] * TYPEOF(mounting_surface_assembly_joint.assembly_feature_1)) >= 1;
  END_ENTITY;

END_SCHEMA;




