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

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

SCHEMA Inertia_characteristics_xim;

USE FROM Elemental_geometric_shape_xim;

USE FROM Shape_property_assignment_xim;

USE FROM Value_with_unit_xim;

USE FROM Inertia_characteristics_mim;

USE FROM representation_schema(compound_item_definition);

ENTITY Centre_of_mass
(* CONNOTATIONAL *) SUBTYPE OF (Shape_dependent_property_representation);
WHERE
WR1: SIZEOF(SELF\Shape_dependent_property_representation.property_representation.items)=1;
WR2: SIZEOF(QUERY (it <* SELF\Shape_dependent_property_representation.property_representation.items |
   'INERTIA_CHARACTERISTICS_XIM' + '.CARTESIAN_POINT' IN TYPEOF(it) ))=1;
WR3: 'INERTIA_CHARACTERISTICS_XIM' + '.GEOMETRIC_REPRESENTATION_CONTEXT' IN 
	TYPEOF(SELF\Shape_dependent_property_representation.property_representation.context_of_items);
END_ENTITY;

ENTITY Inertia_matrix_item
(* CONNOTATIONAL *) SUBTYPE OF (compound_representation_item);
  inertia_values : ARRAY[1:6] OF REAL;
  common_unit: Unit;
 (* overlapping with inertia_values and common_unit, so make it not accessable to developer *)
 DERIVE
  SELF\compound_representation_item.item_element : compound_item_definition :=?;
END_ENTITY;

ENTITY Moments_of_inertia
(* CONNOTATIONAL *) SUBTYPE OF (Shape_dependent_property_representation, moments_of_inertia_representation);
WHERE
WR1: SIZEOF(QUERY (it <* SELF\Shape_dependent_property_representation.property_representation.items |
   'INERTIA_CHARACTERISTICS_XIM' + '.AXIS2_PLACEMENT'IN TYPEOF(it) ))=1;
WR2: SIZEOF(QUERY (it <* SELF\Shape_dependent_property_representation.property_representation.items |
   'INERTIA_CHARACTERISTICS_XIM' + '.INERTIA_MATRIX_ITEM' IN TYPEOF(it) ))=1;
WR3: 'INERTIA_CHARACTERISTICS_XIM' + '.GEOMETRIC_REPRESENTATION_CONTEXT' IN 
	TYPEOF(SELF\Shape_dependent_property_representation.property_representation.context_of_items);
END_ENTITY;


END_SCHEMA;
