Navigation
Navigate Navigate Navigate Navigate

IfcCorrectFillAreaStyle

Definition from IAI: This function returns true if the different fill area styles are assigned correctly to the IfcFillAreaStyle. Only certain combinations of the entity types provided by the IfcFillStyleSelect are allowed.

Return false:

otherwise return true

HISTORY  New function in Release IFC2x3 TC1.

EXPRESS specification:

FUNCTION IfcCorrectFillAreaStyle
  (Styles : SET[1:?] OF IfcFillStyleSelect)
  :LOGICAL;

LOCAL
   Hatching : INTEGER := 0;
   Tiles    : INTEGER := 0;
   Colour   : INTEGER := 0;
   External : INTEGER := 0;
END_LOCAL;


External := SIZEOF(QUERY(Style <* Styles |
  'IFCPRESENTATIONAPPEARANCERESOURCE.IFCEXTERNALLYDEFINEDHATCHSTYLE' IN
   TYPEOF(Style)));

Hatching  := SIZEOF(QUERY(Style <* Styles |
  'IFCPRESENTATIONAPPEARANCERESOURCE.IFCFILLAREASTYLEHATCHING' IN
   TYPEOF(Style)));

Tiles     := SIZEOF(QUERY(Style <* Styles |
  'IFCPRESENTATIONAPPEARANCERESOURCE.IFCFILLAREASTYLETILES' IN
   TYPEOF(Style)));

Colour    := SIZEOF(QUERY(Style <* Styles |
  'IFCPRESENTATIONRESOURCE.IFCCOLOUR' IN
   TYPEOF(Style)));


IF (External > 1) THEN
  RETURN (FALSE);
END_IF;


IF ((External = 1) AND ((Hatching > 0) OR (Tiles > 0) OR (Colour > 0))) THEN
  RETURN (FALSE);
END_IF;


IF (Colour > 1) THEN
  RETURN (FALSE);
END_IF;

IF ((Hatching > 0) AND (Tiles >0)) THEN
  RETURN (FALSE);
END_IF;

RETURN(TRUE);
END_FUNCTION;