(*
 * $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 Form features - EXPRESS ARM
   by LKSoftWare GmbH for implementation purpose within IDA-STEP(TM)
*)

SCHEMA Edge_shape_feature_xim;

USE FROM Layered_3d_shape_xim;
USE FROM Characteristic_xim;	-- ISO/TS 10303-1654

  TYPE board_side = ENUMERATION OF (primary, secondary); 
  END_TYPE;

  ENTITY Bevel_edge_feature_shape_model
    (* CONNOTATIONAL *) SUBTYPE OF (Edge_shape_model);
      bevel_width : Length_tolerance_characteristic;
      bevel_angle : Tolerance_characteristic;
    DERIVE
      SELF\Representation.name : label := 'bevel edge feature shape';
    WHERE  
      WR1 : ('CHARACTERISTIC_XIM.STATISTICAL_TOLERANCE_CHARACTERISTIC' IN TYPEOF(bevel_angle)) OR
        ('CHARACTERISTIC_XIM.SYMMETRICAL_TOLERANCE_CHARACTERISTIC' IN TYPEOF(bevel_angle)) OR
        (SIZEOF(QUERY(it <* bevel_angle\Representation.items |
          NOT('VALUE_WITH_UNIT_EXTENSION_XIM.PLANE_ANGLE_MEASURE_WITH_UNIT' IN TYPEOF(bevel_angle\Representation.items))
         )) = 0);
      WR2 : NOT('CHARACTERISTIC_XIM.SYMMETRICAL_TOLERANCE_CHARACTERISTIC' IN TYPEOF(bevel_angle)) OR
        (SIZEOF(QUERY(it <* bevel_angle\Representation.items |
        ('VALUE_WITH_UNIT_EXTENSION_XIM.PLANE_ANGLE_MEASURE_WITH_UNIT' IN TYPEOF(bevel_angle\Representation.items))
           )) = 1);  
  END_ENTITY;

  ENTITY Edge_shape_model
    ABSTRACT SUPERTYPE OF (ONEOF (Bevel_edge_feature_shape_model,
 Step_edge_feature_shape_model,
 Radius_edge_feature_shape_model))
    (* CONNOTATIONAL *) SUBTYPE OF (Planar_shape_model);
      applied_surface : board_side;
    WHERE
      WR1 : SIZEOF(QUERY(escss <* USEDIN(SELF,
 'LAYERED_3D_SHAPE_XIM.SHAPE_DEFINITION_3D_INTERSECTION_ARMX.SURFACE_INTERSECTION_RESULT') | NOT ('PART_TEMPLATE_3D_SHAPE_XIM.EDGE_SEGMENT_CROSS_SECTION_ARMX' IN TYPEOF(escss)))) = 0; 
  END_ENTITY;

  ENTITY Radius_edge_feature_shape_model
    (* CONNOTATIONAL *) SUBTYPE OF (Edge_shape_model);
      radius_length : Length_tolerance_characteristic;
    DERIVE
      SELF\Representation.name : label := 'radius edge feature shape';
  END_ENTITY;

  ENTITY Step_edge_feature_shape_model
    (* CONNOTATIONAL *) SUBTYPE OF (Edge_shape_model);
      step_width : Length_tolerance_characteristic;
      step_depth : Length_tolerance_characteristic;
    DERIVE
      SELF\Representation.name : label := 'step edge feature shape';
  END_ENTITY;

END_SCHEMA;


