(*
 * $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 Part template 3d shape - EXPRESS ARM
   by LKSoftWare GmbH for implementation purpose within IDA-STEP(TM)
*)

SCHEMA Part_template_3d_shape_xim;

	USE FROM Edge_shape_feature_xim;	-- ISO/TS 10303-1673
	USE FROM Part_template_extension_xim;	-- ISO/TS 10303-1718
	
	USE FROM Part_template_3d_shape_mim;

REFERENCE FROM Requirement_decomposition_xim(get_rvd);

	TYPE pt3ds_physical_unit_shape_model_select = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON physical_unit_shape_model_select WITH 
	    (Part_template_3d_shape_model);
  	END_TYPE; 

 	  TYPE pt3ds_part_template_or_physical_unit_3d_shape_model_select = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON part_template_or_physical_unit_3d_shape_model_select WITH
	    (Part_template_3d_shape_model);
	  END_TYPE;

  ENTITY Edge_segment_cross_section_armx
    (* CONNOTATIONAL *) SUBTYPE OF (Shape_definition_3d_intersection_armx, edge_segment_cross_section);
      SELF\Shape_definition_3d_intersection_armx.surface_intersection_result : Edge_shape_model;
      SELF\Shape_definition_3d_intersection_armx.projected_volume            : Part_template_3d_shape_model;
    DERIVE
      cross_section_reference                                           : edge_segment_vertex_armx := SELF\Shape_definition_3d_intersection_armx.projected_volume\Part_template_shape_model.shape_characterized_definition[1]\Inter_stratum_feature_edge_segment_template_armx.start_vertex;
      associated_template                                               : Template_definition :=  SELF\Shape_definition_3d_intersection_armx.projected_volume\Part_template_shape_model.shape_characterized_definition[1];      
    INVERSE
      referencing_template : inter_stratum_feature_edge_segment_template_with_cross_section_armx FOR cross_section;
    WHERE
      WR1 : associated_template :=: referencing_template;
  END_ENTITY;

  ENTITY Inter_stratum_feature_edge_segment_template_with_cross_section_armx
    SUBTYPE OF (Inter_stratum_feature_edge_segment_template_armx, inter_stratum_feature_edge_segment_template_with_cross_section);
      cross_section  : Edge_segment_cross_section_armx;
  END_ENTITY;
  
  ENTITY Part_template_3d_keepout_shape_model
    (* CONNOTATIONAL *) SUBTYPE OF (Non_feature_shape_model,
    	Part_template_keepout_shape_model);
	DERIVE
  		application_technology_constraint: SET[0:?] OF Requirement_view_definition :=
		  get_rvd(SELF, 'application technology constraint');
		SELF\Representation.name : label := '3d bound volume shape';
	WHERE
   		WR1 : SIZEOF(application_technology_constraint) <= 1;
  END_ENTITY;

  ENTITY Part_template_3d_shape_model
    (* CONNOTATIONAL *) SUBTYPE OF (Part_template_shape_model);
    DERIVE
      SELF\Representation.name : label := '3d bound volume shape';
		WHERE
			WR1 : (SIZEOF(USEDIN(SELF,
 'EXTENDED_BASIC_GEOMETRY_XIM.' + 'REFERENCE_GEOMETRIC_REPRESENTATION_RELATIONSHIP__SRR.' + 'RELATED_FEATURE_SHAPE')) = 0);       
			WR2 : (SIZEOF(USEDIN(SELF,
 'EXTENDED_BASIC_GEOMETRY_XIM.' + 'REFERENCE_GEOMETRIC_REPRESENTATION_RELATIONSHIP__MI.' + 'RELATED_FEATURE_SHAPE')) = 0);       
  END_ENTITY;


END_SCHEMA;

