Open
Graph Drawing
Framework

 v.2012.05
 

Planarity.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  
00045 #ifdef _MSC_VER
00046 #pragma once
00047 #endif
00048 
00049 #ifndef OGDF_PLANARITY_H
00050 #define OGDF_PLANARITY_H
00051 
00052 
00053 #include <ogdf/internal/energybased/EnergyFunction.h>
00054 #include <ogdf/basic/Array2D.h>
00055 
00056 
00057 namespace ogdf {
00058 
00059 
00060 class Planarity: public EnergyFunction {
00061 public: 
00063     Planarity(GraphAttributes &AG);
00064 
00065     ~Planarity();
00066 
00068     void computeEnergy();
00069 
00070 private:
00071     struct ChangedCrossing {
00072         int edgeNum1;
00073         int edgeNum2;
00074         bool cross;
00075     };
00076 
00078     bool intersect(const edge, const edge) const;
00079 
00081     void compCandEnergy();
00082 
00084     void internalCandidateTaken();
00085 
00087     void clearCandidateCrossings();
00088 
00090     bool lowLevelIntersect( const DPoint&, const DPoint&, const DPoint&,
00091          const DPoint&) const;
00092 
00093 #ifdef OGDF_DEBUG
00094         virtual void printInternalData() const;
00095 #endif
00096 
00097     EdgeArray<int> *m_edgeNums; 
00098     Array2D<bool> *m_crossingMatrix; 
00099 
00104     List<ChangedCrossing> m_crossingChanges; 
00105 
00106     List<edge> m_nonSelfLoops; 
00107 }; // class Planarity
00108 
00109 
00110 }// namespace ogdf
00111 
00112 #endif