Skip to content

Commit

Permalink
adds basecurves as display value when no display value exists (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
clairekuang authored Oct 24, 2024
1 parent 6d37531 commit 3088fae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
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

0 comments on commit 3088fae

Please sign in to comment.