(*
 * Copyright (c) 1991-2022 by STEP Tools Inc.
 * All Rights Reserved
 * 
 * This software is furnished under a license and may be used and
 * copied only in accordance with the terms of such license and with
 * the inclusion of the above copyright notice.  This software and
 * accompanying written materials or any other copies thereof may
 * not be provided or otherwise made available to any other person.
 * No title to or ownership of the software is hereby transferred.
 * 
 * Author: Blair Downie (downie@steptools.com)
 * 

2014-02-07 -- Changed shell_entity to have an explicit subordinate
	attribute for use with open shell.

2013-10-16 -- Changed line_entity to have an explicit form attribute
	to support form 1 and 2 of entity 110.  Added a new element
	construction_geometry to the use_flag enum.

2011-09-11 -- Changed shell_entity to have an explicit form attribute
	to support form 1 and 2 of entity 514.
 	
*)

SCHEMA iges_types_schema;

  REFERENCE FROM
    iges_curve_and_surface_geometry_schema (geometric_entity);
  REFERENCE FROM 
    iges_constructive_solid_geometry_schema (constructive_solid_geometry_entity);
  REFERENCE FROM 
    iges_boundary_representation_schema (boundary_representation_entity);
  REFERENCE FROM 
    iges_annotation_schema (annotation_entity,general_note_entity);
  REFERENCE FROM 
    iges_structure_schema  (structure_entity,definition_levels_entity,
			    associativity_entity, color_definition_entity,
			    line_font_definition_entity, view_entity,
			    views_visible_color_entity, views_visible_entity,
			    segmented_views_visible_entity, property_entity,
			    text_display_template_entity,attribute_table_entity);



   (* changed from int/float/bool to avoid conflict 
    * with enumerators.  DTL Mon Feb 14 2000
    *)
   TYPE int_val = INTEGER;   END_TYPE;
   TYPE float_val = REAL;   END_TYPE;
   TYPE str_val = STRING;   END_TYPE;
   TYPE bool_val = BOOLEAN; END_TYPE;

   TYPE
      datum = SELECT (int_val, float_val, str_val, directory_entry, bool_val);
   END_TYPE;
      
   TYPE
      line_pattern = ENUMERATION OF (none,solid,dashed,phantom,centerline,dotted);
   END_TYPE;

   TYPE
      lineFont = SELECT (line_pattern,line_font_definition_entity);
   END_TYPE;

   TYPE
      entity_level = SELECT (definition_levels_entity,int_val); 
   END_TYPE;

   TYPE
      entity_view  = SELECT (view_entity,views_visible_entity,
	                     views_visible_color_entity,
			     segmented_views_visible_entity);
   END_TYPE;

   TYPE
      blank_status = ENUMERATION OF (
      visible,	   		(* 00 *)
      invisible			(* 01 *)
      );
   END_TYPE;

   TYPE
      subordinate_switch = ENUMERATION OF (
      independent,		(* 00 *)
      physicallyDependent,	(* 01 *)
      logicallyDependent,	(* 02 *)
      both			(* 03 *)
      );
   END_TYPE;

   TYPE
      use_flag = ENUMERATION OF (
      geometry,			(* 00 *)
      annotation,		(* 01 *)
      definition,		(* 02 *)
      other,			(* 03 *)
      logical_positional,	(* 04 *)
      parametric,		(* 05 *)
      construction_geometry	(* 06 *)
      );
   END_TYPE;

   TYPE
      hierarchy_flag = ENUMERATION OF (
      all,			(* 00 global top down *)
      none,			(* 01 global defer *)
      individual		(* 02 *)
      );
   END_TYPE;

   TYPE
      color_number = ENUMERATION OF (
      undefined,		(* 00 *)
      black,			(* 01 *)
      red,			(* 02 *)
      green,			(* 03 *)
      blue,			(* 04 *)
      yellow,			(* 05 *)
      magenta,			(* 06 *)
      cyan,			(* 07 *)
      white			(* 08 *)
      );
   END_TYPE;

   TYPE
      entity_color = SELECT (color_number,color_definition_entity);
   END_TYPE;

   TYPE
      unitFlag = ENUMERATION OF (
      none,			(* 00 *)
      inches,			(* 01 *)
      millimeters,		(* 02 *)
      unspecified,		(* 03 *)
      feet,			(* 04 *)
      miles,			(* 05 *)
      meters,			(* 06 *)
      kilometers,		(* 07 *)
      mils,			(* 08 *)
      microns,			(* 09 *)
      centimeters,		(* 10 *)
      microinches		(* 11 *)
      );
   END_TYPE;

   TYPE
      draftingStandardCode = ENUMERATION OF (
      none,			(* 00 *)
      ISO,			(* 01 *)
      AFNOR,			(* 02 *)
      ANSI,			(* 03 *)
      BSI,			(* 04 *)
      CSA,			(* 05 *)
      DIN,			(* 06 *)
      JIS			(* 07 *)
      );
   END_TYPE;

   TYPE 
      variable = ENUMERATION OF (no_value,int,float,character_string,pointer,not_used,bool);
   END_TYPE;

   ENTITY coordinate;
      x : REAL;
      y : REAL;
      z : OPTIONAL REAL;
   END_ENTITY;

   ENTITY iges_file;
      start_section  : LIST OF STRING;
      global_section : global;

(*   DERIVE       
      directory_entries : LIST OF directory_entry :=
	QUERY ( de <* directory_entry | TRUE );
*)
   END_ENTITY;

   ENTITY global;
      parameter_delimiter : STRING(1);
      record_delimiter : STRING(1);
      product_identification_sender : STRING;
      file_name : STRING;
      system_id: STRING;
      preprocessor_version : STRING;
      number_of_binary_bits : INTEGER;		-- in integer data
      single_precision_magnitude : INTEGER;
      single_precision_significance : INTEGER;
      double_precision_magnitude : INTEGER;
      double_precision_significance : INTEGER;
      product_identification_receiver : STRING;
      model_space_scale: REAL;
      unit_flag : unitFlag;
      units : STRING;
      max_num_line_weight_gradations : INTEGER;     -- default is 1
      width_max_line_weight : REAL;
      date_time_file_generation : STRING;
      min_resolution : REAL;
      max_coordinate_value : REAL;
      author : STRING;
      organization : STRING;
      version : INTEGER;
      drafting_standard_code : draftingStandardCode;
      date_time_created_modified : STRING;
      milspec : STRING; 	 -- added in 5.3
   END_ENTITY;
   
   TYPE
      associativities = SELECT (associativity_entity,general_note_entity,
				text_display_template_entity);
   END_TYPE;

   TYPE
      properties = SELECT (property_entity,attribute_table_entity);
   END_TYPE;

   ENTITY directory_entry
      ABSTRACT SUPERTYPE OF (ONEOF (geometric_entity,
		                    constructive_solid_geometry_entity,
				    boundary_representation_entity,
		                    annotation_entity,
				    structure_entity));

     label             : STRING;
     subscript         : INTEGER;
     associations      : LIST OF associativities;
     properties        : LIST OF properties;
   END_ENTITY;

END_SCHEMA;  -- iges_types_schema

