Skip to content

Commit 3a87ef2

Browse files
authored
Feature/bmspt 299 super bcf file (#22)
* [BMSPT-299] generation of superbcf file * [BMSPT-299] test file fix * [BMSPT-299] more realistic bcf files
1 parent 846135b commit 3a87ef2

13 files changed

+669
-13
lines changed

src/bcf-toolkit/Builder/Bcf21/VisualizationInfoBuilderExtension.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
21
using System.Collections.Generic;
3-
using BcfToolkit.Model;
42
using BcfToolkit.Model.Bcf21;
53

64
namespace BcfToolkit.Builder.Bcf21;
@@ -51,6 +49,12 @@ public VisualizationInfoBuilder SetPerspectiveCamera(
5149
return this;
5250
}
5351

52+
public VisualizationInfoBuilder SetViewSetupHints(
53+
ViewSetupHints? viewSetupHints) {
54+
_visualizationInfo.GetComponentsInstance().ViewSetupHints = viewSetupHints;
55+
return this;
56+
}
57+
5458

5559

5660
}

src/bcf-toolkit/Builder/Bcf30/MarkupBuilderExensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,9 @@ public MarkupBuilder AddDocumentReferences(
4444
documentReferences.ForEach(_markup.Topic.DocumentReferences.Add);
4545
return this;
4646
}
47+
48+
public MarkupBuilder SetBimSnippet(BimSnippet bimSnippet) {
49+
_markup.Topic.BimSnippet = bimSnippet;
50+
return this;
51+
}
4752
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using BcfToolkit.Model.Bcf30;
2+
3+
namespace BcfToolkit.Builder.Bcf30;
4+
5+
public partial class OrthogonalCameraBuilder {
6+
public OrthogonalCameraBuilder SetCameraViewPoint(double x, double y, double z) {
7+
_camera.CameraViewPoint = new Point {
8+
X = x,
9+
Y = y,
10+
Z = z
11+
};
12+
return this;
13+
}
14+
15+
public OrthogonalCameraBuilder SetCameraDirection(double x, double y, double z) {
16+
_camera.CameraDirection = new Direction {
17+
X = x,
18+
Y = y,
19+
Z = z
20+
};
21+
return this;
22+
}
23+
24+
public OrthogonalCameraBuilder SetCameraUpVector(double x, double y, double z) {
25+
_camera.CameraUpVector = new Direction {
26+
X = x,
27+
Y = y,
28+
Z = z
29+
};
30+
return this;
31+
}
32+
33+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using BcfToolkit.Model.Bcf30;
2+
namespace BcfToolkit.Builder.Bcf30;
3+
4+
public partial class PerspectiveCameraBuilder {
5+
public PerspectiveCameraBuilder SetCameraViewPoint(double x, double y, double z) {
6+
_camera.CameraViewPoint = new Point {
7+
X = x,
8+
Y = y,
9+
Z = z
10+
};
11+
return this;
12+
}
13+
14+
public PerspectiveCameraBuilder SetCameraDirection(double x, double y, double z) {
15+
_camera.CameraDirection = new Direction {
16+
X = x,
17+
Y = y,
18+
Z = z
19+
};
20+
return this;
21+
}
22+
23+
public PerspectiveCameraBuilder SetCameraUpVector(double x, double y, double z) {
24+
_camera.CameraUpVector = new Direction {
25+
X = x,
26+
Y = y,
27+
Z = z
28+
};
29+
return this;
30+
}
31+
}

src/bcf-toolkit/Builder/Bcf30/ViewPointBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace BcfToolkit.Builder.Bcf30;
88

9-
public class ViewPointBuilder : IViewPointBuilder<
9+
public partial class ViewPointBuilder : IViewPointBuilder<
1010
ViewPointBuilder, VisualizationInfoBuilder> {
1111
private readonly ViewPoint _viewPoint = new();
1212

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using BcfToolkit.Model.Bcf30;
2+
3+
namespace BcfToolkit.Builder.Bcf30;
4+
5+
public partial class ViewPointBuilder {
6+
7+
public ViewPointBuilder SetVisualizationInfo(VisualizationInfo visualizationInfo) {
8+
_viewPoint.VisualizationInfo = visualizationInfo;
9+
return this;
10+
}
11+
}

src/bcf-toolkit/Builder/Bcf30/VisualizationInfoBuilderExtensions.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,19 @@ public VisualizationInfoBuilder AddBitmaps(List<Bitmap>? bitmaps) {
3030
bitmaps?.ForEach(_visualizationInfo.Bitmaps.Add);
3131
return this;
3232
}
33+
34+
public VisualizationInfoBuilder SetOrthogonalCamera(OrthogonalCamera orthogonalCamera) {
35+
_visualizationInfo.OrthogonalCamera = orthogonalCamera;
36+
return this;
37+
}
38+
39+
public VisualizationInfoBuilder SetPerspectiveCamera(PerspectiveCamera perspectiveCamera) {
40+
_visualizationInfo.PerspectiveCamera = perspectiveCamera;
41+
return this;
42+
}
43+
44+
public VisualizationInfoBuilder SetVisibility(ComponentVisibility visibility) {
45+
_visualizationInfo.GetComponentsInstance().Visibility = visibility;
46+
return this;
47+
}
3348
}

src/tests/Builder/Bcf21/BcfBuilderTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public void EmptyFieldsConversationTest() {
3535
headerBuilder
3636
.SetDate(DateTime.Now)
3737
.SetReference(string.Empty)
38-
.SetFileName("Filename")
39-
.SetIfcProject("1234567890123456789012")
40-
.SetIfcSpatialStructureElement("1234567890123456789012")
38+
.SetFileName("StructuralModel.ifc")
39+
.SetIfcProject("1g8GxLEzP459ZWW6_RGsez")
40+
.SetIfcSpatialStructureElement("2g8GxLEzP459ZWW6_RGsez")
4141
.SetIsExternal(true)
4242
.Build();
4343
var headers = new List<HeaderFile> { header };
@@ -62,17 +62,17 @@ public void EmptyFieldsConversationTest() {
6262
.SetModifiedAuthor(string.Empty)
6363
.SetDate(DateTime.Today)
6464
.SetModifiedDate(DateTime.Today)
65-
.SetAuthor("author1")
66-
.SetCommentProperty("commProp1")
65+
.SetAuthor("john.wick@johnwick.com")
66+
.SetCommentProperty("Pls changes the wall thickness to 8cm")
6767
.Build();
6868
var commentPropCanBeEmpty =
6969
commentBuilder2
7070
.SetGuid("999b4df2-0187-49a9-8a4a-23992696bafd")
7171
.SetModifiedAuthor(string.Empty)
7272
.SetDate(DateTime.Today)
7373
.SetModifiedDate(DateTime.Today)
74-
.SetAuthor("author2")
75-
.SetViewPointGuid("111b4df2-0187-49a9-8a4a-23992696bafd")
74+
.SetAuthor("jim.carry@jim.com")
75+
.SetViewPointGuid("444b4df2-0187-49a9-8a4a-23992696bafd")
7676
.SetCommentProperty(string.Empty)
7777
.Build();
7878
var comments = new List<Comment> { commentPropMustHaveValue, commentPropCanBeEmpty };
@@ -83,7 +83,7 @@ public void EmptyFieldsConversationTest() {
8383
var componentBuilder = new ComponentBuilder();
8484
var component =
8585
componentBuilder
86-
.SetIfcGuid("1234567890123456789012")
86+
.SetIfcGuid("3g8GxLEzP459ZWW6_RGsez")
8787
.SetOriginatingSystem(string.Empty)
8888
.SetAuthoringToolId(string.Empty)
8989
.Build();
@@ -104,7 +104,7 @@ public void EmptyFieldsConversationTest() {
104104
var viewPoint =
105105
viewPointBuilder
106106
.SetGuid("444b4df2-0187-49a9-8a4a-23992696bafd")
107-
.SetIndex(5)
107+
.SetIndex(0)
108108
.SetSnapshot(string.Empty)
109109
.SetSnapshotData(new FileData {
110110
Data = "snapshotdata1"

0 commit comments

Comments
 (0)