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

fix(civil3d): uses basecurves as display value when no display value exists #321

Merged
merged 2 commits into from
Oct 24, 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
Expand Up @@ -31,7 +31,7 @@ IConverterSettingsStore<Civil3dConversionSettings> converterSettings
_converterSettings = converterSettings;
}

public List<Base> GetDisplayValue(CDB.Entity entity)
public List<Base>? GetDisplayValue(CDB.Entity entity)
{
switch (entity)
{
Expand All @@ -56,7 +56,7 @@ public List<Base> GetDisplayValue(CDB.Entity entity)
return new() { gridSurfaceMesh };

default:
return new();
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ public Base Convert(CDB.Entity target)
civilObject["baseCurves"] = baseCurves;
}

// extract display value
List<Base> display = _displayValueExtractor.GetDisplayValue(target);
if (display.Count > 0)
// extract display value.
// If object has no display but has basecurves, use basecurves for display instead (for viewer selection)
List<Base>? display = _displayValueExtractor.GetDisplayValue(target) ?? baseCurves?.Select(o => (Base)o).ToList();
if (display is not null)
{
civilObject["displayValue"] = display;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ CDB.FeatureLineCollection featurelineCollection in offsetFeaturelineCollection.F
};
speedsCount++;
}
designCriteriaDict["Design Speeds"] = designSpeedsDict;

if (designSpeedsDict.Count > 0)
{
designCriteriaDict["Design Speeds"] = designSpeedsDict;
Expand Down
Loading