FUNCTION dimension_of
(* SCHEMA Ap242_managed_model_based_3d_engineering_mim_LF; *)
FUNCTION dimension_of(item : geometric_representation_item) :
dimension_count;
LOCAL
x : SET OF representation;
y : representation_context;
dim : dimension_count;
END_LOCAL;
-- For cartesian_point, direction, or vector dimension is determined by
-- counting components.
IF 'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.CARTESIAN_POINT' IN TYPEOF(item) THEN
dim := SIZEOF(item\cartesian_point.coordinates);
RETURN(dim);
END_IF;
IF 'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.DIRECTION' IN TYPEOF(item) THEN
dim := SIZEOF(item\direction.direction_ratios);
RETURN(dim);
END_IF;
IF 'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.VECTOR' IN TYPEOF(item) THEN
dim := SIZEOF(item\vector.orientation\direction.direction_ratios);
RETURN(dim);
END_IF;
-- For all other types of geometric_representation_item dim is obtained
-- via context.
-- Find the set of representation in which the item is used.
x := using_representations(item);
-- Determines the dimension_count of the
-- geometric_representation_context. Note that the
-- RULE compatible_dimension ensures that the context_of_items
-- is of type geometric_representation_context and has
-- the same dimension_count for all values of x.
-- The SET x is non-empty for legal instances since this is required by WR1 of
-- representation_item.
IF (SIZEOF(x) > 0) THEN
y := x[1].context_of_items;
dim := y\geometric_representation_context.coordinate_space_dimension;
RETURN (dim);
ELSE
RETURN(?);
-- mark error by returning indeterminate result
END_IF;
END_FUNCTION;
Referenced By
Defintion dimension_of is references by the following definitions:
[Top Level Definitions] [Exit]Generated by STEP Tools® EXPRESS to HTML Converter
2012-03-27T17:20:10-04:00