Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/bmspt 299 super bcf file #22

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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("john.wick@johnwick.com")
.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("jim.carry@jim.com")
.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
Loading