Skip to content

Commit

Permalink
plugins/OGDFTileToRowsPacking: Ensure to import edge bends from talipot
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
anlambert committed Jul 17, 2024
1 parent f2f5da3 commit 5e25730
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion library/talipot-ogdf/include/talipot/OGDFLayoutPluginBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions library/talipot-ogdf/src/OGDFLayoutPluginBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/layout/OGDF/OGDFTileToRowsPacking.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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<SameLayout>(context)) {}
: OGDFLayoutPluginBase(context, tlp::getOGDFLayoutModule<SameLayout>(context), true) {}
};

PLUGIN(OGDFTileToRowsPacking)

0 comments on commit 5e25730

Please sign in to comment.