SCHEMA iges_curve_and_surface_geometry_schema;

  REFERENCE FROM iges_types_schema;

  REFERENCE FROM iges_annotation_schema (centerline_entity,section_entity,
                                         witness_line_entity);

  REFERENCE FROM iges_structure_schema (associativity_entity,property_entity,
					label_display_entity,
					subfigure_definition_entity,
					connect_point_entity);

  REFERENCE FROM 
    iges_boundary_representation_schema (direction_entity);

  ENTITY geometric_entity
    ABSTRACT SUPERTYPE OF (ONEOF (circular_arc_entity,
		                  composite_curve_entity,
				  conic_arc_entity,
				  coordinate_pairs_entity,
				  coordinate_triples_entity,
				  coordinate_sextuples_entity,
				  linear_path_entity,
				  simple_closed_planar_curve_entity,
				  plane_entity,
				  line_entity,
				  parametric_spline_curve_entity,
				  parametric_spline_surface_entity,
				  point_entity,
				  ruled_surface_entity,
				  surface_of_revolution_entity,
				  tabulated_cylinder_entity,
				  transformation_matrix_entity,
				  flash_entity,
				  rational_bspline_curve_entity,
				  rational_bspline_surface_entity,
				  offset_curve_entity,
				  offset_surface_entity,
				  boundary_entity,
				  curve_on_a_parametric_surface_entity,
				  bounded_surface_entity,
				  trimmed_parametric_surface_entity,
                                  plane_surface_entity,
                                  right_circular_cylindrical_surface_entity,
                                  right_circular_conical_surface_entity,
                                  spherical_surface_entity,
                                  toroidal_surface_entity))
    SUBTYPE OF (directory_entry);
				  
    level      : entity_level;
    view       : entity_view;
    transformation    : transformation_matrix_entity;
    label_display     : label_display_entity;
    blank      : blank_status;
    color         : entity_color;
  END_ENTITY;

   ENTITY circular_arc_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate       : subordinate_switch;
      used       : use_flag;
      line_weight       : INTEGER;
      zt : REAL;
      x1 : REAL;
      y1 : REAL;
      x2 : REAL;
      y2 : REAL;
      x3 : REAL;
      y3 : REAL;
   DERIVE
      entity_type : INTEGER := 100;
      form : INTEGER := 0;
   END_ENTITY;
   
   TYPE
      geometric_or_connect_point = SELECT (geometric_entity,connect_point_entity);
   END_TYPE;

   ENTITY composite_curve_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate  : subordinate_switch;
      used         : use_flag;
      hierarchy    : hierarchy_flag;
      line_weight       : INTEGER;
      de : LIST OF geometric_or_connect_point;
   DERIVE
      entity_type : INTEGER := 102;
      form       : INTEGER := 0;
      n : INTEGER := SIZEOF(de);
   END_ENTITY;
   
   ENTITY conic_arc_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate       : subordinate_switch;
      used       : use_flag;
      line_weight       : INTEGER;
      form              : INTEGER;
      a : REAL;
      b : REAL;
      c : REAL;
      d : REAL;
      e : REAL;
      f : REAL;
      zt : REAL;
      x1 : REAL;
      y1 : REAL;
      x2 : REAL;
      y2 : REAL;
   DERIVE
      entity_type : INTEGER := 104;
   WHERE
      (form = 0) OR (form = 1) OR (form = 2) OR (form = 3);
   END_ENTITY;
   
   ENTITY copious_data_entity
      ABSTRACT SUPERTYPE OF (ONEOF (coordinate_pairs_entity,  
				    coordinate_triples_entity,  
				    coordinate_sextuples_entity,
				    linear_path_entity,
				    centerline_entity,
		                    section_entity,
				    witness_line_entity,
				    simple_closed_planar_curve_entity));

   END_ENTITY;
   
   ENTITY linear_path_entity
      ABSTRACT SUPERTYPE OF (ONEOF (planar_piecewise_curve_entity,
		                    piecewise_curve_entity))
      SUBTYPE OF (copious_data_entity, geometric_entity);

      line_font : lineFont;
      line_weight       : INTEGER;
   END_ENTITY;

   ENTITY planar_piecewise_curve_entity
      SUBTYPE OF (linear_path_entity);

      subordinate : subordinate_switch;
      used        : use_flag;
      zt : REAL;
      coordinates : LIST OF coordinate;
   DERIVE
      entity_type : INTEGER := 106;
      form  : INTEGER := 11;
      ip : INTEGER := 1;
      n  : INTEGER := SIZEOF(coordinates);
   END_ENTITY;

   ENTITY piecewise_curve_entity
      SUBTYPE OF (linear_path_entity);

      subordinate : subordinate_switch;
      used        : use_flag;
      form        : INTEGER;
      ip 	  : INTEGER;
      piecewise_curve : LIST OF piecewise_representation;
   DERIVE
      entity_type : INTEGER := 106;
      n : INTEGER := SIZEOF(piecewise_curve);
   WHERE
      ((ip = 2) AND (form = 12)) OR ((ip = 3) AND (form = 13));
   END_ENTITY;

   ENTITY coordinate_pairs_entity
      SUBTYPE OF (copious_data_entity, geometric_entity);

      subordinate : subordinate_switch;
      used        : use_flag;
      zt : REAL;
      coordinates : LIST OF coordinate;
   DERIVE
      entity_type : INTEGER := 106;
      form  : INTEGER := 1;
      ip : INTEGER := 1;
      n  : INTEGER := SIZEOF(coordinates);
   END_ENTITY;

   ENTITY simple_closed_planar_curve_entity
      SUBTYPE OF (copious_data_entity, geometric_entity);

      line_font : lineFont;
      subordinate : subordinate_switch;
      used        : use_flag;
      line_weight       : INTEGER;
      zt : REAL;
      coordinates : LIST OF coordinate;
   DERIVE
      entity_type : INTEGER := 106;
      form  : INTEGER := 63;
      ip : INTEGER := 1;
      n  : INTEGER := SIZEOF(coordinates);
   END_ENTITY;

   ENTITY coordinate_triples_entity
      SUBTYPE OF (copious_data_entity, geometric_entity);

      subordinate : subordinate_switch;
      used        : use_flag;
      coordinates : LIST OF coordinate;
   DERIVE
      entity_type : INTEGER := 106;
      form  : INTEGER := 2;
      ip : INTEGER := 2;
      n  : INTEGER := SIZEOF(coordinates);
   END_ENTITY;

   ENTITY coordinate_sextuples_entity
      SUBTYPE OF (copious_data_entity, geometric_entity);

      subordinate : subordinate_switch;
      used        : use_flag;
      sextuples : LIST OF sextuple;
   DERIVE
      entity_type : INTEGER := 106;
      form  : INTEGER := 3;
      ip : INTEGER := 3;
      n  : INTEGER := SIZEOF(sextuples);
   END_ENTITY;

   TYPE
      piecewise_representation = SELECT (coordinate,sextuple);
   END_TYPE;

   ENTITY sextuple;
      x : REAL;
      y : REAL;
      z : REAL;
      i : REAL;
      j : REAL;
      k : REAL;
   END_ENTITY;
           
   ENTITY plane_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate : subordinate_switch;
      used        : use_flag;
      hierarchy : hierarchy_flag;
      line_weight       : INTEGER;
      form              : INTEGER;
      a : REAL;
      b : REAL;
      c : REAL;
      d : REAL;
      ptr : geometric_entity;
      x : REAL;
      y : REAL;
      z : REAL;
      size : REAL;
   DERIVE
      entity_type : INTEGER := 108;
   WHERE
      (form = 1) OR (form = 0) OR (form = -1);
   END_ENTITY;
           
   ENTITY line_entity
      SUBTYPE OF (geometric_entity);

      line_font   : lineFont;
      subordinate : subordinate_switch;
      used        : use_flag;
      line_weight : INTEGER;
      x1 : REAL;
      y1 : REAL;
      z1 : REAL;
      x2 : REAL;
      y2 : REAL;
      z2 : REAL;
      form 	: INTEGER;
   DERIVE
      entity_type : INTEGER := 110;
   END_ENTITY;
           
   TYPE
     curveType = ENUMERATION OF (null,linear,quadratic,cubic,wilson_fowler,
                                 modified_wilson_fowler,bspline);
   END_TYPE;

   ENTITY parametric_spline_curve_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate : subordinate_switch;
      used        : use_flag;
      line_weight       : INTEGER;
      ctype : curveType;
      h     : INTEGER;
      ndim  : INTEGER;
      t : ARRAY [0:255] OF REAL;
      polynomials : LIST [0:n-1] OF polynomial_coefficients;
      tpx0 : REAL;
      tpx1 : REAL;
      tpx2 : REAL;
      tpx3 : REAL;
      tpy0 : REAL;
      tpy1 : REAL;
      tpy2 : REAL;
      tpy3 : REAL;
      tpz0 : REAL;
      tpz1 : REAL;
      tpz2 : REAL;
      tpz3 : REAL;
   DERIVE
      entity_type : INTEGER := 112;
      form    : INTEGER := 0;
      n : INTEGER := SIZEOF(t);
   END_ENTITY;
   
   ENTITY polynomial_coefficients;
      x_coefficients : ARRAY [0:3] OF REAL;
      y_coefficients : ARRAY [0:3] OF REAL;
      z_coefficients : ARRAY [0:3] OF REAL;
   END_ENTITY;
           
   TYPE
      patchType = ENUMERATION OF (unspecified,cartesian);
   END_TYPE;

   ENTITY parametric_spline_surface_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate : subordinate_switch;
      used        : use_flag;
      line_weight       : INTEGER;
      ctype : curveType;
      ptype : patchType;
      tu : ARRAY [0:255] OF REAL;
      tv : ARRAY [0:255] OF REAL;
      patches : LIST [0:m] OF LIST [0:n] OF patch;
   DERIVE
      entity_type : INTEGER := 114;
      form    : INTEGER := 0;
      m : INTEGER := SIZEOF(tu)-1;
      n : INTEGER := SIZEOF(tv)-1;
   END_ENTITY;
   
   ENTITY patch;
      x_coefficients : ARRAY [0:15] OF REAL;
      y_coefficients : ARRAY [0:15] OF REAL;
      z_coefficients : ARRAY [0:15] OF REAL;
   END_ENTITY;
   
   ENTITY point_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate : subordinate_switch;
      used        : use_flag;
      hierarchy   : hierarchy_flag;
      line_weight       : INTEGER;
      x : REAL;
      y : REAL;
      z : REAL;
      ptr : subfigure_definition_entity;
   DERIVE
      entity_type : INTEGER := 116;
      form    : INTEGER := 0;
   END_ENTITY;
   
   ENTITY ruled_surface_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate : subordinate_switch;
      used        : use_flag;
      line_weight : INTEGER;
      form        : INTEGER;
      de1  : geometric_entity;
      de2 : geometric_entity;
      dirflg   : INTEGER;
      devflg   : INTEGER;
   DERIVE
      entity_type : INTEGER := 118;
   WHERE
      (form = 0) OR (form = 1);
   END_ENTITY;
           
   ENTITY surface_of_revolution_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate : subordinate_switch;
      used        : use_flag;
      line_weight       : INTEGER;
      l : line_entity;
      c : geometric_entity;
      sa : REAL;
      ta : REAL;
   DERIVE
      entity_type : INTEGER := 120;
      form    : INTEGER := 0;
   END_ENTITY;
   
   ENTITY tabulated_cylinder_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate : subordinate_switch;
      used        : use_flag;
      line_weight       : INTEGER;
      de : geometric_entity;
      lx : REAL;
      ly : REAL;
      lz : REAL;
   DERIVE
      entity_type : INTEGER := 122;
      form    : INTEGER := 0;
   END_ENTITY;
   
   ENTITY transformation_matrix_entity
      SUBTYPE OF (geometric_entity);

      form  : INTEGER;
      r11 : REAL;
      r12 : REAL;
      r13 : REAL;
      t1  : REAL;
      r21 : REAL;
      r22 : REAL;
      r23 : REAL;
      t2  : REAL;
      r31 : REAL;
      r32 : REAL;
      r33 : REAL;
      t3  : REAL;
   DERIVE
      entity_type : INTEGER := 124;
   WHERE
      (form = 0) OR (form = 1) OR (form = 10) OR 
      (form = 11) OR (form = 12);
   END_ENTITY;
           
   ENTITY flash_entity
      SUBTYPE OF (geometric_entity);

      subordinate : subordinate_switch;
      used        : use_flag;
      line_weight : INTEGER;
      form        : INTEGER;
      x : REAL;
      y : REAL;
      dim1 : REAL;
      dim2 : REAL;
      rot : REAL;
      de  : geometric_entity;
   DERIVE
      entity_type : INTEGER := 125;
      line_font  : line_pattern := solid;
      hierarchy  : hierarchy_flag := all;
   WHERE
      (form = 0) OR (form = 1) OR (form = 2) OR 
      (form = 3) OR (form = 4);
   END_ENTITY;

   TYPE
     property1 = ENUMERATION OF (nonplanar,planar);
   END_TYPE;

   TYPE
     property2 = ENUMERATION OF (open,closed);
   END_TYPE;

   TYPE
     property3 = ENUMERATION OF (rational,polynomial);
   END_TYPE;

   TYPE
     property4 = ENUMERATION OF (nonperiodic,periodic);
   END_TYPE;

   ENTITY rational_bspline_curve_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate : subordinate_switch;
      used        : use_flag;
      line_weight : INTEGER;
      form        : INTEGER;
      m : INTEGER;
      prop1 : property1;
      prop2 : property2;
      prop3 : property3;
      prop4 : property4;
      t : ARRAY [0:255] OF REAL;
      w : ARRAY [0:255] OF REAL;
      control_points : LIST OF coordinate;
      v : ARRAY [0:1] OF REAL;
      xnorm : REAL;
      ynorm : REAL;
      znorm : REAL;
   DERIVE
      entity_type : INTEGER := 126;
      k : INTEGER := SIZEOF(w)-1;
   WHERE
      (form = 0) OR (form = 1) OR (form = 2) OR 
      (form = 3) OR (form = 4) OR (form = 5);
   END_ENTITY;
   
   ENTITY rational_bspline_surface_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate : subordinate_switch;
      used        : use_flag;
      line_weight : INTEGER;
      form        : INTEGER;
      m1 : INTEGER;
      m2 : INTEGER;
      prop1 : property2;
      prop2 : property2;
      prop3 : property3;
      prop4 : property4;
      prop5 : property4;
      s  : ARRAY [0:255] OF REAL;
      t  : ARRAY [0:255] OF REAL;
      w  : LIST OF ARRAY [0:255] OF REAL;
      control_points : LIST [0:k1] OF LIST [0:k2] OF coordinate;
      u : ARRAY [0:1] OF REAL;
      v : ARRAY [0:1] OF REAL;
   DERIVE
      entity_type : INTEGER := 128;
      k1 : INTEGER := SIZEOF(w)-1;
      k2 : INTEGER := SIZEOF(w[0])-1;
   WHERE
      (form = 0) OR (form = 1) OR (form = 2) OR 
      (form = 3) OR (form = 4) OR (form = 5) OR
      (form = 6) OR (form = 7) OR (form = 8) OR (form = 9);
   END_ENTITY;
   
   TYPE
      offsetFlag = ENUMERATION OF (null,uniform,varies,as_function);
   END_TYPE;

   TYPE
      taperedOffset = ENUMERATION OF (null,arcLength,parameter);
   END_TYPE;

   ENTITY offset_curve_entity
      SUBTYPE OF (geometric_entity);

      line_font : lineFont;
      subordinate : subordinate_switch;
      used        : use_flag;
      line_weight       : INTEGER;
      de1 : geometric_entity;
      flag : offsetFlag;
      de2 : geometric_entity;
      ndim   : INTEGER;
      ptype  : taperedOffset;
      d1  : REAL;
      td1 : REAL;
      d2  : REAL;
      td2 : REAL;
      vx  : REAL;
      vy  : REAL;
      vz  : REAL;
      tt1 : REAL;
      tt2 : REAL;
   DERIVE
      entity_type : INTEGER := 130;
      form    : INTEGER := 0;
   END_ENTITY;

   ENTITY offset_surface_entity
     SUBTYPE OF (geometric_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     used        : use_flag;
     line_weight       : INTEGER;
     nx : REAL;
     ny : REAL;
     nz : REAL;
     d : REAL;
     de : geometric_entity;
   DERIVE
     entity_type    : INTEGER := 140;
     form       : INTEGER := 0;
   END_ENTITY;
   
   TYPE
     boundedSurface = ENUMERATION OF (trim_curves,parameter_space_curves);
   END_TYPE;

   TYPE
     trimCurveRep = ENUMERATION OF (unspecified,model_space,parameter_space,equal);
   END_TYPE;

   ENTITY boundary_entity
     SUBTYPE OF (geometric_entity);

     line_font : lineFont;
     subordinate       : subordinate_switch;
     used       : use_flag;
     line_weight       : INTEGER;
     ctype : boundedSurface;
     pref : trimCurveRep;
     sptr : geometric_entity;
     curves : LIST OF curve_boundary;
   DERIVE
     entity_type    : INTEGER := 141;
     form       : INTEGER := 0;
     n : INTEGER := SIZEOF(curves);
   END_ENTITY;

   ENTITY curve_boundary;
      crvpt : geometric_entity;
      sense : INTEGER;
      pscpt : LIST OF geometric_entity;
   DERIVE
      k : INTEGER := SIZEOF(pscpt);
   END_ENTITY;

   TYPE
     creationMethod = ENUMERATION OF (unspecified,projection,
                                      intersection,isoparametric);
   END_TYPE;

   ENTITY curve_on_a_parametric_surface_entity
     SUBTYPE OF (geometric_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     line_weight       : INTEGER;
     crtn : creationMethod;
     sptr : geometric_entity;
     bptr : geometric_entity;
     cptr : geometric_entity;
     pref : INTEGER;
   DERIVE
     entity_type    : INTEGER := 142;
     form       : INTEGER := 0;
     used: use_flag := parametric;  
   END_ENTITY;

   ENTITY bounded_surface_entity
     SUBTYPE OF (geometric_entity);

     line_font : lineFont;
     subordinate       : subordinate_switch;
     line_weight       : INTEGER;
     ctype : boundedSurface;
     sptr : geometric_entity;
     bdpt : LIST OF boundary_entity;
   DERIVE
     entity_type    : INTEGER := 143;
     form       : INTEGER := 0;
     used: use_flag := geometry;  
     n : INTEGER := SIZEOF(bdpt);
   END_ENTITY;
      
   ENTITY trimmed_parametric_surface_entity
     SUBTYPE OF (geometric_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     line_weight       : INTEGER;
     pts : geometric_entity;
     n1 : INTEGER;
     pto : curve_on_a_parametric_surface_entity;
     pti : LIST OF curve_on_a_parametric_surface_entity;
   DERIVE
     entity_type    : INTEGER := 144;
     form       : INTEGER := 0;
     used    : use_flag := geometry;  
     n2 : INTEGER := SIZEOF(pti);
   END_ENTITY;
           
  ENTITY plane_surface_entity
    SUBTYPE OF (geometric_entity);

    line_font : lineFont;
    subordinate : subordinate_switch;
    used        : use_flag;
    line_weight    : INTEGER;
    form           : INTEGER;
    deloc  : point_entity;
    denrml : direction_entity;
    derefd : OPTIONAL direction_entity;
  DERIVE
    entity_type : INTEGER := 190;
  WHERE
    (EXISTS(derefd) AND (form = 1)) OR (NOT EXISTS(derefd) AND (form = 0));
  END_ENTITY;

  ENTITY right_circular_cylindrical_surface_entity
    SUBTYPE OF (geometric_entity);

    line_font : lineFont;
    used        : use_flag;
    line_weight    : INTEGER;
    form           : INTEGER;
    deloc  : point_entity;
    deaxis : direction_entity;
    radius : REAL;
    derefd : OPTIONAL direction_entity;
  DERIVE
    entity_type : INTEGER := 192;
    subordinate : subordinate_switch := physicallyDependent;
  WHERE
    radius > 0;
    (EXISTS(derefd) AND (form = 1)) OR (NOT EXISTS(derefd) AND (form = 0));
  END_ENTITY;

  ENTITY right_circular_conical_surface_entity
    SUBTYPE OF (geometric_entity);

    line_font : lineFont;
    used        : use_flag;
    line_weight    : INTEGER;
    form           : INTEGER;
    deloc  : point_entity;
    deaxis : direction_entity;
    radius : REAL;
    sangle : REAL;
    derefd : OPTIONAL direction_entity;
  DERIVE
    entity_type : INTEGER := 194;
    subordinate : subordinate_switch := physicallyDependent;
  WHERE
    radius >= 0;
    (sangle > 0) AND (sangle < 90);
    (EXISTS(derefd) AND (form = 1)) OR (NOT EXISTS(derefd) AND (form = 0));
  END_ENTITY;

  ENTITY spherical_surface_entity
    SUBTYPE OF (geometric_entity);

    line_font : lineFont;
    used        : use_flag;
    line_weight    : INTEGER;
    form           : INTEGER;
    deloc  : point_entity;
    radius : REAL;
    deaxis : OPTIONAL direction_entity;
    derefd : OPTIONAL direction_entity;
  DERIVE
    entity_type : INTEGER := 196;
    subordinate : subordinate_switch := physicallyDependent;
  WHERE
    radius > 0;
    (EXISTS(deaxis) AND EXISTS(derefd) AND (form = 1)) OR 
    (NOT EXISTS(deaxis) AND (NOT EXISTS(derefd)) AND (form = 0));
  END_ENTITY;

  ENTITY toroidal_surface_entity
    SUBTYPE OF (geometric_entity);

    line_font : lineFont;
    used        : use_flag;
    line_weight    : INTEGER;
    form           : INTEGER;
    deloc  : point_entity;
    deaxis : direction_entity;
    majrad : REAL;
    minrad : REAL;
    derefd : OPTIONAL direction_entity;
  DERIVE
    entity_type : INTEGER := 198;
    subordinate : subordinate_switch := physicallyDependent;
  WHERE
    majrad > 0;
    (minrad > 0) AND (minrad < majrad);
    (EXISTS(derefd) AND (form = 1)) OR (NOT EXISTS(derefd) AND (form = 0));
  END_ENTITY;

END_SCHEMA;  -- iges_curve_and_surface_geometry_schema;

SCHEMA iges_constructive_solid_geometry_schema;

  REFERENCE FROM iges_types_schema;

  REFERENCE FROM iges_structure_schema (associativity_entity,property_entity,
					label_display_entity);

  REFERENCE FROM iges_curve_and_surface_geometry_schema (geometric_entity,
							transformation_matrix_entity);
  ENTITY constructive_solid_geometry_entity
    ABSTRACT SUPERTYPE OF (ONEOF (block_entity,
		                  right_angular_wedge_entity,
				  right_circular_cylinder_entity,
		                  right_circular_cone_frustum_entity,
				  sphere_entity,
				  torus_entity,
				  solid_of_revolution_entity,
				  solid_of_linear_extrusion_entity,
				  ellipsoid_entity,
				  boolean_tree_entity,
				  selected_component_entity,
				  solid_assembly_entity,
				  solid_instance_entity))
    SUBTYPE OF (directory_entry);

    line_font : lineFont;
    level      : entity_level;
    view       : entity_view;
    transformation    : transformation_matrix_entity;
    label_display     : label_display_entity;
    blank      : blank_status;
    line_weight       : INTEGER;                    -- constrained value
    color         : entity_color;
  END_ENTITY;

  ENTITY block_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate : subordinate_switch;
    lx : REAL;
    ly : REAL;
    lz : REAL;
    x1 : REAL;
    y1 : REAL;
    z1 : REAL;
    i1 : REAL;
    j1 : REAL;
    k1 : REAL;
    i2 : REAL;
    j2 : REAL;
    k2 : REAL;
  DERIVE
    entity_type : INTEGER := 150;
    form    : INTEGER := 0;
    used: use_flag := geometry;
  END_ENTITY;
           
  ENTITY right_angular_wedge_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate : subordinate_switch;
    lx : REAL;
    ly : REAL;
    lz : REAL;
    ltx : REAL;
    x1 : REAL;
    y1 : REAL;
    z1 : REAL;
    i1 : REAL;
    j1 : REAL;
    k1 : REAL;
    i2 : REAL;
    j2 : REAL;
    k2 : REAL;
  DERIVE
    entity_type : INTEGER := 152;
    form    : INTEGER := 0;
    used: use_flag := geometry;
  END_ENTITY;
   
  ENTITY right_circular_cylinder_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate : subordinate_switch;
    h : REAL;
    r : REAL;
    x1 : REAL;
    y1 : REAL;
    z1 : REAL;
    i1 : REAL;
    j1 : REAL;
    k1 : REAL;
  DERIVE
    entity_type : INTEGER := 154;
    form    : INTEGER := 0;
    used: use_flag := geometry;
  END_ENTITY;
           
  ENTITY right_circular_cone_frustum_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate : subordinate_switch;
    h : REAL;
    r1 : REAL;
    r2 : REAL;
    x1 : REAL;
    y1 : REAL;
    z1 : REAL;
    i1 : REAL;
    j1 : REAL;
    k1 : REAL;
  DERIVE
    entity_type : INTEGER := 156;
    form    : INTEGER := 0;
    used: use_flag := geometry;
  END_ENTITY;
           
  ENTITY sphere_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate : subordinate_switch;
    r : REAL;
    x1 : REAL;
    y1 : REAL;
    z1 : REAL;
  DERIVE
    entity_type : INTEGER := 158;
    form    : INTEGER := 0;
    used: use_flag := geometry;
  END_ENTITY;
   
  ENTITY torus_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate : subordinate_switch;
    r1 : REAL;
    r2 : REAL;
    x1 : REAL;
    y1 : REAL;
    z1 : REAL;
    i1 : REAL;
    j1 : REAL;
    k1 : REAL;
  DERIVE
    entity_type : INTEGER := 160;
    form    : INTEGER := 0;
    used: use_flag := geometry;
  END_ENTITY;
           
  ENTITY solid_of_revolution_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate : subordinate_switch;
    form : INTEGER;
    ptr  : geometric_entity;
    f  : REAL;
    x1 : REAL;
    y1 : REAL;
    z1 : REAL;
    i1 : REAL;
    j1 : REAL;
    k1 : REAL;
  DERIVE
    entity_type : INTEGER := 162;
    used: use_flag := geometry;
  WHERE
    (form = 0) OR (form = 1);
  END_ENTITY;
           
  ENTITY solid_of_linear_extrusion_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate : subordinate_switch;
    ptr : geometric_entity;
    l : REAL;
    i1 : REAL;
    j1 : REAL;
    k1 : REAL;
  DERIVE
    entity_type : INTEGER := 164;
    form    : INTEGER := 0;
    used: use_flag := geometry;
  END_ENTITY;
   
  ENTITY ellipsoid_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate : subordinate_switch;
    lx : REAL;
    ly : REAL;
    lz : REAL;
    x1 : REAL;
    y1 : REAL;
    z1 : REAL;
    i1 : REAL;
    j1 : REAL;
    k1 : REAL;
    i2 : REAL;
    j2 : REAL;
    k2 : REAL;
  DERIVE
    entity_type : INTEGER := 168;
    form    : INTEGER := 0;
    used: use_flag := geometry;
  END_ENTITY;

  TYPE
    boolean_op_code = ENUMERATION OF (null,union,intersection,difference);
  END_TYPE;

  TYPE
    boolean_ops = SELECT (constructive_solid_geometry_entity,boolean_op_code);
  END_TYPE;

  ENTITY boolean_tree_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate  : subordinate_switch;
    hierarchy    : hierarchy_flag;
    operands : LIST OF boolean_ops;
  DERIVE
    entity_type : INTEGER := 180;
    form    : INTEGER := 0;
    used: use_flag := geometry;
    n : INTEGER := SIZEOF(operands);
  WHERE
    n > 2;
  END_ENTITY;
           
  ENTITY selected_component_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate : subordinate_switch;
    btree : boolean_tree_entity;
    selx  : REAL;
    sely  : REAL;
    selz  : REAL;
  DERIVE
    entity_type : INTEGER := 182;
    form    : INTEGER := 0;
    used: use_flag := other;
  END_ENTITY;
    
  ENTITY solid_assembly_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate : subordinate_switch;
    hierarchy   : hierarchy_flag;
    ptr    : LIST OF constructive_solid_geometry_entity;
    ptrm   : ARRAY [0:n-1] OF transformation_matrix_entity;
  DERIVE
    entity_type : INTEGER := 184;
    form    : INTEGER := 0;
    used: use_flag := definition;
    n : INTEGER := SIZEOF(ptr);
  END_ENTITY;
           
  ENTITY solid_instance_entity
    SUBTYPE OF (constructive_solid_geometry_entity);

    subordinate : subordinate_switch;
    used        : use_flag;
    hierarchy   : hierarchy_flag;
    ptr : constructive_solid_geometry_entity;
  DERIVE
    entity_type : INTEGER := 430;
    form    : INTEGER := 0;
  END_ENTITY;
           
END_SCHEMA;  -- iges_constructive_solid_geometry_schema;

SCHEMA iges_boundary_representation_schema;

  REFERENCE FROM iges_types_schema;

  REFERENCE FROM iges_curve_and_surface_geometry_schema;

  REFERENCE FROM iges_structure_schema(label_display_entity);

  ENTITY boundary_representation_entity
    ABSTRACT SUPERTYPE OF (ONEOF (manifold_solid_brep_entity,
				  vertex_list_entity,
				  edge_list_entity,
				  loop_entity,
				  face_entity,
				  shell_entity,
				  direction_entity))
    SUBTYPE OF (directory_entry);

    level             : entity_level;
    label_display     : label_display_entity;


    -- Technically, this does not match the spec since color is n.a.
    -- for all of the boundary rep types, but many systems exchange
    -- color information for topology, so we add it at the root.
    color             : entity_color;
  END_ENTITY;

  ENTITY direction_entity
    SUBTYPE OF (boundary_representation_entity);

    line_font   : lineFont;
    view        : entity_view;
    line_weight : INTEGER;
    -- color       : entity_color;   now handled by super
    x : REAL;
    y : REAL;
    z : REAL;
  DERIVE
    entity_type : INTEGER := 123;
    subordinate : subordinate_switch := physicallyDependent;
    used        : use_flag := definition;
    form        : INTEGER := 0;
  END_ENTITY;

  ENTITY manifold_solid_brep_entity
    SUBTYPE OF (boundary_representation_entity);

    transformation : transformation_matrix_entity;
    blank       : blank_status;
    subordinate : subordinate_switch;
    used        : use_flag;
    hierarchy   : hierarchy_flag;
    shell : shell_entity;
    sof   : BOOLEAN;
    void_shells : LIST OF void_shell;
  DERIVE
    entity_type : INTEGER := 186;
    form        : INTEGER := 0;
    n : INTEGER := SIZEOF(void_shells);
  END_ENTITY;

  ENTITY void_shell;
    void : shell_entity;
    vof  : BOOLEAN;
  END_ENTITY;

  ENTITY vertex_list_entity
    SUBTYPE OF (boundary_representation_entity);

    blank : blank_status;
    used  : use_flag;
    vertices : LIST OF coordinate;
  DERIVE
    entity_type : INTEGER := 502;
    subordinate : subordinate_switch := physicallyDependent;
    form        : INTEGER := 1;
    n           : INTEGER := SIZEOF(vertices);
  WHERE
    n > 0;
  END_ENTITY;

  ENTITY edge_list_entity
    SUBTYPE OF (boundary_representation_entity);

    blank : blank_status;
    used  : use_flag;
    edges : LIST OF edge_data;
  DERIVE
    entity_type : INTEGER := 504;
    subordinate : subordinate_switch := physicallyDependent;
    hierarchy   : hierarchy_flag := none;
    form        : INTEGER := 1;
    n           : INTEGER := SIZEOF(edges);
  WHERE
    n > 0;
  END_ENTITY;

  TYPE
    model_space_curve = SELECT (circular_arc_entity,composite_curve_entity,
                                conic_arc_entity,planar_piecewise_curve_entity,
				piecewise_curve_entity,
				simple_closed_planar_curve_entity,
				line_entity,parametric_spline_curve_entity,
				rational_bspline_curve_entity,offset_curve_entity);
  END_TYPE;

  ENTITY edge_data;
    curv : model_space_curve;
    svp  : vertex_list_entity;
    sv   : INTEGER;
    tvp  : vertex_list_entity;
    tv   : INTEGER;
  END_ENTITY;

  ENTITY loop_entity
    SUBTYPE OF (boundary_representation_entity);

    blank       : blank_status;
    used        : use_flag;
    hierarchy   : hierarchy_flag;
    edge_tuples : LIST OF edge_use;
  DERIVE
    entity_type : INTEGER := 508;
    subordinate : subordinate_switch := physicallyDependent;
    form        : INTEGER := 1;
    n           : INTEGER := SIZEOF(edge_tuples);
  END_ENTITY;

  TYPE
    edge_type = ENUMERATION OF (edge,vertex);
  END_TYPE;

  TYPE
    vertex_or_edge = SELECT (vertex_list_entity,edge_list_entity);
  END_TYPE;

  ENTITY edge_use;
    typ  : edge_type;
    edge : vertex_or_edge;
    ndx  : INTEGER;
    orf   : BOOLEAN;
    curves : LIST OF space_curve;
  DERIVE 
    k : INTEGER := SIZEOF(curves);
  END_ENTITY;

  ENTITY space_curve;
    isop : BOOLEAN;
    curv : model_space_curve;
  END_ENTITY;

  TYPE
    surface_type = SELECT (parametric_spline_surface_entity,ruled_surface_entity,
                	   surface_of_revolution_entity,tabulated_cylinder_entity,
		           rational_bspline_surface_entity,offset_surface_entity,
		           plane_surface_entity,
			   right_circular_cylindrical_surface_entity,
		           right_circular_conical_surface_entity,
			   spherical_surface_entity,
		           toroidal_surface_entity);
  END_TYPE;

  ENTITY face_entity
    SUBTYPE OF (boundary_representation_entity);

    blank       : blank_status;
    used        : use_flag;
    hierarchy   : hierarchy_flag;
    surf        : surface_type;
    orf          : BOOLEAN;
    loop        : LIST OF loop_entity;
  DERIVE
    entity_type : INTEGER := 510;
    subordinate : subordinate_switch := physicallyDependent;
    form        : INTEGER := 1;
    n           : INTEGER := SIZEOF(loop);
  END_ENTITY;

  ENTITY shell_entity
    SUBTYPE OF (boundary_representation_entity);

    blank       : blank_status;
    used        : use_flag;
    hierarchy   : hierarchy_flag;
    faces       : LIST OF face_data;
    form 	: INTEGER;
    subordinate : subordinate_switch;
  DERIVE
    entity_type : INTEGER := 514;
    -- made explicit for greater flexibility
    -- subordinate : subordinate_switch := physicallyDependent;
    n           : INTEGER := SIZEOF(faces);
  WHERE
    n > 0;
  END_ENTITY;

  ENTITY face_data;
    face_ptr : face_entity;
    orf   : BOOLEAN;
  END_ENTITY;

END_SCHEMA;  -- iges_boundary_representation_schema;

SCHEMA iges_annotation_schema;

  REFERENCE FROM iges_types_schema;

  REFERENCE FROM iges_curve_and_surface_geometry_schema;

  REFERENCE FROM iges_structure_schema (associativity_entity,property_entity,
					label_display_entity,
					text_font_definition_entity);

  ENTITY annotation_entity
    ABSTRACT SUPERTYPE OF (ONEOF (centerline_entity,
		                  section_entity,
				  witness_line_entity,
		                  angular_dimension_entity,
				  curve_dimension_entity,
				  diameter_dimension_entity,
		                  flag_note_entity,
				  general_label_entity,
				  general_note_entity,
				  new_general_note_entity,
				  leader_arrow_entity,
				  linear_dimension_entity,
				  ordinate_dimension_entity,
				  point_dimension_entity,
				  radius_dimension_entity,
				  general_symbol_entity,
				  sectioned_area_entity))
    SUBTYPE OF (directory_entry);

    level      : entity_level;
    view       : entity_view;
    transformation    : transformation_matrix_entity;
    label_display     : label_display_entity;
    blank      : blank_status;
    line_weight       : INTEGER;                    -- constrained value
    color         : entity_color;
  END_ENTITY;

   ENTITY centerline_entity
      SUBTYPE OF (copious_data_entity, annotation_entity);

      subordinate       : subordinate_switch;
      form              : INTEGER;
      zt : REAL;
      coordinates : LIST OF coordinate;
   DERIVE
      entity_type : INTEGER := 106;
      line_font : line_pattern := solid;
      used: use_flag := annotation;
      ip : INTEGER := 1;
      n  : INTEGER := SIZEOF(coordinates);
   WHERE
      WR1: NOT ODD(n);
      WR2: (form = 20) OR (form = 21);
   END_ENTITY;

   ENTITY section_entity
      SUBTYPE OF (copious_data_entity, annotation_entity);

      subordinate : subordinate_switch;
      form        : INTEGER;
      zt : REAL;
      coordinates : LIST OF coordinate;
   DERIVE
      entity_type : INTEGER := 106;
      line_font : line_pattern := solid;
      used: use_flag := annotation;
      ip : INTEGER := 1;
      n  : INTEGER := SIZEOF(coordinates);
   WHERE
      WR1 : NOT ODD(n);
      WR2 : (form = 31) OR (form = 32) OR (form = 33) OR (form = 34)
            OR (form = 35) OR (form = 36) OR (form = 37) 
	    OR (form = 38);
   END_ENTITY;

   ENTITY witness_line_entity
      SUBTYPE OF (copious_data_entity, annotation_entity);

      subordinate : subordinate_switch;
      zt : REAL;
      coordinates : LIST OF coordinate;
   DERIVE
      entity_type : INTEGER := 106;
      line_font : line_pattern := solid;
      used: use_flag := annotation;
      form       : INTEGER := 40;
      ip : INTEGER := 1;
      n  : INTEGER := SIZEOF(coordinates);
   WHERE
      WR1 : ODD(n) AND (n >= 3);
   END_ENTITY;

   ENTITY angular_dimension_entity
     SUBTYPE OF (annotation_entity);

     line_font : lineFont;
     subordinate  : subordinate_switch;
     hierarchy    : hierarchy_flag;
     denote : general_note_entity;
     dewit1 : witness_line_entity;
     dewit2 : witness_line_entity;
     xt : REAL;
     yt : REAL;
     r : REAL;
     dearrw1 : leader_arrow_entity;
     dearrw2 : leader_arrow_entity;
   DERIVE
     entity_type : INTEGER := 202;
     form    : INTEGER := 0;
     used: use_flag := annotation;
   END_ENTITY;
           
   ENTITY curve_dimension_entity
     SUBTYPE OF (annotation_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     hierarchy   : hierarchy_flag;
     denote : general_note_entity;
     decurv1 : geometric_entity;
     decurv2 : geometric_entity;
     dearr1 : leader_arrow_entity;
     dearr2 : leader_arrow_entity;
     dewit1 : witness_line_entity;
     dewit2 : witness_line_entity;
   DERIVE
     entity_type : INTEGER := 204;
     form    : INTEGER := 0;
     used: use_flag := annotation;
   END_ENTITY;
           
   ENTITY diameter_dimension_entity
     SUBTYPE OF (annotation_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     hierarchy   : hierarchy_flag;
     denote : general_note_entity;
     dearrw1 : leader_arrow_entity;
     dearrw2 : leader_arrow_entity;
     xt : REAL;
     yt : REAL;
   DERIVE
     entity_type : INTEGER := 206;
     form    : INTEGER := 0;
     used: use_flag := annotation;
   END_ENTITY;
   
   ENTITY flag_note_entity
     SUBTYPE OF (annotation_entity);
     
     line_font : lineFont;
     subordinate : subordinate_switch;
     hierarchy   : hierarchy_flag;
     xt : REAL;
     yt : REAL;
     zt : REAL;
     a  : REAL;
     denote  : general_note_entity;
     dearrw : LIST OF leader_arrow_entity;
   DERIVE
     entity_type : INTEGER := 208;
     form    : INTEGER := 0;
     used: use_flag := annotation;
     n : INTEGER := SIZEOF(dearrw);
   END_ENTITY;
           
   ENTITY general_label_entity
     SUBTYPE OF (annotation_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     hierarchy   : hierarchy_flag;
     denote : general_note_entity;
     dearrw : LIST OF leader_arrow_entity;
   DERIVE
     entity_type : INTEGER := 210;
     form    : INTEGER := 0;
     used: use_flag := annotation;
     n : INTEGER := SIZEOF(dearrw);
   END_ENTITY;
           
   ENTITY general_note_entity
     SUBTYPE OF (annotation_entity);

     subordinate : subordinate_switch;
     form    : INTEGER;
     strings : LIST OF text_string;
   DERIVE
     entity_type : INTEGER := 212;
     used: use_flag := annotation;
     line_font : line_pattern := solid;
     ns : INTEGER := SIZEOF(strings);
   WHERE
     (form = 0) OR (form = 1) OR (form = 2) OR (form = 3) OR
     (form = 4) OR (form = 5) OR (form = 6) OR (form = 7) OR
     (form = 8) OR (form = 100) OR (form = 101) OR (form = 102) OR
     (form = 105);
   END_ENTITY;
   
   TYPE
     font_code = SELECT (int_val,text_font_definition_entity);
   END_TYPE;

   TYPE
     mirror_flag = ENUMERATION OF (none,perpendicular,base_line);
   END_TYPE;

   TYPE
     rotate_flag = ENUMERATION OF (horizontial,vertical);
   END_TYPE;

   TYPE
     fixed_or_variable_display = ENUMERATION OF (fixed_length,variable_length);
   END_TYPE;

   ENTITY text_string;
     fixvar : OPTIONAL fixed_or_variable_display;
     chrwid : OPTIONAL REAL;
     chrhgt : OPTIONAL REAL;
     cspace : OPTIONAL REAL;
     lspace : OPTIONAL REAL;
     font   : OPTIONAL INTEGER;
     chrang : OPTIONAL REAL;
     cctext : OPTIONAL STRING;
     wt : REAL;
     ht : REAL;
     fc : font_code;    -- if INTEGER, check predefined values
     sl : REAL;
     a : REAL;
     m : mirror_flag;
     vh : rotate_flag;
     xs : REAL;
     ys : REAL;
     zs : REAL;
     text : STRING;
   DERIVE
     nc : INTEGER := LENGTH(text);
     chrset : font_code := fc;
   END_ENTITY;
           
   TYPE
     justification_code = ENUMERATION OF (none,right,center,left);
   END_TYPE;

   ENTITY new_general_note_entity
     SUBTYPE OF (annotation_entity);

     subordinate : subordinate_switch;
     txtcw : REAL;
     txtch : REAL;
     justcd : justification_code;
     txtcx : REAL;
     txtcy : REAL;
     txtcz : REAL;
     txtag : REAL;
     baselx : REAL;
     basely : REAL;
     baselz : REAL;
     nils : REAL;
     strings : LIST OF text_string;
   DERIVE
     entity_type : INTEGER := 213;
     form    : INTEGER := 0;
     used: use_flag := annotation;
     line_font : line_pattern := solid;
     ns : INTEGER := SIZEOF(strings);
   END_ENTITY;

   ENTITY leader_arrow_entity
     SUBTYPE OF (annotation_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     form : INTEGER;
     ad1 : REAL;
     ad2 : REAL;
     zt : REAL;
     xh : REAL;
     yh : REAL;
     segments : LIST OF coordinate;
   DERIVE
     entity_type : INTEGER := 214;
     used: use_flag := annotation;
     n : INTEGER := SIZEOF(segments);
   WHERE
     (form = 1) OR (form = 2) OR (form = 3) OR (form = 4) OR 
     (form = 5) OR (form = 6) OR (form = 7) OR (form = 8) OR 
     (form = 9) OR (form = 10) OR (form = 11) OR (form = 12);
   END_ENTITY;
   
   ENTITY linear_dimension_entity
     SUBTYPE OF (annotation_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     hierarchy   : hierarchy_flag;
     form   : INTEGER;
     denote : general_note_entity;
     dearrw1 : leader_arrow_entity;
     dearrw2 : leader_arrow_entity;
     dewit1 : witness_line_entity;
     dewit2 : witness_line_entity;
   DERIVE
     entity_type : INTEGER := 216;
     used: use_flag := annotation;
   WHERE
     (form = 0) OR (form = 1) OR (form = 2);
   END_ENTITY;
           
   TYPE 
     witness_or_leader = SELECT (witness_line_entity,leader_arrow_entity);
   END_TYPE;

   ENTITY ordinate_dimension_entity
     ABSTRACT SUPERTYPE OF (ONEOF(ordinate_dimension_entity_with_witness_or_leader_entity,
		                  ordinate_dimension_entity_with_witness_and_leader_entity))
     SUBTYPE OF (annotation_entity);

     hierarchy : hierarchy_flag;
     denote : general_note_entity;
   DERIVE
     entity_type : INTEGER := 218;
     used: use_flag := annotation;
   END_ENTITY;
           
   ENTITY ordinate_dimension_entity_with_witness_or_leader_entity
     SUBTYPE OF (ordinate_dimension_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     dewit  : witness_or_leader;
   DERIVE
     form : INTEGER := 0;
   END_ENTITY;
           
   ENTITY ordinate_dimension_entity_with_witness_and_leader_entity
     SUBTYPE OF (ordinate_dimension_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     deord  : witness_line_entity;
     desupp  : leader_arrow_entity;
   DERIVE
     form : INTEGER := 1;
   END_ENTITY;
           
   TYPE 
     geometry_ptr = SELECT (circular_arc_entity,composite_curve_entity,
                            simple_closed_planar_curve_entity);
   END_TYPE;

   ENTITY point_dimension_entity
     SUBTYPE OF (annotation_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     hierarchy   : hierarchy_flag;
     denote : general_note_entity;
     dearrw : leader_arrow_entity;
     degeom : geometry_ptr;
   DERIVE
     entity_type : INTEGER := 220;
     form    : INTEGER := 0;
     used: use_flag := annotation;
   END_ENTITY;

   ENTITY radius_dimension_entity
     ABSTRACT SUPERTYPE OF (ONEOF (radius_dimension_with_one_leader_entity,
		                   radius_dimension_with_two_leader_entity))
     SUBTYPE OF (annotation_entity);

     hierarchy : hierarchy_flag;
     denote : general_note_entity;
   DERIVE
     entity_type : INTEGER := 222;
     used: use_flag := annotation;
   END_ENTITY;

   ENTITY radius_dimension_with_one_leader_entity
     SUBTYPE OF (radius_dimension_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     dearrw : leader_arrow_entity;
     xt : REAL;
     yt : REAL;
   DERIVE
     form    : INTEGER := 0;
   END_ENTITY;
           
   ENTITY radius_dimension_with_two_leader_entity
     SUBTYPE OF (radius_dimension_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     dearrw1 : leader_arrow_entity;
     xt : REAL;
     yt : REAL;
     dearrw2 : leader_arrow_entity;
   DERIVE
     form    : INTEGER := 1;
   END_ENTITY;
           
   ENTITY general_symbol_entity
     SUBTYPE OF (annotation_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     hierarchy   : hierarchy_flag;
     form        : INTEGER;
     denote : general_note_entity;
     degeom : LIST OF directory_entry;
     dearrw : LIST OF leader_arrow_entity;
   DERIVE
     entity_type : INTEGER := 228;
     used: use_flag := annotation;
     n : INTEGER := SIZEOF(degeom);
     l : INTEGER := SIZEOF(dearrw);
   WHERE
     (form = 0) OR (form = 1) OR (form = 2) OR (form = 3);
   END_ENTITY;

   TYPE
     definition_curve = SELECT (circular_arc_entity,composite_curve_entity,
                                conic_arc_entity,simple_closed_planar_curve_entity,
				parametric_spline_curve_entity,
				rational_bspline_curve_entity);
   END_TYPE;

   ENTITY sectioned_area_entity
     SUBTYPE OF (annotation_entity);

     line_font : lineFont;
     subordinate : subordinate_switch;
     hierarchy   : hierarchy_flag;
     form : INTEGER;
     bndp : definition_curve;
     patrn : INTEGER;
     xt : REAL;
     yt : REAL;
     zt : REAL;
     dist  : REAL;
     angle : REAL;
     islpt : LIST OF definition_curve;
   DERIVE
     entity_type : INTEGER := 230;
     used: use_flag := annotation;
     n : INTEGER := SIZEOF(islpt);
   WHERE
     (form = 0) OR (form = 1);
   END_ENTITY;

END_SCHEMA;  -- iges_annotation_schema;

SCHEMA iges_structure_schema;

  REFERENCE FROM iges_types_schema;

  REFERENCE FROM iges_curve_and_surface_geometry_schema;

  REFERENCE FROM 
    iges_constructive_solid_geometry_schema (constructive_solid_geometry_entity);

  REFERENCE FROM iges_annotation_schema(annotation_entity,font_code, 
					general_note_entity,leader_arrow_entity);

  ENTITY structure_entity
    ABSTRACT SUPERTYPE OF (ONEOF (null_entity,
		                  subfigure_entity,
				  connectivity_entity,
				  external_reference_linkage_entity,
				  drawing_or_view_entity,
		                  finite_element_modeling_entity,
				  attribute_table_entity,
				  associativity_definition_entity,
				  line_font_definition_entity,
				  text_font_definition_entity,
				  color_definition_entity,
				  units_data_entity,
				  associativity_entity,
				  property_entity))
    SUBTYPE OF (directory_entry);

  END_ENTITY;

  ENTITY subfigure_entity
    ABSTRACT SUPERTYPE OF (ONEOF (subfigure_definition_entity,
		                  singular_subfigure_instance_entity,
		                  network_subfigure_definition_entity,
				  network_subfigure_instance_entity,
				  rectangular_array_subfigure_instance_entity,
				  circular_array_subfigure_instance_entity))
    SUBTYPE OF (structure_entity);

    line_font : lineFont;
    level      : entity_level;
    transformation    : transformation_matrix_entity;
    label_display     : label_display_entity;
    hierarchy    : hierarchy_flag;
    line_weight       : INTEGER;
    color         : entity_color;
  END_ENTITY;

  ENTITY connectivity_entity
    ABSTRACT SUPERTYPE OF (ONEOF (network_subfigure_definition_entity,
				  network_subfigure_instance_entity,
				  flow_entity,
				  connect_point_entity,
				  text_display_template_entity))
    SUBTYPE OF (structure_entity);

  END_ENTITY;

  ENTITY external_reference_linkage_entity
    ABSTRACT SUPERTYPE OF (ONEOF (external_reference_entity,
		                  external_reference_file_list_entity,
				  external_reference_file_index_entity))
    SUBTYPE OF (structure_entity);

  END_ENTITY;

  ENTITY drawing_or_view_entity
    ABSTRACT SUPERTYPE OF (ONEOF (drawing_entity,
		                  view_entity))
    SUBTYPE OF (structure_entity);

  END_ENTITY;

  ENTITY finite_element_modeling_entity
    ABSTRACT SUPERTYPE OF (ONEOF (finite_element_entity,
		                  node_entity,
				  nodal_load_constraint_entity,
				  tabular_data_entity,
				  nodal_displacement_and_rotation_entity,
				  nodal_results_entity,
		                  element_results_entity))
    SUBTYPE OF (structure_entity);

  END_ENTITY;
  
  ENTITY attribute_table_entity
    ABSTRACT SUPERTYPE OF (ONEOF (attribute_table_definition_entity,
		                  attribute_table_instance_entity))
    SUBTYPE OF (structure_entity);

  END_ENTITY;

  ENTITY associativity_entity
    ABSTRACT SUPERTYPE OF (ONEOF (associativity_instance_entity,
		                  group_entity,
				  views_visible_entity,
				  views_visible_color_entity,
				  label_display_entity,
				  group_without_back_pointers_entity,
				  single_parent_entity,
				  external_reference_file_index_entity,
				  dimensioned_geometry_entity,
				  ordered_group_with_back_pointers_entity,
				  ordered_group_without_back_pointers_entity,
				  planar_entity,
				  flow_entity,
				  segmented_views_visible_entity,
				  piping_flow_entity,
				  new_dimensioned_geometry_entity))
    SUBTYPE OF (structure_entity);

  DERIVE
    entity_type : INTEGER := 402;
  END_ENTITY;

  ENTITY property_entity
    ABSTRACT SUPERTYPE OF (ONEOF (definition_levels_entity,
		                  region_restriction_entity,
				  level_function_entity,
				  line_widening_entity,
				  drilled_hole_entity,
				  reference_designator_entity,
				  pin_number_entity,
				  part_number_entity,
				  hierarchy_entity,
				  tabular_data_entity,
				  external_reference_file_list_entity,
				  nominal_size_entity,
				  flow_line_specification_entity,
				  name_entity,
				  drawing_size_entity,
				  drawing_units_entity,
				  intercharacter_spacing_entity,
				  line_font_entity,
				  highlight_entity,
				  pick_entity,
				  uniform_rectangular_grid_entity,
				  associativity_group_type_entity,
				  level_to_pwb_layer_map_entity,
				  pwb_artwork_stackup_entity,
				  pwb_drilled_hole_entity,
				  generic_data_entity,
				  dimension_units_entity,
				  dimension_tolerance_entity,
				  dimension_display_data_entity,
				  basic_dimension_entity,
				  user_defined_property_entity))
    SUBTYPE OF (structure_entity);

    level : entity_level;
  DERIVE
    entity_type : INTEGER := 406;
  END_ENTITY;

  ENTITY null_entity
    SUBTYPE OF (structure_entity);
    
      directory_entry_records : ARRAY [1:2] OF STRING;
      parameter_data_records  : LIST [1:?] OF STRING;
    DERIVE
      entity_type : INTEGER := 0;
      form    : INTEGER := 0;
  END_ENTITY;

  TYPE
    functionFlag = ENUMERATION OF (unspecified,electrical,fluid);
  END_TYPE;

  TYPE
    owner = SELECT (network_subfigure_instance_entity,
                    network_subfigure_definition_entity);
  END_TYPE;

  ENTITY connect_point_entity
    SUBTYPE OF (connectivity_entity);

    line_font : lineFont;
    level      : entity_level;
    view       : entity_view;
    transformation    : transformation_matrix_entity;
    label_display     : label_display_entity;
    blank      : blank_status;
    subordinate       : subordinate_switch;
    used       : use_flag;
    hierarchy    : hierarchy_flag;
    line_weight       : INTEGER;      
    color         : entity_color;
    x : REAL;
    y : REAL;
    z : REAL;
    ptr : geometric_entity;
    tf  : INTEGER;
    ff  : functionFlag;
    cid : STRING;
    pttcid : text_display_template_entity;
    cfn : STRING;
    pttcfn : text_display_template_entity;
    cpid : INTEGER;
    fc   : INTEGER;
    sf   : INTEGER;
    psfi : owner;
  DERIVE
    entity_type : INTEGER := 132;
    form    : INTEGER := 0;
    -- used: use_flag := logical_positional;
  END_ENTITY;
           
  ENTITY node_entity
    SUBTYPE OF (finite_element_modeling_entity);
    
    transformation    : transformation_matrix_entity;
    blank       : blank_status;
    subordinate : subordinate_switch;
    used        : use_flag;
    color         : entity_color;
    x : REAL;
    y : REAL;
    z : REAL;
    ndcsp : transformation_matrix_entity;
  DERIVE
    entity_type : INTEGER := 134;
    form    : INTEGER := 0;
    -- used : use_flag := logical_positional;
  END_ENTITY;

  TYPE
    topology_type = ENUMERATION OF (null,BEAM,LTRIA,PTRIA,CTRIA,LQUAD,PQUAD,CQUAD,
                                    PTSW,CTSW,PTS,CTS,LSOT,PSOT,LSOW,PSOW,CSOW,
                                    LSO,PSO,CSO,ALLIN,APLIN,ACLIN,ALTRIA,APTRIA,
                                    ALQUAD,APQUAD,SPR,GSPR,DAMP,GDAMP,MASS,RBDY,
                                    TBEAM);
  END_TYPE;

  ENTITY finite_element_entity
    SUBTYPE OF (finite_element_modeling_entity);
    
    line_font : lineFont;
    label_display     : label_display_entity;
    color         : entity_color;
    itop : topology_type;
    de : ARRAY [0:255] OF node_entity;
    etyp : STRING;
  DERIVE
    entity_type : INTEGER := 136;
    form    : INTEGER := 0;
    n : INTEGER := SIZEOF(de);
  END_ENTITY;
      
  ENTITY node_case;
    np          : node_entity;
    translation : LIST OF coordinate;
    rotation    : LIST OF coordinate;
  DERIVE
    no : INTEGER := np.subscript;
  END_ENTITY;

  ENTITY nodal_displacement_and_rotation_entity
    SUBTYPE OF (finite_element_modeling_entity);

    label_display     : label_display_entity;
    blank       : blank_status;
    subordinate : subordinate_switch;
    used        : use_flag;
    gp : LIST OF general_note_entity;
    node_cases    : LIST OF node_case;
  DERIVE
    entity_type : INTEGER := 138;
    form    : INTEGER := 0;
    nc : INTEGER := SIZEOF(gp);
    nn : INTEGER := SIZEOF(node_cases);
  END_ENTITY;
     
  ENTITY analysis_result;
    np        : node_entity;
    v         : ARRAY [0:8] OF REAL;
  DERIVE
    node : INTEGER := np.subscript;
  END_ENTITY;

  ENTITY nodal_results_entity
    SUBTYPE OF (finite_element_modeling_entity);
    
    label_display     : label_display_entity;
    subordinate : subordinate_switch;
    used        : use_flag;
    color      : entity_color;
    form       : INTEGER;
    gnote : general_note_entity;
    scn : INTEGER;
    time : REAL;
    nv : INTEGER;
    results : LIST OF analysis_result;
  DERIVE
    entity_type : INTEGER := 146;
    -- used : use_flag := other;
    nn : INTEGER := SIZEOF(results);
  WHERE
    ((form = 0) AND (nv = 0)) OR ((form = 1) AND (nv = 1)) OR
    ((form = 2) AND (nv = 1)) OR ((form = 3) AND (nv = 3)) OR
    ((form = 4) AND (nv = 6)) OR ((form = 5) AND (nv = 3)) OR
    ((form = 6) AND (nv = 3)) OR ((form = 7) AND (nv = 3)) OR
    ((form = 8) AND (nv = 3)) OR ((form = 9) AND (nv = 3)) OR
    ((form = 10) AND (nv = 1)) OR ((form = 11) AND (nv = 1)) OR
    ((form = 12) AND (nv = 3)) OR ((form = 13) AND (nv = 1)) OR
    ((form = 14) AND (nv = 1)) OR ((form = 15) AND (nv = 3)) OR
    ((form = 16) AND (nv = 1)) OR ((form = 17) AND (nv = 3)) OR
    ((form = 18) AND (nv = 3)) OR ((form = 19) AND (nv = 3)) OR
    ((form = 20) AND (nv = 3)) OR ((form = 21) AND (nv = 3)) OR
    ((form = 22) AND (nv = 3)) OR ((form = 23) AND (nv = 6)) OR
    ((form = 24) AND (nv = 6)) OR ((form = 25) AND (nv = 6)) OR
    ((form = 26) AND (nv = 6)) OR ((form = 27) AND (nv = 6)) OR
    ((form = 28) AND (nv = 6)) OR ((form = 29) AND (nv = 9)) OR
    ((form = 30) AND (nv = 9)) OR ((form = 31) AND (nv = 9)) OR
    ((form = 32) AND (nv = 9)) OR ((form = 33) AND (nv = 9)) OR
    ((form = 34) AND (nv = 9));
  END_ENTITY;
     
  TYPE
    results_reporting_flag = ENUMERATION OF (node,centriod,volume,gauss);
  END_TYPE;

  TYPE
    data_layer_flag = ENUMERATION OF (unspecified,top,middle,bottom,ordered);
  END_TYPE;

  ENTITY element_results_entity
    SUBTYPE OF (finite_element_modeling_entity);

    label_display     : label_display_entity;
    subordinate : subordinate_switch;
    used        : use_flag;
    color         : entity_color;
    form              : INTEGER;
    gnote : general_note_entity;
    scn : INTEGER;
    time : REAL;
    nv : INTEGER;
    rrf : results_reporting_flag;
    fem_elements : LIST OF fem_element;
  DERIVE
    entity_type : INTEGER := 148;
    -- used : use_flag := other;
    ne : INTEGER := SIZEOF(fem_elements);
  WHERE
    ((form = 0) AND (nv = 0)) OR ((form = 1) AND (nv = 1)) OR
    ((form = 2) AND (nv = 1)) OR ((form = 3) AND (nv = 3)) OR
    ((form = 4) AND (nv = 6)) OR ((form = 5) AND (nv = 3)) OR
    ((form = 6) AND (nv = 3)) OR ((form = 7) AND (nv = 3)) OR
    ((form = 8) AND (nv = 3)) OR ((form = 9) AND (nv = 3)) OR
    ((form = 10) AND (nv = 1)) OR ((form = 11) AND (nv = 1)) OR
    ((form = 12) AND (nv = 3)) OR ((form = 13) AND (nv = 1)) OR
    ((form = 14) AND (nv = 1)) OR ((form = 15) AND (nv = 3)) OR
    ((form = 16) AND (nv = 1)) OR ((form = 17) AND (nv = 3)) OR
    ((form = 18) AND (nv = 3)) OR ((form = 19) AND (nv = 3)) OR
    ((form = 20) AND (nv = 3)) OR ((form = 21) AND (nv = 3)) OR
    ((form = 22) AND (nv = 3)) OR ((form = 23) AND (nv = 6)) OR
    ((form = 24) AND (nv = 6)) OR ((form = 25) AND (nv = 6)) OR
    ((form = 26) AND (nv = 6)) OR ((form = 27) AND (nv = 6)) OR
    ((form = 28) AND (nv = 6)) OR ((form = 29) AND (nv = 9)) OR
    ((form = 30) AND (nv = 9)) OR ((form = 31) AND (nv = 9)) OR
    ((form = 32) AND (nv = 9)) OR ((form = 33) AND (nv = 9)) OR
    ((form = 34) AND (nv = 9));
  END_ENTITY;
     
  ENTITY fem_element;
    en : INTEGER;
    ep : finite_element_entity;
    itop : topology_type;
    nl  : INTEGER;
    dlf : data_layer_flag;
    rdrl : ARRAY [0:255] OF INTEGER;
    numv : INTEGER;
    v : LIST [0:nrl-1] OF LIST [0:nl-1] OF ARRAY [0:255] OF REAL;
  DERIVE
    nrl  : INTEGER := SIZEOF(rdrl);
  WHERE
    (((dlf = unspecified) OR (dlf = top) OR (dlf = middle) OR (dlf = bottom))
    AND (nl = 1)) OR (dlf = ordered);
  END_ENTITY;

  ENTITY associativity_definition_entity
    SUBTYPE OF (structure_entity);
    
    form              : INTEGER;
    classes : LIST OF associativity_class;
  DERIVE
    entity_type : INTEGER := 302;
    subordinate : subordinate_switch := independent;
    used : use_flag := definition;
    k : INTEGER := SIZEOF(classes);
  WHERE
    (form >= 5001) AND (form <= 9999);
  END_ENTITY;

  ENTITY associativity_class;
    bp  : INTEGER;
    ord : INTEGER;
    it : ARRAY [0:255] OF INTEGER;
  DERIVE
    n  : INTEGER := SIZEOF(it);
  END_ENTITY;
           
  ENTITY line_font_definition_entity
    ABSTRACT SUPERTYPE OF (ONEOF (repeating_template_subfigure_entity,
		                  repeating_visible_blank_pattern_entity))
    SUBTYPE OF (structure_entity);

    line_font : lineFont;
    transformation    : transformation_matrix_entity;
  DERIVE
    entity_type : INTEGER := 304;
    subordinate : subordinate_switch := independent;
    used : use_flag := definition;
  END_ENTITY;

  ENTITY repeating_template_subfigure_entity
    SUBTYPE OF (line_font_definition_entity);

    m : INTEGER;
    l1 : subfigure_definition_entity;
    l2 : REAL;
    l3 : REAL;
  DERIVE
    form : INTEGER := 1;
  WHERE
    (m = 0) OR (m = 1);
  END_ENTITY;
  
  ENTITY repeating_visible_blank_pattern_entity
    SUBTYPE OF (line_font_definition_entity);

    l : ARRAY [0:255] OF REAL;
    b : STRING;
  DERIVE
    form : INTEGER := 2;
    m : INTEGER := SIZEOF(l);
  END_ENTITY;

  ENTITY subfigure_definition_entity
    SUBTYPE OF (subfigure_entity);

    subordinate : subordinate_switch;
    depth : INTEGER;
    name  : STRING;
    de : LIST OF directory_entry;
  DERIVE
    entity_type : INTEGER := 308;
    used : use_flag := definition;
    form    : INTEGER := 0;
    n : INTEGER := SIZEOF (de);
  END_ENTITY;

  ENTITY text_font_definition_entity
    SUBTYPE OF (structure_entity);

    fc : INTEGER;
    fname : STRING;
    sf : font_code;
    scale : INTEGER;
    characters : LIST OF character;
  DERIVE
    entity_type : INTEGER := 310;
    subordinate : subordinate_switch := independent;
    used : use_flag := definition;
    form    : INTEGER := 0;
    n : INTEGER := SIZEOF(characters);
  END_ENTITY;

  ENTITY character;
    ac : INTEGER;
    nx : INTEGER;
    ny : INTEGER;
    pen_motions : LIST OF pen_motion;
  DERIVE
    nm : INTEGER := SIZEOF(pen_motions);
  END_ENTITY;
   
  TYPE
    up_down_flag = ENUMERATION OF (down,up);
  END_TYPE;

  ENTITY pen_motion;
    pf : up_down_flag;
    x : INTEGER;
    y : INTEGER;
  END_ENTITY;
           
  ENTITY text_display_template_entity
    ABSTRACT SUPERTYPE OF (ONEOF (absolute_text_display_template_entity,
		                  incremental_text_display_template_entity))
    SUBTYPE OF (connectivity_entity);

    level      : entity_level;
    view       : entity_view;
    transformation    : transformation_matrix_entity;
    label_display     : label_display_entity;
    blank      : blank_status;
    color         : entity_color;
  DERIVE
    entity_type : INTEGER := 312;
    subordinate : subordinate_switch := independent;
    used : use_flag := definition;
    hierarchy : hierarchy_flag := all;
  END_ENTITY;

  ENTITY absolute_text_display_template_entity
    SUBTYPE OF (text_display_template_entity);

    cbw : REAL;
    cbh : REAL;
    fc : font_code;
    sl : REAL;
    a : REAL;
    m : INTEGER;
    vh : INTEGER;
    xs : REAL;
    ys : REAL;
    zs : REAL;
  DERIVE
    form : INTEGER := 0;
  END_ENTITY;

  ENTITY incremental_text_display_template_entity
    SUBTYPE OF (text_display_template_entity);

    cbw : REAL;
    cbh : REAL;
    fc : font_code;
    sl : REAL;
    a : REAL;
    m : INTEGER;
    vh : INTEGER;
    dxs : REAL;
    dys : REAL;
    dzs : REAL;
  DERIVE
    form : INTEGER := 1;
  END_ENTITY;

  ENTITY color_definition_entity
    SUBTYPE OF (structure_entity);

    color : entity_color;
    cc1 : REAL;
    cc2 : REAL;
    cc3 : REAL;
    cname : STRING;
  DERIVE
    entity_type : INTEGER := 314;
    subordinate : subordinate_switch := independent;
    used: use_flag := definition;
    form : INTEGER := 0;
  END_ENTITY;

  ENTITY units_data_entity
    SUBTYPE OF (structure_entity);

    units : LIST OF igesunit;
  DERIVE
    entity_type : INTEGER := 316;
    subordinate : subordinate_switch := independent;
    used: use_flag := definition;
    form : INTEGER := 0;
    np : INTEGER := SIZEOF(units);
  END_ENTITY;

  ENTITY igesunit;
    typ : STRING;
    val : STRING;
    sf  : REAL;
  END_ENTITY;

  TYPE
    type_flag = ENUMERATION OF (not_specified,logical_design,physical_design);
  END_TYPE;

  ENTITY network_subfigure_definition_entity
    SUBTYPE OF (subfigure_entity,connectivity_entity);

    subordinate : subordinate_switch;
    depth : INTEGER;
    name : STRING;
    aptr: LIST OF directory_entry;
    tf : type_flag;
    prd : STRING;
    dptr : text_display_template_entity;
    cptr : ARRAY [0:255] OF connect_point_entity;
  DERIVE
    entity_type : INTEGER := 320;
    used: use_flag := definition;
    form    : INTEGER := 0;
    na : INTEGER := SIZEOF(aptr);
    nc : INTEGER := SIZEOF(cptr);
  END_ENTITY;
           
  ENTITY attribute_table_definition_entity
    SUBTYPE OF (attribute_table_entity);

    line_font : lineFont;
    level      : entity_level;
    transformation    : transformation_matrix_entity;
    label_display     : label_display_entity;
    hierarchy    : hierarchy_flag;
    line_weight       : INTEGER;
    color         : entity_color;
    form              : INTEGER;
    name : STRING;
    alt : INTEGER;
    attribute_list : LIST OF attribute_definition;
  DERIVE
    entity_type : INTEGER := 322;
    subordinate : subordinate_switch := independent;
    used: use_flag := definition;
    na : INTEGER := SIZEOF(attribute_list);
  WHERE
    (form = 0) OR (form = 1) OR  (form = 2);
  END_ENTITY;

  ENTITY attribute_definition;
    at   : INTEGER;
    avdt : variable;
    avc  : INTEGER;
    av   : OPTIONAL LIST [0:avc-1] OF datum;
    avp  : OPTIONAL LIST [0:avc-1] OF text_display_template_entity;
  END_ENTITY;

  ENTITY associativity_instance_entity
    SUBTYPE OF (associativity_entity);

    structure : associativity_definition_entity;
    form              : INTEGER;
    number_class_entries  : ARRAY [0:structure.k-1] OF INTEGER;
    parameter_data : LIST [0:structure.k-1] OF LIST OF LIST OF datum;
  WHERE
    (form > 5000) AND (form <= 9999);
  END_ENTITY;
   
  ENTITY group_entity
    SUBTYPE OF (associativity_entity);
    
    subordinate : subordinate_switch;
    used        : use_flag;
    de : LIST OF directory_entry;
  DERIVE 
    form : INTEGER := 1;
    n : INTEGER := SIZEOF(de);
  END_ENTITY;
           
  ENTITY views_visible_entity
    SUBTYPE OF (associativity_entity);

    dev : LIST OF view_entity;
    de  : LIST OF directory_entry;
  DERIVE
    subordinate : subordinate_switch := independent;
    used: use_flag := annotation;
    form : INTEGER := 3;
    n1 : INTEGER := SIZEOF(dev);
    n2 : INTEGER := SIZEOF(de);
  END_ENTITY;
           
  ENTITY views_visible_color_entity
    SUBTYPE OF (associativity_entity);

    blocks : LIST OF view_parameters;
    de : LIST OF directory_entry;
  DERIVE
    subordinate : subordinate_switch := independent;
    used: use_flag := annotation;
    form : INTEGER := 4;
    n1 : INTEGER := SIZEOF(blocks);
    n2 : INTEGER := SIZEOF(de);
  END_ENTITY;

  ENTITY view_parameters;
    dev : view_entity;
    lf  : INTEGER;
    def : line_font_definition_entity;
    cn  : entity_color;
    lw  : INTEGER;
  END_ENTITY;
           
  ENTITY label_display_entity
    SUBTYPE OF (associativity_entity);

    subordinate : subordinate_switch;
    used        : use_flag;
    label_placements : LIST OF label_placement;
  DERIVE
    form : INTEGER := 5;
    n : INTEGER := SIZEOF(label_placements);
  END_ENTITY;

  ENTITY label_placement;
    dev : view_entity;
    xt  : REAL;
    yt  : REAL;
    zt  : REAL;
    dearr : leader_arrow_entity;
    lln   : INTEGER;
    de    : directory_entry;
  END_ENTITY;
           
  ENTITY group_without_back_pointers_entity
    SUBTYPE OF (associativity_entity);

    subordinate : subordinate_switch;
    used        : use_flag;
    de : LIST OF directory_entry;
  DERIVE
    form : INTEGER := 7;
    n : INTEGER := SIZEOF(de);
  END_ENTITY;
           
  ENTITY single_parent_entity
    SUBTYPE OF (associativity_entity);

    subordinate : subordinate_switch;
    used        : use_flag;
    de : directory_entry;
    children : LIST OF directory_entry;
  DERIVE
    form : INTEGER := 9;
    np : INTEGER := 1;
    nc : INTEGER := SIZEOF(children);
  END_ENTITY;
           
  ENTITY external_reference_file_index_entity
    SUBTYPE OF (associativity_entity,external_reference_linkage_entity);

    subordinate : subordinate_switch;
    used        : use_flag;
    index_entries : LIST OF entity_reference;   -- was index_entry
  DERIVE
    form : INTEGER := 12;
    n : INTEGER := SIZEOF(index_entries);
  END_ENTITY;
   
  ENTITY entity_reference;    -- was index_entry
    name : STRING;
    ptr  : directory_entry;
  END_ENTITY;
           
  TYPE
    geometry_entities = SELECT (geometric_entity,
                                constructive_solid_geometry_entity);
  END_TYPE;

  ENTITY dimensioned_geometry_entity
    SUBTYPE OF (associativity_entity);

    subordinate : subordinate_switch;
    used        : use_flag;
    dimptr : annotation_entity;
    geom : LIST OF geometry_entities;
  DERIVE
    form : INTEGER := 13;
    nd : INTEGER := 1;
    ng : INTEGER := SIZEOF(geom);
  END_ENTITY;
           
  ENTITY ordered_group_with_back_pointers_entity
    SUBTYPE OF (associativity_entity);

    subordinate : subordinate_switch;
    used        : use_flag;
    de : LIST OF directory_entry;
  DERIVE
    form : INTEGER := 14;
    n : INTEGER := SIZEOF(de);
  END_ENTITY;
   
  ENTITY ordered_group_without_back_pointers_entity
    SUBTYPE OF (associativity_entity);

    subordinate : subordinate_switch;
    used        : use_flag;
    de : LIST OF directory_entry;
  DERIVE
    form : INTEGER := 15;
    n : INTEGER := SIZEOF(de);
  END_ENTITY;
           
  ENTITY planar_entity
    SUBTYPE OF (associativity_entity);

    detr : transformation_matrix_entity;
    subordinate : subordinate_switch;
    de   : LIST OF directory_entry;
  DERIVE
    form   : INTEGER := 16;
    used: use_flag := parametric;
    ntr : INTEGER := 1;
    n   : INTEGER := SIZEOF(de);
  END_ENTITY;

  TYPE 
    type_of_flow = ENUMERATION OF (not_specified,logical_flow,physical_flow);
  END_TYPE;

  TYPE 
    function_flag = ENUMERATION OF (not_specified,electrical_signal,
                                    fluid_flow_path);
  END_TYPE;

  ENTITY flow_entity
    SUBTYPE OF (associativity_entity,connectivity_entity);

    subordinate : subordinate_switch;
    tf : type_of_flow;
    ff : function_flag;
    sptr : LIST OF flow_entity;
    cptr : LIST OF connect_point_entity;
    jptr : LIST OF geometric_entity;
    name : LIST OF STRING;
    gptr : LIST OF text_display_template_entity;
    cfptr: LIST OF flow_entity;
  DERIVE
    form   : INTEGER := 18;
    used: use_flag := other;
    ncf : INTEGER := 2;
    nf  : INTEGER := SIZEOF(sptr);
    nc  : INTEGER := SIZEOF(cptr);
    nj  : INTEGER := SIZEOF(jptr);
    nn  : INTEGER := SIZEOF(name);
    nt  : INTEGER := SIZEOF(gptr);
    np  : INTEGER := SIZEOF(cfptr);
  END_ENTITY;
           
  ENTITY segmented_views_visible_entity
    SUBTYPE OF (associativity_entity);

    blocks : LIST OF view_segment_block;
  DERIVE
    subordinate : subordinate_switch := independent;
    used: use_flag := annotation;
    form : INTEGER := 19;
    n : INTEGER := SIZEOF(blocks);
  END_ENTITY;

  ENTITY view_segment_block;
    pt : view_entity;
    p  : REAL;
    df : INTEGER;
    c  : entity_color;
    l  : lineFont;
    w  : INTEGER;
  END_ENTITY;

  ENTITY piping_flow_entity
    SUBTYPE OF (associativity_entity);
    
    subordinate : subordinate_switch;
    tf : type_of_flow;
    sptr : LIST OF piping_flow_entity;
    cptr : LIST OF connect_point_entity;
    jptr : LIST OF geometric_entity;
    name : LIST OF STRING;
    gptr : LIST OF text_display_template_entity;
    cfptr: LIST OF flow_entity;
  DERIVE
    used: use_flag := other;
    form : INTEGER := 20;
    ncf : INTEGER := 1;
    nf  : INTEGER := SIZEOF(sptr);
    nc  : INTEGER := SIZEOF(cptr);
    nj  : INTEGER := SIZEOF(jptr);
    nn  : INTEGER := SIZEOF(name);
    nt  : INTEGER := SIZEOF(gptr);
    np  : INTEGER := SIZEOF(cfptr);
  END_ENTITY;

  ENTITY new_dimensioned_geometry_entity
    SUBTYPE OF (associativity_entity);

    dimptr : annotation_entity;
    dof    : INTEGER;
    av     : REAL;
    geom   : LIST OF geometry;
  DERIVE
    form : INTEGER := 21;
    nd : INTEGER := 1;
    ng : INTEGER := SIZEOF(geom);
  WHERE
    (dof >= 0) AND (dof <= 8);
  END_ENTITY;
           
  ENTITY geometry;
    geom : geometry_entities;
    dlf  : INTEGER;
    gpx  : REAL;
    gpy  : REAL;
    gpz  : REAL;
  WHERE
    (dlf >= 0) AND (dlf <= 5);
  END_ENTITY;

  ENTITY drawing_entity
    SUBTYPE OF (drawing_or_view_entity);

    form              : INTEGER;
    views : LIST OF view;
    dptr   : LIST OF directory_entry;
  DERIVE
    entity_type : INTEGER := 404;
    subordinate : subordinate_switch := independent;
    used : use_flag := annotation;
    n : INTEGER := SIZEOF(views);
    m : INTEGER := SIZEOF(dptr);
  WHERE
    (form = 0) OR (form = 1);
  END_ENTITY;
  
  ENTITY view;
    vptr : view_entity;
    xorigin : REAL;
    yorigin : REAL;
    angle   : OPTIONAL REAL;
  END_ENTITY;
           
  ENTITY definition_levels_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    l : LIST OF INTEGER;
  DERIVE 
    form : INTEGER := 1;
    np : INTEGER := SIZEOF(l);
  END_ENTITY;

  TYPE
    restriction_flag = ENUMERATION OF (none,inside,outside);
  END_TYPE;

  ENTITY region_restriction_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    evr  : restriction_flag;
    ecpr : restriction_flag;
    ecrr : restriction_flag;
  DERIVE 
    form : INTEGER := 2;
    np : INTEGER := 3;
  END_ENTITY;
           
  ENTITY level_function_entity
    SUBTYPE OF (property_entity);

    fc : INTEGER;
    fd : STRING;

    -- The IGES spec says the blank status for 406:3 should be the
    -- default (00), but add explicit control because in practice may
    -- be used to control visibility of level.
    blank      : blank_status;

    -- Technically, this does not match the spec since color is n.a.
    -- but some systems exchange color information for this.
    color             : entity_color;
  DERIVE 
    subordinate : subordinate_switch := independent;
    form : INTEGER := 3;
    np : INTEGER := 2;
  END_ENTITY;
           
  TYPE 
    cornering_code = ENUMERATION OF (rounded,squared);
  END_TYPE;

  TYPE 
    extension_flag = ENUMERATION OF (none,one_half,by_parameter);
  END_TYPE;

  TYPE 
    justification_flag = ENUMERATION OF (center,left,right);
  END_TYPE;

  ENTITY line_widening_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    wm : REAL;
    cc : cornering_code;
    ef : extension_flag;
    jf : justification_flag;
    e  : REAL;
  DERIVE 
    form : INTEGER := 5;
    np : INTEGER := 5;
  END_ENTITY;

  ENTITY drilled_hole_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    dds : REAL;
    fds : REAL;
    pf  : INTEGER;
    lnl : INTEGER;
    hnl : INTEGER;
  DERIVE 
    form : INTEGER := 6;
    np : INTEGER := 5;
  WHERE
    (pf = 0) OR (pf = 1);
  END_ENTITY;
           
  ENTITY reference_designator_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    rd : STRING;
  DERIVE 
    form : INTEGER := 7;
    np : INTEGER := 1;
  END_ENTITY;
           
  ENTITY pin_number_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    pn : STRING;
  DERIVE 
    form : INTEGER := 8;
    np : INTEGER := 1;
  END_ENTITY;
   
  ENTITY part_number_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    gpn : STRING;
    mpn : STRING;
    vpn : STRING;
    ipn : STRING;
  DERIVE 
    form : INTEGER := 9;
    np : INTEGER := 4;
  END_ENTITY;

  ENTITY hierarchy_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    lf  : INTEGER;
    vu  : INTEGER;
    lab : INTEGER;
    bl  : INTEGER;
    lw  : INTEGER;
    co  : INTEGER;
  DERIVE 
    form : INTEGER := 10;
    np : INTEGER := 6;
  WHERE
    (lf = 0) OR (lf = 1);
    (vu = 0) OR (vu = 1);
    (lab = 0) OR (lab = 1);
    (bl = 0) OR (bl = 1);
    (lw = 0) OR (lw = 1);
    (co = 0) OR (co = 1);
  END_ENTITY;
           
  TYPE
    property_type = ENUMERATION OF (none,youngs_modulus,poisson_ratio,shear_modulus,
                                    material_matrix,mass_density,thermal_expansion,
				    laminate,bending,transverse,bending_coupling,
				    material_coordinate,nodal_load_constraint,
				    beam_elements,beam_end,offsets,stress_recovery,
				    element_thickness,non_structural_mass,
				    thermal_conductivity,heat_capacity,
				    convective_film,radiation_parameters);
  END_TYPE;

  TYPE
    variable_type = ENUMERATION OF (none,temperature,pressure,relative_humidity,
                                    rate_of_strain,velocity,acceleration,time,
				    strain);
  END_TYPE;

  ENTITY tabular_data_entity
    SUBTYPE OF (finite_element_modeling_entity,property_entity);

    subordinate : subordinate_switch;
    np : INTEGER;
    ptype : property_type;
    nd    : INTEGER;
    typi  : ARRAY [0:255] OF variable_type;
    nvali : ARRAY [0:ni-1] OF INTEGER;
    vali  : LIST [0:ni-1] OF ARRAY [0:255] OF REAL;
    vald  : ARRAY [0:255] OF REAL;
  DERIVE 
    form : INTEGER := 11;
    ni : INTEGER := SIZEOF(typi);
  END_ENTITY;

  ENTITY external_reference_file_list_entity
    SUBTYPE OF (property_entity,external_reference_linkage_entity);

    subordinate : subordinate_switch;
    name : LIST OF STRING;
  DERIVE 
    form : INTEGER := 12;
    np : INTEGER := SIZEOF(name);
  END_ENTITY;

  ENTITY nominal_size_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    np : INTEGER;
    sz : REAL;
    nm : STRING;
    sp : OPTIONAL STRING;
  DERIVE 
    form : INTEGER := 13;
  WHERE
    (np = 2) OR (np = 3);
    (nm = 'AWG') OR (nm = 'IPS') OR (nm = 'OD');
  END_ENTITY;
  
  ENTITY flow_line_specification_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    l : LIST OF STRING;
  DERIVE 
    form : INTEGER := 14;
    np : INTEGER := SIZEOF(l);
  END_ENTITY;
           
  ENTITY name_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    name : STRING;
  DERIVE 
    form : INTEGER := 15;
    np : INTEGER := 1;
  END_ENTITY;

  ENTITY drawing_size_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    xs : REAL;
    ys : REAL;
  DERIVE 
    form : INTEGER := 16;
    np : INTEGER := 2;
  END_ENTITY;

  ENTITY drawing_units_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    flag : INTEGER;
    unit : STRING;
  DERIVE 
    form : INTEGER := 17;
    np : INTEGER := 2;
  END_ENTITY;
           
  ENTITY intercharacter_spacing_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    ispace : REAL;
  DERIVE
    form : INTEGER := 18;
    np : INTEGER := 1;
  WHERE
    (ispace >= 0.0) AND (ispace <= 100.0);
  END_ENTITY;

  ENTITY line_font_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    lfpc : INTEGER;
  DERIVE
    form : INTEGER := 19;
    np : INTEGER := 1;
  END_ENTITY;

  ENTITY highlight_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    highlight : INTEGER;
  DERIVE
    form : INTEGER := 20;
    np : INTEGER := 1;
  WHERE
    (highlight = 0) OR (highlight = 1);
  END_ENTITY;

  ENTITY pick_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    pick : INTEGER;
  DERIVE
    form : INTEGER := 21;
    np : INTEGER := 1;
  WHERE
    (pick = 0) OR (pick = 1);
  END_ENTITY;

  TYPE
    line_or_point_grid = ENUMERATION OF (points,lines);
  END_TYPE;

  ENTITY uniform_rectangular_grid_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    fflag : INTEGER;
    lflag : line_or_point_grid;
    wflag : INTEGER;
    px : REAL;
    py : REAL;
    dx : REAL;
    dy : REAL;
    nx : INTEGER;
    ny : INTEGER;
  DERIVE
    form : INTEGER := 22;
    np : INTEGER := 9;
  WHERE
    (fflag = 0) OR (fflag = 1);
    (wflag = 0) OR (wflag = 1);
  END_ENTITY;

  ENTITY associativity_group_type_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    atype : INTEGER;
    name : STRING;
  DERIVE
    form : INTEGER := 23;
    np : INTEGER := 2;
  END_ENTITY;

  ENTITY level_to_pwb_layer_map_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    np : INTEGER;
    layer_definitions : LIST OF layer_definition;
  DERIVE
    form : INTEGER := 24;
    nld : INTEGER := SIZEOF(layer_definitions);
  END_ENTITY;

  ENTITY layer_definition;
    il   : INTEGER;
    nlid : STRING;
    pln  : INTEGER;
    fln  : STRING;
  END_ENTITY;

  ENTITY pwb_artwork_stackup_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    np : INTEGER;
    id : STRING;
    l  : ARRAY [0:255] OF INTEGER;
  DERIVE
    form : INTEGER := 25;
    nv : INTEGER := SIZEOF(l);
  END_ENTITY;

  ENTITY pwb_drilled_hole_entity
    SUBTYPE OF (property_entity);

    subordinate : subordinate_switch;
    dds : REAL;
    fds : REAL;
    fc  : INTEGER;
  DERIVE
    form : INTEGER := 26;
    np : INTEGER := 3;
  WHERE
    ((fc >= 1) AND (fc <= 5)) OR ((fc >= 5001) AND (fc <= 9999));
  END_ENTITY;

  ENTITY generic_data_entity
    SUBTYPE OF (property_entity);

    np : INTEGER;
    name : STRING;
    values : LIST OF datum;
  DERIVE
    subordinate : subordinate_switch := physicallyDependent;
    used        : use_flag := definition;
    form : INTEGER := 27;
    nv   : INTEGER := SIZEOF(values);
  END_ENTITY;

  TYPE 
    position = ENUMERATION OF (none,before,after,above,below);
  END_TYPE;

  ENTITY dimension_units_entity
    SUBTYPE OF (property_entity);

    spos : position;
    ui   : INTEGER;
    chrset : INTEGER;
    ustring : STRING;
    fflag : INTEGER;
    prec  : INTEGER;
  DERIVE
    subordinate : subordinate_switch := logicallyDependent;
    used        : use_flag := definition;
    form : INTEGER := 28;
    np : INTEGER := 6;
  WHERE 
    ((ui >= 0) AND (ui <= 11)) OR ((ui >= 100) AND (ui <= 106));
    ( fflag = 0 ) OR ( fflag = 1);
  END_ENTITY;

  ENTITY dimension_tolerance_entity
    SUBTYPE OF (property_entity);

    sflag  : INTEGER;
    typ    : INTEGER;
    tpflag : INTEGER;
    utol   : REAL;
    ltol   : REAL;
    sspflg : BOOLEAN;
    fflag  : INTEGER;
    prec   : INTEGER;
  DERIVE
    subordinate : subordinate_switch := logicallyDependent;
    used        : use_flag := definition;
    form : INTEGER := 29;
    np   : INTEGER := 8;
  END_ENTITY;

  TYPE
    dimension_type = ENUMERATION OF (ordinary,ref,basic);
  END_TYPE;

  TYPE
    decimal_symbol = ENUMERATION OF (period,comma);
  END_TYPE;

  TYPE
    text_alignment = ENUMERATION OF (horizontal,parallel);
  END_TYPE;

  TYPE
    text_level = ENUMERATION OF (none,above,below);
  END_TYPE;

  TYPE
    arrowhead_orientation = ENUMERATION OF (point_in,point_out);
  END_TYPE;

  ENTITY dimension_display_data_entity
    SUBTYPE OF (property_entity);

    dt : dimension_type;
    lp : position;
    chrset : INTEGER;
    ls : STRING;
    ds : decimal_symbol;
    wla : REAL;
    ta  : text_alignment;
    tl  : text_level;
    tp  : INTEGER;
    ah  : arrowhead_orientation;
    iv  : REAL;
    notes : LIST OF note;
  DERIVE
    subordinate : subordinate_switch := logicallyDependent;
    used        : use_flag := definition;
    form : INTEGER := 30;
    np   : INTEGER := 14;
    k    : INTEGER := SIZEOF(notes);
  END_ENTITY;

  ENTITY note;
    snp : position;
    ns  : INTEGER;
    ne  : INTEGER;
  END_ENTITY;

  ENTITY basic_dimension_entity
    SUBTYPE OF (property_entity);

    llx : REAL;
    lly : REAL;
    lrx : REAL;
    lry : REAL;
    urx : REAL;
    ury : REAL;
    ulx : REAL;
    uly : REAL;
  DERIVE
    subordinate : subordinate_switch := physicallyDependent;
    used        : use_flag := definition;
    form : INTEGER := 31;
    np   : INTEGER := 8;
  END_ENTITY;

  ENTITY user_defined_property_entity
    SUBTYPE OF (property_entity);

    form : INTEGER;
    variables : LIST [1:np] of datum;
  DERIVE
    np   : INTEGER := SIZEOF(variables);
  END_ENTITY;

  ENTITY singular_subfigure_instance_entity
    SUBTYPE OF (subfigure_entity);
    
    view : entity_view;
    blank : blank_status;
    subordinate : subordinate_switch;
    used        : use_flag;
    de : subfigure_definition_entity;
    x : REAL;
    y : REAL;
    z : REAL;
    s : REAL;
  DERIVE
    entity_type : INTEGER := 408;
    form    : INTEGER := 0;
  END_ENTITY;
           
  ENTITY view_entity
    ABSTRACT SUPERTYPE OF (ONEOF (view_volume_entity,
		                  view_perspective_entity))
    SUBTYPE OF (drawing_or_view_entity);

    transformation : transformation_matrix_entity;
    vno : INTEGER;
    scale : REAL;
  DERIVE
    entity_type : INTEGER := 410;
    used : use_flag := annotation;
  END_ENTITY;
   
  ENTITY view_volume_entity
    SUBTYPE OF (view_entity);
    
    subordinate : subordinate_switch;
    xvminp : plane_entity;
    yvmaxp : plane_entity;
    xvmaxp : plane_entity;
    yvminp : plane_entity;
    zvminp : plane_entity;
    zvmaxp : plane_entity;
  DERIVE
    form    : INTEGER := 0;
  END_ENTITY;
   
  TYPE
    clipping_indicator = ENUMERATION OF (none,back_plane,front_plane,both);
  END_TYPE;

  ENTITY view_perspective_entity
    SUBTYPE OF (view_entity);
    
    subordinate : subordinate_switch;
    vpnx : REAL;
    vpny : REAL;
    vpnz : REAL;
    vrpx : REAL;
    vrpy : REAL;
    vrpz : REAL;
    cpx  : REAL;
    cpy  : REAL;
    cpz  : REAL;
    vupx : REAL;
    vupy : REAL;
    vupz : REAL;
    vpd  : REAL;
    umin : REAL;
    umax : REAL;
    vmin : REAL;
    vmax : REAL;
    dci  : clipping_indicator;
    wmin : REAL;
    wmax : REAL;
  DERIVE
    form : INTEGER := 1;
  END_ENTITY;
   
  TYPE
    base_entity = SELECT (associativity_group_type_entity,point_entity,line_entity,
                          circular_arc_entity,conic_arc_entity,
			  parametric_spline_curve_entity,
			  rational_bspline_curve_entity,annotation_entity,
			  rectangular_array_subfigure_instance_entity,
			  circular_array_subfigure_instance_entity,
			  subfigure_definition_entity);
  END_TYPE;

  ENTITY rectangular_array_subfigure_instance_entity
    SUBTYPE OF (subfigure_entity);

    view : entity_view;
    blank   : blank_status;
    subordinate : subordinate_switch;
    used        : use_flag;
    de : base_entity;
    s : REAL;
    x : REAL;
    y : REAL;
    z : REAL;
    nc : INTEGER;
    nr : INTEGER;
    dx : REAL;
    dy : REAL;
    ax : REAL;
    ddf : INTEGER;
    n : ARRAY [0:255] OF INTEGER;
  DERIVE
    entity_type : INTEGER := 412;
    form    : INTEGER := 0;
    lc : INTEGER := SIZEOF(n);
  WHERE
    (ddf = 0) OR (ddf = 1);
  END_ENTITY;

  ENTITY circular_array_subfigure_instance_entity
    SUBTYPE OF (subfigure_entity);

    view : entity_view;
    blank       : blank_status;
    subordinate : subordinate_switch;
    used        : use_flag;
    de : base_entity;
    ne : INTEGER;
    x : REAL;
    y : REAL;
    z : REAL;
    r : REAL;
    ast : REAL;
    ad  : REAL;
    ddf : INTEGER;
    n : ARRAY [0:255] OF INTEGER;
  DERIVE
    entity_type : INTEGER := 414;
    form    : INTEGER := 0;
    lc : INTEGER := SIZEOF(n);
  WHERE
    (ddf = 0) OR (ddf = 1);
  END_ENTITY;

  ENTITY external_reference_entity
    ABSTRACT SUPERTYPE OF (ONEOF (external_reference_file_only_entity,
		                  external_reference_entity_and_file_entity,
				  external_reference_entity_only_entity,
				  external_reference_library_entity))
    SUBTYPE OF (external_reference_linkage_entity);
    
  DERIVE
    entity_type : INTEGER := 416;
  END_ENTITY;

  ENTITY external_reference_entity_and_file_entity
    SUBTYPE OF (external_reference_entity);
    
    subordinate : subordinate_switch;
    used        : use_flag;
    form        : INTEGER;
    extfid : STRING;
    extnam : STRING;
  WHERE
    (form = 0) OR (form = 2);
  END_ENTITY;

  ENTITY external_reference_file_only_entity
    SUBTYPE OF (external_reference_entity);
    
    subordinate : subordinate_switch;
    used        : use_flag;
    extfid : STRING;
  DERIVE
    form : INTEGER := 1;
  END_ENTITY;

  ENTITY external_reference_entity_only_entity
    SUBTYPE OF (external_reference_entity);
    
    subordinate : subordinate_switch;
    used        : use_flag;
    extnam : STRING;
  DERIVE
    form : INTEGER := 3;
  END_ENTITY;

  ENTITY external_reference_library_entity
    SUBTYPE OF (external_reference_entity);
    
    subordinate : subordinate_switch;
    used        : use_flag;
    libnam : STRING;
    extnam : STRING;
  DERIVE
    blank : blank_status := visible;
    hierarchy : hierarchy_flag := all;
    form  : INTEGER := 4;
  END_ENTITY;

  ENTITY nodal_load_constraint_entity
    SUBTYPE OF (finite_element_modeling_entity);

    view    : entity_view;
    transformation : transformation_matrix_entity;
    label_display  : label_display_entity;
    blank       : blank_status;
    subordinate : subordinate_switch;
    used        : use_flag;
    ctype : INTEGER; 
    de  : node_entity;
    ptr : LIST OF tabular_data_entity;
  DERIVE
    entity_type : INTEGER := 418;
    form    : INTEGER := 0;
    nc : INTEGER := SIZEOF(ptr);
  END_ENTITY;

  TYPE
    definition_reference = SELECT(network_subfigure_definition_entity,
			          external_reference_entity);
  END_TYPE;

  ENTITY network_subfigure_instance_entity
    SUBTYPE OF (subfigure_entity,connectivity_entity);
    
    view    : entity_view;
    blank   : blank_status;
    subordinate : subordinate_switch;
    used        : use_flag;
    de : definition_reference;
    x  : REAL;
    y  : REAL;
    z  : REAL;
    xs : REAL;
    ys : REAL;
    zs : REAL;
    tf : INTEGER;
    prd : STRING;
    dptr : text_display_template_entity;
    cptr : LIST OF connect_point_entity;
  DERIVE
    entity_type : INTEGER := 420;
    form    : INTEGER := 0;
    nc : INTEGER := SIZEOF(cptr);
  END_ENTITY;
   
  ENTITY attribute_table_instance_entity
    ABSTRACT SUPERTYPE OF (ONEOF (tuple_instance_entity,
		                  table_instance_entity))
    SUBTYPE OF (attribute_table_entity);

    structure : attribute_table_definition_entity;
  DERIVE
    entity_type : INTEGER := 422;
  END_ENTITY;

  ENTITY tuple_instance_entity
    SUBTYPE OF (attribute_table_instance_entity);

    subordinate : subordinate_switch;
    used        : use_flag;
    av : LIST [0:structure.na-1] OF LIST OF datum;
  DERIVE
    form : INTEGER := 0;
  END_ENTITY;

  ENTITY table_instance_entity
    SUBTYPE OF (attribute_table_instance_entity);

    subordinate : subordinate_switch;
    used        : use_flag;
    av : LIST OF LIST [0:structure.na-1] OF LIST OF datum;
  DERIVE
    form : INTEGER := 1;
    nr : INTEGER := SIZEOF(av);
  END_ENTITY;

END_SCHEMA; -- iges_structure_schema;