Skip to content

Commit

Permalink
GSAGH-367 DisplayTests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tilman Reinhardt committed Oct 6, 2023
1 parent bb79ea8 commit 9b7c063
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
Binary file modified ExampleFiles/Components/Display1d.gh
Binary file not shown.
Binary file modified ExampleFiles/Components/Display2d.gh
Binary file not shown.
Binary file modified ExampleFiles/Components/Display3d.gh
Binary file not shown.
16 changes: 1 addition & 15 deletions GsaGH/Components/6_Display/Preview3dSections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ protected override void SolveInternal(IGH_DataAccess da) {
if (da.GetDataList(0, ghTypes)) {
var elem1ds = new List<GsaElement1d>();
var elem2ds = new List<GsaElement2d>();
var elem3ds = new List<GsaElement3d>();
var mem1ds = new List<GsaMember1d>();
var mem2ds = new List<GsaMember2d>();
var mem3ds = new List<GsaMember3d>();
var models = new List<GsaModel>();
var lists = new List<GsaList>();
for (int i = 0; i < ghTypes.Count; i++) {
Expand Down Expand Up @@ -117,10 +115,6 @@ protected override void SolveInternal(IGH_DataAccess da) {
elem2ds.Add(element2dGoo.Value);
break;

case GsaElement3dGoo element3dGoo:
elem3ds.Add(element3dGoo.Value);
break;

case GsaMember1dGoo member1dGoo:
mem1ds.Add(member1dGoo.Value);
break;
Expand All @@ -129,10 +123,6 @@ protected override void SolveInternal(IGH_DataAccess da) {
mem2ds.Add(member2dGoo.Value);
break;

case GsaMember3dGoo member3dGoo:
mem3ds.Add(member3dGoo.Value);
break;

default: {
string type = ghTyp.Value.GetType().ToString();
type = type.Replace("GsaGH.Parameters.", string.Empty);
Expand Down Expand Up @@ -161,10 +151,6 @@ protected override void SolveInternal(IGH_DataAccess da) {
mem2ds = null;
}

if (!(mem3ds.Count > 0)) {
mem2ds = null;
}

if (models is null & elem1ds is null & elem2ds is null & mem1ds is null & mem2ds is null) {
this.AddRuntimeWarning("Input parameter failed to collect data");
return;
Expand All @@ -181,7 +167,7 @@ protected override void SolveInternal(IGH_DataAccess da) {
}

// Assemble model
var assembly = new ModelAssembly(model, lists, elem1ds, elem2ds, elem3ds, mem1ds, mem2ds, mem3ds, _lengthUnit);
var assembly = new ModelAssembly(model, lists, elem1ds, elem2ds, mem1ds, mem2ds, _lengthUnit);
GsaAPI.Model previewModel = assembly.GetModel();

var steps = new List<int> {
Expand Down
8 changes: 4 additions & 4 deletions GsaGH/Helpers/Assembly/ModelAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ internal ModelAssembly(GsaElement1d element) {

// assemble for preview
internal ModelAssembly(GsaModel model, List<GsaList> lists, List<GsaElement1d> elem1ds,
List<GsaElement2d> elem2ds, List<GsaElement3d> elem3ds, List<GsaMember1d> mem1ds,
List<GsaMember2d> mem2ds, List<GsaMember3d> mem3ds, LengthUnit modelUnit) {
List<GsaElement2d> elem2ds, List<GsaMember1d> mem1ds,
List<GsaMember2d> mem2ds, LengthUnit modelUnit) {
SetupModel(model, modelUnit);
ConvertElements(elem1ds, elem2ds, elem3ds);
ConvertMembers(mem1ds, mem2ds, mem3ds);
ConvertElements(elem1ds, elem2ds, null);
ConvertMembers(mem1ds, mem2ds, null);
ConvertLists(lists);
AssembleNodesElementsMembersAndLists();
}
Expand Down

0 comments on commit 9b7c063

Please sign in to comment.