private List<DenavitHartenbergModel> GetAllModels(DenavitHartenbergNode model,
List<DenavitHartenbergModel> models)
{
// If it's the first call
if (models == null)
{
// Create the models list
models = new List<DenavitHartenbergModel>();
}
// Add the model contained in the ModelCombinator
models.Add(model.Model);
// For all the children of the ModelCombinator
foreach (DenavitHartenbergNode child in model.Children)
{
// Execute recursively this function
models = GetAllModels(child, models);
}
// Return the models list
return models;
}