Skip to content
Snippets Groups Projects
Commit 21a27de1 authored by Gennady Pospelov's avatar Gennady Pospelov
Browse files

Simplify functions by using new getters/setters

parent 2e8276fb
No related branches found
No related tags found
No related merge requests found
......@@ -49,20 +49,16 @@ int SessionItemUtils::ParentRow(const SessionItem& item)
kvector_t SessionItemUtils::GetVectorItem(const SessionItem& item, const QString& name)
{
SessionItem* vectorItem = item.getItem(name);
ASSERT(vectorItem);
double x = vectorItem->getItemValue(VectorItem::P_X).toDouble();
double y = vectorItem->getItemValue(VectorItem::P_Y).toDouble();
double z = vectorItem->getItemValue(VectorItem::P_Z).toDouble();
return {x, y, z};
auto& vectorItem = item.item<VectorItem>(name);
return {vectorItem.x(), vectorItem.y(), vectorItem.z()};
}
void SessionItemUtils::SetVectorItem(const SessionItem& item, const QString& name, kvector_t value)
{
auto p_vector_item = item.getItem(name);
p_vector_item->setItemValue(VectorItem::P_X, value.x());
p_vector_item->setItemValue(VectorItem::P_Y, value.y());
p_vector_item->setItemValue(VectorItem::P_Z, value.z());
auto& vectorItem = item.item<VectorItem>(name);
vectorItem.setX(value.x());
vectorItem.setY(value.y());
vectorItem.setZ(value.z());
}
int SessionItemUtils::ParentVisibleRow(const SessionItem& item)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment