Open
Graph Drawing
Framework

 v.2012.05
 

Attraction.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  
00043 #ifdef _MSC_VER
00044 #pragma once
00045 #endif
00046 
00047 #ifndef OGDF_ATTRACTION_H
00048 #define OGDF_ATTRACTION_H
00049 
00050 
00052 #define MULTIPLIER 2.0
00053 
00054 #include <ogdf/internal/energybased/NodePairEnergy.h>
00055 
00056 namespace ogdf {
00057 
00058 
00060 
00068 class Attraction: public NodePairEnergy {
00069 public:
00070         //Initializes data structures to speed up later computations
00071         Attraction(GraphAttributes &AG);
00072         ~Attraction() {}
00074         void setPreferredEdgelength(double l) {m_preferredEdgeLength = l;}
00076         void reinitializeEdgeLength(double multi);
00077 #ifdef OGDF_DEBUG
00078         void printInternalData() const;
00079 #endif
00080 private:
00082     double m_preferredEdgeLength; 
00084     double computeCoordEnergy(node,node, const DPoint&, const DPoint &) const;
00085 };
00086 
00087 }// namespace ogdf
00088 
00089 #endif