From 5e25730a6f3962eca3f7baf4f637d9d57537ea8f Mon Sep 17 00:00:00 2001 From: Antoine Lambert Date: Mon, 17 Jun 2024 20:44:48 +0200 Subject: [PATCH] plugins/OGDFTileToRowsPacking: Ensure to import edge bends from talipot Now that the layout algorithms from OGDF to draw and pack connected components have gained support for preserving edge bends, we can import then from the talipot graph drawing to pack with that algorithm. --- library/talipot-ogdf/include/talipot/OGDFLayoutPluginBase.h | 3 ++- library/talipot-ogdf/src/OGDFLayoutPluginBase.cpp | 4 ++-- plugins/layout/OGDF/OGDFTileToRowsPacking.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/library/talipot-ogdf/include/talipot/OGDFLayoutPluginBase.h b/library/talipot-ogdf/include/talipot/OGDFLayoutPluginBase.h index e871871590..3511d6cfee 100644 --- a/library/talipot-ogdf/include/talipot/OGDFLayoutPluginBase.h +++ b/library/talipot-ogdf/include/talipot/OGDFLayoutPluginBase.h @@ -33,7 +33,8 @@ static inline OGDFLayoutModule *getOGDFLayoutModule(const PluginContext *context class TLP_OGDF_SCOPE OGDFLayoutPluginBase : public LayoutAlgorithm { public: - OGDFLayoutPluginBase(const PluginContext *context, ogdf::LayoutModule *ogdfLayoutAlgo); + OGDFLayoutPluginBase(const PluginContext *context, ogdf::LayoutModule *ogdfLayoutAlgo, + bool importEdgeBends = false); ~OGDFLayoutPluginBase() override; bool run() override; diff --git a/library/talipot-ogdf/src/OGDFLayoutPluginBase.cpp b/library/talipot-ogdf/src/OGDFLayoutPluginBase.cpp index 9db04f66a5..3924a33922 100644 --- a/library/talipot-ogdf/src/OGDFLayoutPluginBase.cpp +++ b/library/talipot-ogdf/src/OGDFLayoutPluginBase.cpp @@ -22,12 +22,12 @@ using namespace std; using namespace tlp; OGDFLayoutPluginBase::OGDFLayoutPluginBase(const PluginContext *context, - ogdf::LayoutModule *ogdfLayoutAlgo) + ogdf::LayoutModule *ogdfLayoutAlgo, bool importEdgeBends) : LayoutAlgorithm(context), tlpToOGDF(nullptr), ogdfLayoutAlgo(ogdfLayoutAlgo), simpleCCPacker(ogdfLayoutAlgo ? new ogdf::SimpleCCPacker(ogdfLayoutAlgo) : nullptr) { // convert Tulip Graph to OGDF Graph including attributes if (graph) { - tlpToOGDF = new TalipotToOGDF(graph, false); + tlpToOGDF = new TalipotToOGDF(graph, importEdgeBends); } } diff --git a/plugins/layout/OGDF/OGDFTileToRowsPacking.cpp b/plugins/layout/OGDF/OGDFTileToRowsPacking.cpp index c83cdcfcf0..4d8f6b40e0 100644 --- a/plugins/layout/OGDF/OGDFTileToRowsPacking.cpp +++ b/plugins/layout/OGDF/OGDFTileToRowsPacking.cpp @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2019-2021 The Talipot developers + * Copyright (C) 2019-2024 The Talipot developers * * Talipot is a fork of Tulip, created by David Auber * and the Tulip development Team from LaBRI, University of Bordeaux @@ -29,7 +29,7 @@ class OGDFTileToRowsPacking : public tlp::OGDFLayoutPluginBase { "1.0", "Misc") OGDFTileToRowsPacking(const tlp::PluginContext *context) // OGDFLayoutPluginBase wraps call to ogdf::ComponentSplitterLayout - : OGDFLayoutPluginBase(context, tlp::getOGDFLayoutModule(context)) {} + : OGDFLayoutPluginBase(context, tlp::getOGDFLayoutModule(context), true) {} }; PLUGIN(OGDFTileToRowsPacking)