Skip to content

Commit

Permalink
GSAGH-488-Add-displacements-to-ResultDiagrams (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlmnrnhrdt committed May 6, 2024
2 parents 0f506df + 3bb571f commit 148ef66
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion GsaGH/Components/3_Loads/CreateGridAreaLoad.cs
Expand Up @@ -204,7 +204,7 @@ public class CreateGridAreaLoad : GH_OasysDropDownComponent {
Curve[] edges = Curve.JoinCurves(edgeSegments);
Curve curve = edges[0];

if (curve.TryGetPolyline(out Polyline polyline)) {
if (curve.TryGetPolyline(out Rhino.Geometry.Polyline polyline)) {
var ctrlPts = new Point3dList(polyline);
gridareaload.Points = ctrlPts;

Expand Down
2 changes: 1 addition & 1 deletion GsaGH/Components/3_Loads/CreateGridLineLoad.cs
Expand Up @@ -199,7 +199,7 @@ public class CreateGridLineLoad : GH_OasysDropDownComponent {
Curve curve = null;
GH_Convert.ToCurve(ghCurve, ref curve, GH_Conversion.Both);

if (curve.TryGetPolyline(out Polyline ln)) {
if (curve.TryGetPolyline(out Rhino.Geometry.Polyline ln)) {
var controlPoints = new Point3dList(ln);
gridlineload.Points = controlPoints;

Expand Down
2 changes: 1 addition & 1 deletion GsaGH/Components/6_Display/AnnotateDetailed.cs
Expand Up @@ -229,7 +229,7 @@ public class AnnotateDetailed : GH_OasysDropDownComponent {
break;

case GsaMember2dGoo m2d:
m2d.Value.PolyCurve.TryGetPolyline(out Polyline pl);
m2d.Value.PolyCurve.TryGetPolyline(out Rhino.Geometry.Polyline pl);
if (_text3d) {
Plane.FitPlaneToPoints(pl, out Plane pln);
pln.Origin = pl.CenterPoint();
Expand Down
12 changes: 7 additions & 5 deletions GsaGH/Components/6_Display/ResultDiagrams.cs
Expand Up @@ -264,14 +264,14 @@ public class ResultDiagrams : GH_OasysDropDownComponent {
GraphicDrawResult diagramResults = result.Model.Model.GetDiagrams(graphic);
ReadOnlyCollection<Line> linesFromModel = diagramResults.Lines;

Color color = Color.Empty;
da.GetData(4, ref color);

double lengthScaleFactor = UnitConverter.Convert(1, Length.BaseUnit, lengthUnit);
bool doubleArrow = false;
bool isDisplacement = false;
if (_selectedItems[0] == "Displacement") {
isDisplacement = true;
}

Color color = Color.Empty;
bool doubleArrow = false;
if (!da.GetData(4, ref color) && isDisplacement) {
if (IsTranslation()) {
color = Color.FromArgb(102, 220, 103);
} else {
Expand All @@ -280,6 +280,8 @@ public class ResultDiagrams : GH_OasysDropDownComponent {
}
}

double lengthScaleFactor = UnitConverter.Convert(1, Length.BaseUnit, lengthUnit);

foreach (Line item in linesFromModel) {
if (isDisplacement) {
var anchor = new Point3d(item.Start.X, item.Start.Y, item.Start.Z);
Expand Down
2 changes: 1 addition & 1 deletion GsaGH/Helpers/GH/RhinoConversions.cs
Expand Up @@ -706,7 +706,7 @@ public static
edges.AddRange(inner);

Point3dList ctrlPts;
if (edges[0].TryGetPolyline(out Polyline tempCrv)) {
if (edges[0].TryGetPolyline(out Rhino.Geometry.Polyline tempCrv)) {
ctrlPts = new Point3dList(tempCrv);
} else {
Tuple<PolyCurve, Point3dList, List<string>> convertBadSrf
Expand Down
1 change: 1 addition & 0 deletions GsaGH/Parameters/2_Geometry/GsaMember3d.cs
Expand Up @@ -12,6 +12,7 @@
using Rhino.Geometry.Collections;
using LengthUnit = OasysUnits.Units.LengthUnit;
using Line = Rhino.Geometry.Line;
using Polyline = Rhino.Geometry.Polyline;

namespace GsaGH.Parameters {
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions GsaGHTests/1_BaseParameters/2_Geometry/GsaElement2dTest.cs
Expand Up @@ -10,6 +10,7 @@
using Rhino.Geometry;
using Xunit;
using LengthUnit = OasysUnits.Units.LengthUnit;
using Polyline = Rhino.Geometry.Polyline;

namespace GsaGHTests.Parameters {
[Collection("GrasshopperFixture collection")]
Expand Down
5 changes: 3 additions & 2 deletions GsaGHTests/1_BaseParameters/2_Geometry/GsaMember2dTest.cs
Expand Up @@ -6,6 +6,7 @@
using Rhino.Geometry;
using Xunit;
using LengthUnit = OasysUnits.Units.LengthUnit;
using Polyline = Rhino.Geometry.Polyline;

namespace GsaGHTests.Parameters {
[Collection("GrasshopperFixture collection")]
Expand All @@ -20,7 +21,7 @@ public class GsaMember2dTest {
new Point3d(-1, 2, 0),
};
pts.Add(pts[0]);
var pol = new Polyline(pts);
var pol = new Rhino.Geometry.Polyline(pts);
Brep brep = Brep.CreatePlanarBreps(pol.ToNurbsCurve(), 0.001)[0];

var inclpts = new Point3dList();
Expand Down Expand Up @@ -127,7 +128,7 @@ public class GsaMember2dTest {
new Point3d(2, 4, 0),
};
pts2.Add(pts2[0]);
var pol2 = new Polyline(pts2);
var pol2 = new Rhino.Geometry.Polyline(pts2);
Brep brep2 = Brep.CreatePlanarBreps(pol2.ToNurbsCurve(), 0.001)[0];

original.UpdateGeometry(brep2);
Expand Down
4 changes: 2 additions & 2 deletions build-test-deploy.yml
Expand Up @@ -74,8 +74,8 @@ steps:
MSBUILDDISABLENODEREUSE: 1

- powershell: |
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.0\build --results-directory .\results\gsagh .\GsaGHTests\bin\x64\Release\net48\GsaGHTests.dll
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.0\build --results-directory .\results\integration .\IntegrationTests\bin\x64\Release\net48\IntegrationTests.dll
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.2\build --results-directory .\results\gsagh .\GsaGHTests\bin\x64\Release\net48\GsaGHTests.dll
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.2\build --results-directory .\results\integration .\IntegrationTests\bin\x64\Release\net48\IntegrationTests.dll
displayName: dotnet tests
failOnStderr: true

Expand Down
4 changes: 2 additions & 2 deletions build-test-nightly.yml
Expand Up @@ -76,8 +76,8 @@ steps:
MSBUILDDISABLENODEREUSE: 1

- powershell: |
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.0\build --results-directory .\results\gsagh .\GsaGHTests\bin\x64\Release\net48\GsaGHTests.dll
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.0\build --results-directory .\results\integration .\IntegrationTests\bin\x64\Release\net48\IntegrationTests.dll
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.2\build --results-directory .\results\gsagh .\GsaGHTests\bin\x64\Release\net48\GsaGHTests.dll
dotnet test --collect:"XPlat Code Coverage" /TestAdapterPath:$env:UserProfile\.nuget\packages\coverlet.collector\6.0.2\build --results-directory .\results\integration .\IntegrationTests\bin\x64\Release\net48\IntegrationTests.dll
displayName: dotnet tests
failOnStderr: true

Expand Down

0 comments on commit 148ef66

Please sign in to comment.