IFC 4.3.2.20251031 (IFC4X3_ADD2) under development

8.21.3.3 IfcTable(表)

8.21.3.3.1 语义定义(Semantic definition)

IfcTable 是一种以行和列形式提供信息的数据结构。每个实例可包含定义各列名称、描述和单位的 IfcTableColumn 实例。信息行以 IfcTableRow 对象列表形式存储。

限制:为保持向后兼容性,IfcTable 对象的行被约束为具有相同的单元格数量。表的首行定义了单元格数量,所有其他行必须包含相同数量的单元格。此约束由 WR2 强制执行。

图1展示了表的用法。

表的使用
图1 — 表的使用

图2描述了IFC4之前版本中表的结构。

表的使用替代方案
图2 — 表的使用替代方案

8.21.3.3.2 实体继承(Entity inheritance)

8.21.3.3.3 特性(Attributes)

# 特性(Attributes) 类型 描述
IfcTable (6)
1 Name OPTIONAL IfcLabel

无可用描述

2 Rows OPTIONAL LIST [1:?] OF IfcTableRow

对行信息内容的引用。

3 Columns OPTIONAL LIST [1:?] OF IfcTableColumn

与此表关联的列信息。

* NumberOfCellsInRow IfcInteger

此属性是形式化派生的

HIINDEX(Rows[1].RowCells)

每行中的单元格数量,对应表中的列数。参见确保每行具有相同单元格数的WR2。实际值从Rows列表的首个成员推导得出。

* NumberOfHeadings IfcInteger

此属性是形式化派生的

SIZEOF(QUERY( Temp <* Rows | Temp.IsHeading))

表中的标题行数量。WR3将其限制为最多一行。

* NumberOfDataRows IfcInteger

此属性是形式化派生的

SIZEOF(QUERY( Temp <* Rows | NOT(Temp.IsHeading)))

表中包含数据的行数,即总行数减去表中的标题行数。

表 8.21.3.3.A

8.21.3.3.4 形式化命题(Formal propositions)

名称 描述
WR1

确保每行定义相同数量的单元格。该规则比较IfcTable所有其他行是否与首行具有相同的单元格数。

SIZEOF(QUERY( Temp <* Rows | HIINDEX(Temp.RowCells) <> HIINDEX(Rows[1].RowCells))) = 0
WR2

该规则将允许的标题行数量限制为不超过一行。

{ 0 <= NumberOfHeadings <= 1 }
表 8.21.3.3.C

8.21.3.3.5 形式化表示(Formal representation)

ENTITY IfcTable;
	Name : OPTIONAL IfcLabel;
	Rows : OPTIONAL LIST [1:?] OF IfcTableRow;
	Columns : OPTIONAL LIST [1:?] OF IfcTableColumn;
 DERIVE
	 NumberOfCellsInRow : IfcInteger := HIINDEX(Rows[1].RowCells);
	 NumberOfHeadings : IfcInteger := SIZEOF(QUERY( Temp <* Rows | Temp.IsHeading));
	 NumberOfDataRows : IfcInteger := SIZEOF(QUERY( Temp <* Rows | NOT(Temp.IsHeading)));
 WHERE
	WR1 : SIZEOF(QUERY( Temp <* Rows | HIINDEX(Temp.RowCells) <> HIINDEX(Rows[1].RowCells))) = 0;
	WR2 : { 0 <= NumberOfHeadings <= 1 };
END_ENTITY;

8.21.3.3.6 参考文献