mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
98b098cbce
(the following is the original commit message) Since from this point on, no breaking changes will be done to the graph It's possible to finalize the layout. Meaning that from this point onwards the logical positions of the nodes remain unchanged. Having this guarantee we can proceed to calculating their real positions, starting from the horizontal coordinates.
17 lines
457 B
C++
17 lines
457 B
C++
/// \file LayoutConversion.cpp
|
|
/// \brief
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "Layout.h"
|
|
|
|
LayoutContainer convertToLayout(const LayerContainer &Layers) {
|
|
LayoutContainer Result;
|
|
for (size_t Index = 0; Index < Layers.size(); ++Index)
|
|
for (size_t NodeIndex = 0; NodeIndex < Layers[Index].size(); ++NodeIndex)
|
|
Result[Layers[Index][NodeIndex]] = { Index, NodeIndex };
|
|
return Result;
|
|
}
|