int main(int argc, char **argv) { Graph g; GraphAttributes ga(g); if (!GraphIO::readGML(ga, g, "uk_Pack_Bary_EC_FRENC.gml")) { cerr << "Could not load Graph" << endl; return 1; } node v; forall_nodes(v, g) { ga.width(v) = ga.height(v) = 10.0; } MultilevelGraph mlg(ga); FastMultipoleEmbedder *fme = new ogdf::FastMultipoleEmbedder(); fme->setNumIterations(1000); fme->setRandomize(false); LocalBiconnectedMerger *lbcm = new ogdf::LocalBiconnectedMerger(); lbcm->setFactor(2.0); lbcm->setEdgeLengthAdjustment(0); BarycenterPlacer *bp = new ogdf::BarycenterPlacer(); bp->weightedPositionPriority(true); ScalingLayout *sl = new ogdf::ScalingLayout(); sl->setExtraScalingSteps(1); sl->setScaling(5.0, 10.0); sl->setScalingType(ogdf::ScalingLayout::st_relativeToDesiredLength); sl->setSecondaryLayout(fme); sl->setLayoutRepeats(1); ModularMultilevelMixer *mmm = new ModularMultilevelMixer; mmm->setLayoutRepeats(1); mmm->setLevelLayoutModule(sl); mmm->setInitialPlacer(bp); mmm->setMultilevelBuilder(lbcm); TileToRowsCCPacker *ttrccp = new TileToRowsCCPacker; ComponentSplitterLayout *cs = new ComponentSplitterLayout; cs->setPacker(ttrccp); cs->setLayoutModule(mmm); PreprocessorLayout ppl; ppl.setLayoutModule(cs); ppl.setRandomizePositions(true); ppl.call(mlg); mlg.exportAttributes(ga); GraphIO::writeGML(ga, "uk_Pack_Bary_EC_FRENC-mmmnotwist.gml"); }
int main(int argc, char **argv) { Graph g; GraphAttributes ga(g); if (!GraphIO::readGML(ga, g, "uk_Pack_Bary_EC_FRENC.gml")) { cerr << "Could not load Graph" << endl; return 1; } for (node v : g.nodes) ga.width(v) = ga.height(v) = 10.0; MultilevelGraph mlg(ga); FastMultipoleEmbedder *fme = new ogdf::FastMultipoleEmbedder(); fme->setNumIterations(1000); fme->setRandomize(false); SolarMerger *sm = new ogdf::SolarMerger(false, false); SolarPlacer *sp = new ogdf::SolarPlacer(); ScalingLayout *sl = new ogdf::ScalingLayout(); sl->setExtraScalingSteps(0); sl->setScaling(2.0, 2.0); sl->setScalingType(ogdf::ScalingLayout::st_relativeToDrawing); sl->setSecondaryLayout(fme); sl->setLayoutRepeats(1); ModularMultilevelMixer *mmm = new ModularMultilevelMixer; mmm->setLayoutRepeats(1); mmm->setLevelLayoutModule(sl); mmm->setInitialPlacer(sp); mmm->setMultilevelBuilder(sm); TileToRowsCCPacker *ttrccp = new TileToRowsCCPacker; ComponentSplitterLayout *cd = new ComponentSplitterLayout; cd->setPacker(ttrccp); cd->setLayoutModule(mmm); PreprocessorLayout ppl; ppl.setLayoutModule(cd); ppl.setRandomizePositions(true); ppl.call(mlg); mlg.exportAttributes(ga); GraphIO::writeGML(ga, "uk_Pack_Bary_EC_FRENC-mmmfast.gml"); }
void MMMExampleNoTwistLayout::call(MultilevelGraph &MLG) { // Fast Multipole Embedder FastMultipoleEmbedder * FME = new FastMultipoleEmbedder(); FME->setNumIterations(1000); FME->setRandomize(false); // Local Biconnected Merger LocalBiconnectedMerger * LBCM = new LocalBiconnectedMerger(); LBCM->setFactor(2.0); LBCM->setEdgeLengthAdjustment(0); // BEFORE (but arg is int!): LBCM->setEdgeLengthAdjustment(0.1); // Barycenter Placer with weighted Positions BarycenterPlacer * BP = new BarycenterPlacer(); BP->weightedPositionPriority(true); // No Scaling ScalingLayout *SL = new ScalingLayout(); SL->setExtraScalingSteps(1); SL->setScaling(5.0, 10.0); SL->setScalingType(ScalingLayout::st_relativeToDesiredLength); SL->setSecondaryLayout(FME); SL->setLayoutRepeats(1); ModularMultilevelMixer *MMM = new ModularMultilevelMixer; MMM->setLayoutRepeats(1); // MMM->setAllEdgeLenghts(5.0); // MMM->setAllNodeSizes(1.0); MMM->setLevelLayoutModule(SL); MMM->setInitialPlacer(BP); MMM->setMultilevelBuilder(LBCM); ComponentSplitterLayout *CS = new ComponentSplitterLayout; CS->setLayoutModule(MMM); PreprocessorLayout PPL; PPL.setLayoutModule(CS); PPL.setRandomizePositions(true); PPL.call(MLG); }
void MMMExampleFastLayout::call(MultilevelGraph &MLG) { // Fast Multipole Embedder FastMultipoleEmbedder *FME = new FastMultipoleEmbedder(); FME->setNumIterations(1000); FME->setRandomize(false); // Solar Merger SolarMerger * SM = new SolarMerger(false, false); // Solar Placer SolarPlacer * SP = new SolarPlacer(); // No Scaling ScalingLayout * SL = new ScalingLayout(); SL->setExtraScalingSteps(0); SL->setScaling(2.0, 2.0); SL->setScalingType(ScalingLayout::st_relativeToDrawing); SL->setSecondaryLayout(FME); SL->setLayoutRepeats(1); ModularMultilevelMixer *MMM = new ModularMultilevelMixer; MMM->setLayoutRepeats(1); // MMM->setAllEdgeLenghts(5.0); // MMM->setAllNodeSizes(1.0); MMM->setLevelLayoutModule(SL); MMM->setInitialPlacer(SP); MMM->setMultilevelBuilder(SM); ComponentSplitterLayout *CS = new ComponentSplitterLayout; CS->setLayoutModule(MMM); PreprocessorLayout PPL; PPL.setLayoutModule(CS); PPL.setRandomizePositions(true); PPL.call(MLG); }