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

GSAGH-488-Add-displacements-to-ResultDiagrams #671

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion GsaGH/Components/3_Loads/CreateGridAreaLoad.cs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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