private void addToShearMomentDiagram(AbstractCase ac, LineElement line, float[,] controlPoints, LineForceComponent component, float scale)
{
if (ac == null) return;
if (ac is LoadCombination)
{
foreach (AbstractCaseFactor acf in ((LoadCombination)ac).Cases)
addToShearMomentDiagram(acf.Case, line, controlPoints, component, acf.Factor);
}
else if (ac is AnalysisCase)
{
if (((AnalysisCase)ac).Properties is StaticCaseProps)
{
foreach (StaticCaseFactor staticCase in ((StaticCaseProps)((AnalysisCase)ac).Properties).Loads)
{
if (staticCase.AppliedLoad is LoadCase)
{
LoadCase lc = staticCase.AppliedLoad as LoadCase;
if (line.Loads[lc] != null)
{
foreach (Load load in line.Loads[lc])
if (load is DirectionalLineLoad)
addToShearMomentDiagram(line, load as DirectionalLineLoad, controlPoints, component, scale);
}
if (lc.SelfWeight > 0f)
{
if (line.Properties is StraightFrameProps)
{
StraightFrameProps frameProps = line.Properties as StraightFrameProps;
selfWeight.La = selfWeight.Lb = frameProps.Section.Area * frameProps.Section.Material.UnitWeight;
addToShearMomentDiagram(line, selfWeight, controlPoints, component, lc.SelfWeight * scale);
}
}
}
}
}
}
}