Skip to content

Commit

Permalink
Merge pull request #800 from bSI-InfraRoom/fix/voxelDataAndGrid
Browse files Browse the repository at this point in the history
voxel data and grid
  • Loading branch information
SergejMuhic authored May 5, 2024
2 parents 07028c0 + 589b974 commit 2d54c49
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@
<DocDefinitionRef Name="IfcConversionBasedUnit" UniqueId="060d383c-c7f8-4cab-9687-a38476b990ad" />
<DocDefinitionRef Name="IfcSIUnit" UniqueId="d66e2f29-0256-488e-8a9a-74924fafd99b" />
<DocDefinitionRef Name="IfcIdentifier" UniqueId="2210aa88-051b-43eb-a406-1e724052d333" />
<DocDefinitionRef Name="IfcLabel" UniqueId="df9fc3f8-4077-4334-a271-92f706d683fa" />
<DocDefinitionRef id="IfcLabel_3VdyFuG7T3DA9nalS6reFw" Name="IfcLabel" UniqueId="df9fc3f8-4077-4334-a271-92f706d683fa" />
<DocDefinitionRef Name="IfcNonNegativeLengthMeasure" UniqueId="125db395-a517-469c-8318-207858feeeef" />
<DocDefinitionRef Name="IfcPlaneAngleMeasure" UniqueId="110cd174-1607-44c7-8d9a-dab06de7d729" />
<DocDefinitionRef Name="IfcCurvatureMeasure" UniqueId="e0638995-1c5e-49df-adeb-6b66040390b5" />
<DocDefinitionRef id="IfcInteger_3wu0Hj__nD9vk_ZJIPfGUc" Name="IfcInteger" UniqueId="fae0046d-fbec-4d27-9bbe-8d3499a507a6" />
<DocDefinitionRef Name="IfcReal" UniqueId="a925c825-d2e0-48dd-95fa-0d8fa08ea4c2" />
<DocDefinitionRef Name="IfcLogical" UniqueId="11118895-43ea-439c-a85f-a64fee64c415" />
<DocDefinitionRef id="IfcReal_2f9SWbqk18tPNw3O_WZgJ2" Name="IfcReal" UniqueId="a925c825-d2e0-48dd-95fa-0d8fa08ea4c2" />
<DocDefinitionRef id="IfcLogical_0H4OYLG_f3dAXVfakPCGL" Name="IfcLogical" UniqueId="11118895-43ea-439c-a85f-a64fee64c415" />
</Definitions>
</DocSchemaRef>
<DocSchemaRef Name="IFCPRESENTATIONAPPEARANCERESOURCE" UniqueId="44d5fffb-a247-4a43-a9d4-dc39a97034ec" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<DocEntity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="IfcIntegerVoxelData" UniqueId="f3d953cb-24b7-483d-85e1-d44c43d4d22b" BaseDefinition="IfcVoxelData" EntityFlags="32">
<Attributes>
<DocAttribute Name="Values" UniqueId="342aa966-eaa4-4d0c-87e5-91988a4f1c0a" DefinedType="IfcInteger" AggregationType="2" AggregationLower="1" AggregationUpper="GridSize">
<Documentation>The values assigned to the voxels. First x, then y and lastly z.</Documentation>
<DocAttribute Name="ValuesData" UniqueId="342aa966-eaa4-4d0c-87e5-91988a4f1c0a" DefinedType="IfcInteger" AggregationType="1" AggregationLower="1" AggregationUpper="?">
<Documentation>The values assigned to the voxels as raw integer typed data.</Documentation>
</DocAttribute>
<DocAttribute Name="Unit" UniqueId="d23d69e2-c35a-41d5-bf3b-9533670b9eb7" DefinedType="IfcUnit" AttributeFlags="1">
<Documentation>An optional unit for the integer values.</Documentation>
</DocAttribute>
<DocAttribute Name="GridSize" UniqueId="6f8d6a89-e211-4ca1-a678-e4221b561f42" DefinedType="IfcInteger">
<Derived> SIZEOF(SELF\IfcProduct.Representation.Representations[1].Items[1]\IfcVoxelGrid.Voxels)</Derived>
<DocAttribute Name="Values" UniqueId="920a9b45-a6a2-402e-82f1-1524d8e7700b" DefinedType="IfcInteger" AggregationType="2" AggregationLower="1" AggregationUpper="SELF\IfcVoxelData.GridSize">
<Documentation>Array of integer values on voxels accessible by the same index as that of the corresponding voxel.</Documentation>
<Derived>IfcListToExpandedArray(ValueData,1,SELF\IfcVoxelData.GridSize,SELF\IfcProduct.Representation.Representations[1].Items[1]\IfcVoxelGrid.Voxels);</Derived>
<Definition>
<DocDefinitionRef xsi:nil="true" href="IfcInteger_3wu0Hj__nD9vk_ZJIPfGUc" />
</Definition>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<DocEntity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="IfcLabelVoxelData" UniqueId="a470c8ce-b1bc-408a-bbbb-cf13350cbc52" BaseDefinition="IfcVoxelData" EntityFlags="32">
<Attributes>
<DocAttribute Name="Values" UniqueId="4cd3c5e4-9f44-4f28-bcf0-ff6ae4e9c4d3" DefinedType="IfcLabel" AggregationType="2" AggregationLower="1">
<Documentation>The values assigned to the voxels. First x, then y and lastly z.</Documentation>
<DocAttribute Name="ValuesData" UniqueId="4cd3c5e4-9f44-4f28-bcf0-ff6ae4e9c4d3" DefinedType="IfcLabel" AggregationType="1" AggregationLower="1">
<Documentation>The values assigned to the voxels as raw label typed data.</Documentation>
</DocAttribute>
<DocAttribute Name="Values" UniqueId="dfc8ebbf-cb1a-4668-8b2d-051c16f810b9" DefinedType="IfcLabel" AggregationType="2" AggregationLower="1" AggregationUpper="SELF\IfcVoxelData.GridSize">
<Documentation>Array of label values on voxels accessible by the same index as that of the corresponding voxel.</Documentation>
<Derived>IfcListToExpandedArray(ValueData,1,SELF\IfcVoxelData.GridSize,SELF\IfcProduct.Representation.Representations[1].Items[1]\IfcVoxelGrid.Voxels);</Derived>
<Definition>
<DocDefinitionRef xsi:nil="true" href="IfcLabel_3VdyFuG7T3DA9nalS6reFw" />
</Definition>
</DocAttribute>
</Attributes>
</DocEntity>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<DocEntity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="IfcLogicalVoxelData" UniqueId="9ae81157-c3af-41c0-9484-aab380993fa5" BaseDefinition="IfcVoxelData" EntityFlags="32">
<Attributes>
<DocAttribute Name="Values" UniqueId="6fe09457-0fcd-47d4-986a-98343b6f51c8" DefinedType="IfcLogical" AggregationType="2" AggregationLower="1">
<Documentation>The values assigned to the voxels. First x, then y and lastly z.</Documentation>
<DocAttribute Name="ValuesData" UniqueId="6fe09457-0fcd-47d4-986a-98343b6f51c8" DefinedType="IfcLogical" AggregationType="1" AggregationLower="1">
<Documentation>The values assigned to the voxels as raw logical typed data.</Documentation>
</DocAttribute>
<DocAttribute Name="Values" UniqueId="a33d9677-aac6-4fbf-bc1c-89f314eba8ac" DefinedType="IfcLogical" AggregationType="2" AggregationLower="1" AggregationUpper="SELF\IfcVoxelData.GridSize">
<Documentation>Array of logical values on voxels accessible by the same index as that of the corresponding voxel.</Documentation>
<Derived>IfcListToExpandedArray(ValueData,1,SELF\IfcVoxelData.GridSize,SELF\IfcProduct.Representation.Representations[1].Items[1]\IfcVoxelGrid.Voxels);</Derived>
<Definition>
<DocDefinitionRef xsi:nil="true" href="IfcLogical_0H4OYLG_f3dAXVfakPCGL" />
</Definition>
</DocAttribute>
</Attributes>
</DocEntity>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<DocEntity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="IfcRealVoxelData" UniqueId="bc833408-cb82-4557-bb85-151f9be8b892" BaseDefinition="IfcVoxelData" EntityFlags="32">
<Attributes>
<DocAttribute Name="Values" UniqueId="4c15cf4d-54aa-46c5-af16-6f42c3940384" DefinedType="IfcReal" AggregationType="2" AggregationLower="1">
<Documentation>The values assigned to the voxels. First x, then y and lastly z.</Documentation>
<DocAttribute Name="ValuesData" UniqueId="4c15cf4d-54aa-46c5-af16-6f42c3940384" DefinedType="IfcReal" AggregationType="1" AggregationLower="1">
<Documentation>The values assigned to the voxels as raw real typed data.</Documentation>
</DocAttribute>
<DocAttribute Name="Unit" UniqueId="3fafc736-2c3c-48b8-b1a7-b9483d46d2f1" DefinedType="IfcUnit" AttributeFlags="1">
<Documentation>An optional unit for the real values.</Documentation>
</DocAttribute>
<DocAttribute Name="Values" UniqueId="1cddb9c2-f8fb-4b48-85e6-0a77aeb6754e" DefinedType="IfcReal" AggregationType="2" AggregationLower="1" AggregationUpper="SELF\IfcVoxelData.GridSize">
<Documentation>Array of real values on voxels accessible by the same index as that of the corresponding voxel.</Documentation>
<Derived>IfcListToExpandedArray(ValueData,1,SELF\IfcVoxelData.GridSize,SELF\IfcProduct.Representation.Representations[1].Items[1]\IfcVoxelGrid.Voxels);</Derived>
<Definition>
<DocDefinitionRef xsi:nil="true" href="IfcReal_2f9SWbqk18tPNw3O_WZgJ2" />
</Definition>
</DocAttribute>
</Attributes>
</DocEntity>

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
<DocAttribute Name="ValueType" UniqueId="b1e92d88-1d1b-46b3-8a46-42e2bfbb2767" DefinedType="IfcLabel" AttributeFlags="1">
<Documentation>An optional value type used for the values defined in one of the subtypes. Only the names (as labels) of the types available in the _IfcValue_ select type are allowed.</Documentation>
</DocAttribute>
<DocAttribute Name="GridSize" UniqueId="6f8d6a89-e211-4ca1-a678-e4221b561f42" DefinedType="IfcInteger">
<Derived> SIZEOF(SELF\IfcProduct.Representation.Representations[1].Items[1]\IfcVoxelGrid.Voxels)</Derived>
<Definition>
<DocDefinitionRef xsi:nil="true" href="IfcInteger_3wu0Hj__nD9vk_ZJIPfGUc" />
</Definition>
</DocAttribute>
</Attributes>
<WhereRules>
<DocWhereRule Name="IsAssignedToProduct" UniqueId="1a35cca4-513b-4358-be9c-abe93df51a6b">
Expand All @@ -30,3 +36,4 @@ ShapeRep = SELF\IfcProduct.Representation.Representations[1])) = 1</Expression>
</DocWhereRule>
</WhereRules>
</DocEntity>

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<DocDefinitionRef Name="IfcLengthMeasure" UniqueId="3c831c12-d959-431b-acb3-ead5264dd715" />
<DocDefinitionRef Name="IfcBoolean" UniqueId="5846255f-c88f-4014-be92-a94d7a3d3c39" />
<DocDefinitionRef Name="IfcInteger" UniqueId="10de1fa3-b124-4d41-84fa-113459d99491" />
<DocDefinitionRef Name="IfcPositiveInteger" UniqueId="6b5c4b68-240e-438f-a05a-e1305da435ec" />
<DocDefinitionRef id="IfcPositiveInteger_1hN4je90v3Zw1QuJ1Tf3Ni" Name="IfcPositiveInteger" UniqueId="6b5c4b68-240e-438f-a05a-e1305da435ec" />
<DocDefinitionRef Name="IfcLabel" UniqueId="07fd9c74-8190-4dc9-bee0-d244ed13b0f8" />
<DocDefinitionRef Name="IfcNonNegativeLengthMeasure" UniqueId="74887fd8-e32a-4d2d-86ce-39d006aa6a99" />
</Definitions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,33 @@
<DocAttribute Name="VoxelSizeZ" UniqueId="946806c3-1ace-4539-b0a5-5c2d882b98c8" DefinedType="IfcNonNegativeLengthMeasure" AttributeFlags="1">
<Documentation>Size of voxels in the Z axis. If not given, the value from _VoxelSizeX_ shall be taken.</Documentation>
</DocAttribute>
<DocAttribute Name="NumberOfVoxelsX" UniqueId="1062135e-7018-4ec4-9ef7-3ca487268280" DefinedType="IfcInteger">
<DocAttribute Name="NumberOfVoxelsX" UniqueId="1062135e-7018-4ec4-9ef7-3ca487268280" DefinedType="IfcPositiveInteger">
<Documentation>Number of voxels along the X axis.</Documentation>
<Definition>
<DocDefinitionRef xsi:nil="true" href="IfcPositiveInteger_1hN4je90v3Zw1QuJ1Tf3Ni" />
</Definition>
</DocAttribute>
<DocAttribute Name="NumberOfVoxelsY" UniqueId="70c30c22-0e2a-446d-8a02-31355e75c4e7" DefinedType="IfcInteger" AttributeFlags="1">
<DocAttribute Name="NumberOfVoxelsY" UniqueId="70c30c22-0e2a-446d-8a02-31355e75c4e7" DefinedType="IfcPositiveInteger" AttributeFlags="1">
<Documentation>Number of voxels along the Y axis. If not given, the value from _NumberOfVoxelsX_ shall be taken.</Documentation>
<Definition>
<DocDefinitionRef xsi:nil="true" href="IfcPositiveInteger_1hN4je90v3Zw1QuJ1Tf3Ni" />
</Definition>
</DocAttribute>
<DocAttribute Name="NumberOfVoxelsZ" UniqueId="bbb9efce-f6f6-4834-a122-fbef29b024bd" DefinedType="IfcInteger" AttributeFlags="1">
<DocAttribute Name="NumberOfVoxelsZ" UniqueId="bbb9efce-f6f6-4834-a122-fbef29b024bd" DefinedType="IfcPositiveInteger" AttributeFlags="1">
<Documentation>NumberOf voxels along the Z axis. If not given, the value from _NumberOfVoxelsX_ shall be taken.</Documentation>
<Definition>
<DocDefinitionRef xsi:nil="true" href="IfcPositiveInteger_1hN4je90v3Zw1QuJ1Tf3Ni" />
</Definition>
</DocAttribute>
<DocAttribute Name="Voxels" UniqueId="14ee4900-2fe3-4e22-9af9-7e201ba42225" DefinedType="IfcBoolean" AggregationType="1" AggregationLower="1" AggregationUpper="0">
<DocAttribute Name="Voxels" UniqueId="14ee4900-2fe3-4e22-9af9-7e201ba42225" DefinedType="IfcBoolean" AggregationType="2" AggregationLower="1" AggregationUpper="NumberOfVoxelsX*NumberOfVoxelsY*NumberOfVoxelsZ">
<Documentation>Indication of voxels on the grid. The array is one-dimensional where values are distributed in the following order:
along X, then Y and finally Z.</Documentation>
</DocAttribute>
</Attributes>
<WhereRules>
<DocWhereRule Name="CorrectGridSize" UniqueId="d21d238c-a7bf-4473-9503-e1f72b3552c2">
<Documentation>The size of the grid (_Voxels_ array) shall be equal to the product of the number of voxels in X, Y and Z directions.</Documentation>
<Expression>SIZEOF(SELF\Voxels) = NumberOfVoxelsX * NVL(NumberOfVoxelsY, NumberOfVoxelsX) * NVL(NumberOfVoxelsZ, NumberOfVoxelsX)</Expression>
</DocWhereRule>
</WhereRules>
</DocEntity>

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<DocFunction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="IfcListToExpandedArray" UniqueId="a2381fb8-e26d-4b25-823b-6dcdfbbf8899" />

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 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&nbsp; New function in IFC4X4
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(Lis : LIST [0:?] OF GENERIC : T;
Low, U : INTEGER;
Condition : ARRAY OF BOOLEAN) : ARRAY OF GENERIC : T;
LOCAL
LisIndex : INTEGER := Low;
Res : ARRAY [Low:U] OF 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);

0 comments on commit 2d54c49

Please sign in to comment.