Skip to content
Snippets Groups Projects
Commit 6ac52aff authored by Fabian Tërnava's avatar Fabian Tërnava
Browse files

fix code generation for dynamic matrix types

parent a4fff241
No related branches found
No related tags found
No related merge requests found
Pipeline #16845 passed
......@@ -69,7 +69,11 @@ namespace armarx::aron::codegenerator::cpp::generator
std::pair<std::vector<std::pair<std::string, std::string>>, bool>
Matrix::getCtorInitializers(const std::string& name) const
{
if (type.getDefaultValue() == aron::type::matrix::default_value::IDENTITY)
if (type.getCols() == -1 || type.getRows() == -1)
{
return {{}, false};
}
else if (type.getDefaultValue() == aron::type::matrix::default_value::IDENTITY)
{
return {{{name, getInstantiatedCppTypename() + "::Identity()"}}, true};
}
......@@ -94,7 +98,12 @@ namespace armarx::aron::codegenerator::cpp::generator
{
CppBlockPtr block_if_data = std::make_shared<CppBlock>();
if (type.getDefaultValue() == aron::type::matrix::default_value::IDENTITY)
if (type.getCols() == -1 || type.getRows() == -1)
{
block_if_data->addLine(cppAccessor + " = " + getInstantiatedCppTypename() + "();");
}
else if (type.getDefaultValue() == aron::type::matrix::default_value::IDENTITY)
{
block_if_data->addLine(cppAccessor + " = " + getInstantiatedCppTypename() + "::Identity();");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment