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 00043 #ifdef _MSC_VER 00044 #pragma once 00045 #endif 00046 00047 #ifndef OGDF_PREPROCESSOR_LAYOUT_H 00048 #define OGDF_PREPROCESSOR_LAYOUT_H 00049 00050 00051 #include <ogdf/basic/ModuleOption.h> 00052 #include <ogdf/module/MultilevelLayoutModule.h> 00053 00054 00055 namespace ogdf { 00056 00057 00067 class OGDF_EXPORT PreprocessorLayout : public MultilevelLayoutModule 00068 { 00069 private: 00075 struct EdgeData 00076 { 00077 EdgeData(int edgeIndex, int sourceIndex, int targetIndex, double weight) 00078 :edgeIndex(edgeIndex), sourceIndex(sourceIndex), targetIndex(targetIndex), weight(weight) 00079 {}; 00080 00081 int edgeIndex; 00082 int sourceIndex; 00083 int targetIndex; 00084 double weight; 00085 }; 00086 00087 ModuleOption<LayoutModule> m_secondaryLayout; 00088 std::vector<EdgeData> m_deletedEdges; 00089 bool m_randomize; 00090 00091 void call(Graph &G, MultilevelGraph &MLG); 00092 00093 public: 00094 00096 PreprocessorLayout(); 00097 00099 ~PreprocessorLayout() { } 00100 00101 00103 void call(MultilevelGraph &MLG); 00104 00106 void call(GraphAttributes &GA); 00107 00109 void setLayoutModule(LayoutModule *layout) { 00110 m_secondaryLayout.set(layout); 00111 } 00112 00114 void setRandomizePositions(bool on) { 00115 m_randomize = on; 00116 } 00117 }; 00118 00119 00120 } // namespace ogdf 00121 00122 #endif