Open
Graph Drawing
Framework

 v.2012.05
 

EmbedKey.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 
00049 
00050 #ifndef OGDF_EMBED_KEY_H
00051 #define OGDF_EMBED_KEY_H
00052 
00053 #include <ogdf/internal/planarity/PQNodeKey.h>
00054 
00055 namespace ogdf{
00056 
00057 
00058 class EmbedPQTree;
00059 class embedKey;
00060 
00061 
00062 class indInfo
00063 {
00064     friend class EmbedPQTree;
00065     friend class embedKey;
00066 
00067 public:
00068     indInfo(node w) { v = w; changeDir = false; }
00069     ~indInfo() { }
00070 
00071     void resetAssociatedNode(node w) { v = w; }
00072     node getAssociatedNode() { return v; }
00073 
00074 private:
00075     node v;
00076     bool changeDir;
00077 
00078 
00079    OGDF_NEW_DELETE
00080 };
00081 
00082 
00083 class embedKey : public PQNodeKey<edge,indInfo*,bool>
00084 {
00085 public: 
00086     
00087     embedKey(indInfo* i) : PQNodeKey<edge,indInfo*,bool>(i) { }
00088 
00089     virtual ~embedKey() { }
00090 
00091     const char* print() {
00092         if (!m_printString) 
00093             m_printString = new char[128]; 
00094         int sId = m_userStructInfo->v->index();
00095         ogdf::sprintf(m_printString, 128, " Indicator %d", sId);
00096         return m_printString;
00097     }
00098 };
00099 
00100 }
00101 #endif