00001 /* 00002 * $Revision: 2299 $ 00003 * 00004 * last checkin: 00005 * $Author: gutwenger $ 00006 * $Date: 2012-05-07 15:57:08 +0200 (Mon, 07 May 2012) $ 00007 ***************************************************************/ 00008 00042 #ifdef _MSC_VER 00043 #pragma once 00044 #endif 00045 00046 #ifndef OGDF_COMPONENT_SPLITTER_LAYOUT_H 00047 #define OGDF_COMPONENT_SPLITTER_LAYOUT_H 00048 00049 #include <ogdf/basic/ModuleOption.h> 00050 #include <ogdf/internal/energybased/MultilevelGraph.h> 00051 #include <ogdf/module/CCLayoutPackModule.h> 00052 #include <ogdf/module/LayoutModule.h> 00053 #include <ogdf/basic/geometry.h> 00054 #include <ogdf/basic/GraphAttributes.h> 00055 #include <vector> 00056 00057 00058 namespace ogdf { 00059 00060 class OGDF_EXPORT ComponentSplitterLayout : public LayoutModule 00061 { 00062 private: 00063 ModuleOption<LayoutModule> m_secondaryLayout; 00064 ModuleOption<CCLayoutPackModule> m_packer; 00065 00066 // keeps a list of nodes for each connected component, 00067 // up to date only in call method 00068 Array<List<node> > nodesInCC; 00069 int m_numberOfComponents; 00070 double m_targetRatio; 00071 int m_minDistCC; 00072 int m_rotatingSteps; 00073 int m_border; 00074 00078 void reassembleDrawings(GraphAttributes &GA); 00079 00080 public: 00081 ComponentSplitterLayout(); 00082 00083 void call(GraphAttributes &GA); 00084 00085 void setLayoutModule(LayoutModule *layout) { 00086 m_secondaryLayout.set(layout); 00087 } 00088 00089 void setPacker(CCLayoutPackModule *packer) { 00090 m_packer.set(packer); 00091 } 00092 }; 00093 00094 } // namespace ogdf 00095 00096 #endif