Open
Graph Drawing
Framework

 v.2012.05
 

ForceLayoutModule.h
Go to the documentation of this file.
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 
00044 #ifdef _MSC_VER
00045 #pragma once
00046 #endif
00047 
00048 #ifndef OGDF_FORCE_LAYOUT_MODULE_H
00049 #define OGDF_FORCE_LAYOUT_MODULE_H
00050 
00051 
00052 
00053 #include <ogdf/basic/GraphAttributes.h>
00054 #include <ogdf/module/LayoutModule.h>
00055 #include <ogdf/internal/energybased/MultilevelGraph.h>
00056 
00057 namespace ogdf {
00058 
00059 
00064 class OGDF_EXPORT ForceLayoutModule : public LayoutModule {
00065     // holds index of the current level in multilevel hierarchy
00066     int m_currentLevel; 
00067 public:
00069     ForceLayoutModule() { }
00070 
00071     virtual ~ForceLayoutModule() { }
00072 virtual void call(GraphAttributes &GA) = 0;
00095     virtual void call(MultilevelGraph &MLG) {
00096                 m_currentLevel = MLG.getLevel();
00097         GraphAttributes GA(MLG.getGraph());
00098         MLG.exportAttributesSimple(GA);
00099         call(GA);
00100         MLG.importAttributesSimple(GA);
00101     };
00102 
00103     OGDF_MALLOC_NEW_DELETE
00104 };
00105 
00106 
00107 } // end namespace ogdf
00108 
00109 
00110 #endif