IfcListToExpandedArray

Natural language names
Semantic definitions at the function
Function Definition

This function converts a generic list to an array with newly determined array bounds. If the array bounds are incompatible with the number of elements in the conditional list (number of elements in the list has to be smaller than the array upper bound and the number of values has to match the number of true values from Condition) a null result is returned. This function is used to construct the array of voxel values in IfcVoxelData based on the its IfcVoxelGrid geometric representation.

HISTORY  New function in IFC4X4

Formal representations
EXPRESS Specification

FUNCTION IfcListToExpandedArray
(Lis : LIST [0:?] OF GENERIC : T;
      Low, U : INTEGER;
      Condition : ARRAY OF BOOLEAN) : ARRAY OF OPTIONAL GENERIC : T;
  LOCAL
    LisIndex : INTEGER := Low;
    Res : ARRAY [Low:U] OF OPTIONAL GENERIC : T;
  END_LOCAL;
      
  IF (SIZEOF(QUERY(item <* Condition | item)) <> SIZEOF(Lis)) THEN
    RETURN(?);
  END_IF;

  IF (SIZEOF(Lis) <> (U-Low + 1)) THEN
    RETURN(?);
  END_IF;
  
  REPEAT i := 1 TO SIZEOF(Condition);
    IF (Condition[i]) THEN
      Res[Low + i - 1] := Lis[LisIndex];
      LisIndex := LisIndex + 1;
    END_IF;
  END_REPEAT;
  RETURN(Res);

END_FUNCTION;

Link to this page  Link to this page