Skip to content

Commit

Permalink
Feature/bmspt 299 super bcf file (#22)
Browse files Browse the repository at this point in the history
* [BMSPT-299] generation of superbcf file

* [BMSPT-299] test file fix

* [BMSPT-299] more realistic bcf files
  • Loading branch information
DanielLepold authored Sep 9, 2024
1 parent 846135b commit 3a87ef2
Show file tree
Hide file tree
Showing 13 changed files with 669 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using BcfToolkit.Model;
using BcfToolkit.Model.Bcf21;

namespace BcfToolkit.Builder.Bcf21;
Expand Down Expand Up @@ -51,6 +49,12 @@ public VisualizationInfoBuilder SetPerspectiveCamera(
return this;
}

public VisualizationInfoBuilder SetViewSetupHints(
ViewSetupHints? viewSetupHints) {
_visualizationInfo.GetComponentsInstance().ViewSetupHints = viewSetupHints;
return this;
}



}
5 changes: 5 additions & 0 deletions src/bcf-toolkit/Builder/Bcf30/MarkupBuilderExensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@ public MarkupBuilder AddDocumentReferences(
documentReferences.ForEach(_markup.Topic.DocumentReferences.Add);
return this;
}

public MarkupBuilder SetBimSnippet(BimSnippet bimSnippet) {
_markup.Topic.BimSnippet = bimSnippet;
return this;
}
}
33 changes: 33 additions & 0 deletions src/bcf-toolkit/Builder/Bcf30/OrthogonalCameraBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using BcfToolkit.Model.Bcf30;

namespace BcfToolkit.Builder.Bcf30;

public partial class OrthogonalCameraBuilder {
public OrthogonalCameraBuilder SetCameraViewPoint(double x, double y, double z) {
_camera.CameraViewPoint = new Point {
X = x,
Y = y,
Z = z
};
return this;
}

public OrthogonalCameraBuilder SetCameraDirection(double x, double y, double z) {
_camera.CameraDirection = new Direction {
X = x,
Y = y,
Z = z
};
return this;
}

public OrthogonalCameraBuilder SetCameraUpVector(double x, double y, double z) {
_camera.CameraUpVector = new Direction {
X = x,
Y = y,
Z = z
};
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using BcfToolkit.Model.Bcf30;
namespace BcfToolkit.Builder.Bcf30;

public partial class PerspectiveCameraBuilder {
public PerspectiveCameraBuilder SetCameraViewPoint(double x, double y, double z) {
_camera.CameraViewPoint = new Point {
X = x,
Y = y,
Z = z
};
return this;
}

public PerspectiveCameraBuilder SetCameraDirection(double x, double y, double z) {
_camera.CameraDirection = new Direction {
X = x,
Y = y,
Z = z
};
return this;
}

public PerspectiveCameraBuilder SetCameraUpVector(double x, double y, double z) {
_camera.CameraUpVector = new Direction {
X = x,
Y = y,
Z = z
};
return this;
}
}
2 changes: 1 addition & 1 deletion src/bcf-toolkit/Builder/Bcf30/ViewPointBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace BcfToolkit.Builder.Bcf30;

public class ViewPointBuilder : IViewPointBuilder<
public partial class ViewPointBuilder : IViewPointBuilder<
ViewPointBuilder, VisualizationInfoBuilder> {
private readonly ViewPoint _viewPoint = new();

Expand Down
11 changes: 11 additions & 0 deletions src/bcf-toolkit/Builder/Bcf30/ViewPointBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using BcfToolkit.Model.Bcf30;

namespace BcfToolkit.Builder.Bcf30;

public partial class ViewPointBuilder {

public ViewPointBuilder SetVisualizationInfo(VisualizationInfo visualizationInfo) {
_viewPoint.VisualizationInfo = visualizationInfo;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,19 @@ public VisualizationInfoBuilder AddBitmaps(List<Bitmap>? bitmaps) {
bitmaps?.ForEach(_visualizationInfo.Bitmaps.Add);
return this;
}

public VisualizationInfoBuilder SetOrthogonalCamera(OrthogonalCamera orthogonalCamera) {
_visualizationInfo.OrthogonalCamera = orthogonalCamera;
return this;
}

public VisualizationInfoBuilder SetPerspectiveCamera(PerspectiveCamera perspectiveCamera) {
_visualizationInfo.PerspectiveCamera = perspectiveCamera;
return this;
}

public VisualizationInfoBuilder SetVisibility(ComponentVisibility visibility) {
_visualizationInfo.GetComponentsInstance().Visibility = visibility;
return this;
}
}
18 changes: 9 additions & 9 deletions src/tests/Builder/Bcf21/BcfBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public void EmptyFieldsConversationTest() {
headerBuilder
.SetDate(DateTime.Now)
.SetReference(string.Empty)
.SetFileName("Filename")
.SetIfcProject("1234567890123456789012")
.SetIfcSpatialStructureElement("1234567890123456789012")
.SetFileName("StructuralModel.ifc")
.SetIfcProject("1g8GxLEzP459ZWW6_RGsez")
.SetIfcSpatialStructureElement("2g8GxLEzP459ZWW6_RGsez")
.SetIsExternal(true)
.Build();
var headers = new List<HeaderFile> { header };
Expand All @@ -62,17 +62,17 @@ public void EmptyFieldsConversationTest() {
.SetModifiedAuthor(string.Empty)
.SetDate(DateTime.Today)
.SetModifiedDate(DateTime.Today)
.SetAuthor("author1")
.SetCommentProperty("commProp1")
.SetAuthor("[email protected]")
.SetCommentProperty("Pls changes the wall thickness to 8cm")
.Build();
var commentPropCanBeEmpty =
commentBuilder2
.SetGuid("999b4df2-0187-49a9-8a4a-23992696bafd")
.SetModifiedAuthor(string.Empty)
.SetDate(DateTime.Today)
.SetModifiedDate(DateTime.Today)
.SetAuthor("author2")
.SetViewPointGuid("111b4df2-0187-49a9-8a4a-23992696bafd")
.SetAuthor("[email protected]")
.SetViewPointGuid("444b4df2-0187-49a9-8a4a-23992696bafd")
.SetCommentProperty(string.Empty)
.Build();
var comments = new List<Comment> { commentPropMustHaveValue, commentPropCanBeEmpty };
Expand All @@ -83,7 +83,7 @@ public void EmptyFieldsConversationTest() {
var componentBuilder = new ComponentBuilder();
var component =
componentBuilder
.SetIfcGuid("1234567890123456789012")
.SetIfcGuid("3g8GxLEzP459ZWW6_RGsez")
.SetOriginatingSystem(string.Empty)
.SetAuthoringToolId(string.Empty)
.Build();
Expand All @@ -104,7 +104,7 @@ public void EmptyFieldsConversationTest() {
var viewPoint =
viewPointBuilder
.SetGuid("444b4df2-0187-49a9-8a4a-23992696bafd")
.SetIndex(5)
.SetIndex(0)
.SetSnapshot(string.Empty)
.SetSnapshotData(new FileData {
Data = "snapshotdata1"
Expand Down
Loading

0 comments on commit 3a87ef2

Please sign in to comment.