ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/outil/src/HypergraphLib_Neato.cpp
Revision: 113
Committed: Wed Jun 25 18:44:12 2008 UTC (16 years, 10 months ago) by francois
Original Path: magic/lib/outil/outil/src/HypergraphLib_Neato.cpp
File size: 1934 byte(s)
Error occurred while calculating annotation data.
Log Message:
pb de compatibilite windows apres le passage linux de hypergraph

File Contents

# Content
1 #include "gestionversion.h"
2 #ifdef WINDOWS_VERSION
3 #include <iostream>
4 #include <sstream>
5
6 #pragma hdrstop
7
8 #include "HypergraphLib_platform.h"
9
10 #include "HypergraphLib_Neato.h"
11 #include "HypergraphLib_Graph.h"
12 #include "HypergraphLib_Arc.h"
13 #include "HypergraphLib_Node.h"
14
15
16
17 std::string NeatoGraph(const HypergraphLib::Graph & __G)
18 {/*
19 std::cout << "graph 1 { ";
20 std::cout << "node [ color = red ]\n";
21 std::cout << std::endl;
22 for (HypergraphLib::Graph::MapArcsById::const_iterator it=__G.GetArcs().begin();
23 it != __G.GetArcs().end(); it++)
24 {
25 std::cout << "A_"<<it->first <<"[ shape=plaintext, style=filled, fillcolor=white , width=.3, height=.3 , color=black]"<<std::endl ;
26 for (HypergraphLib::Arc::MultimapNodesById::const_iterator it2=it->second->Nodes().begin();
27 it2!=it->second->Nodes().end();it2++)
28 {
29 std::cout<< "N_"<<it2->first << " -- " << "A_"<<it->first <<" [ len=1.2 ]"<<std::endl;
30 }
31 std::cout << std::endl;
32 }
33 std::cout << std::endl;
34 std::cout << "}";
35 std::cout << std::endl;
36 */
37
38 std::ostringstream result;
39 result << "graph 2 { ";
40 result << std::endl;
41 result << "node [ color = red ]\n";
42 result << std::endl;
43 for (HypergraphLib::Graph::MapNodesById::const_iterator it=__G.GetNodes().begin();
44 it != __G.GetNodes().end(); it++)
45 {
46 for (HypergraphLib::Node::MultimapArcsById::const_iterator it2=it->second->IncidentArcs().begin();
47 it2!=it->second->IncidentArcs().end();it2++)
48 {
49 result <<"A_"<<it2->first << " [ shape=plaintext, style=filled, fillcolor=white , width=.3, height=.3 , color=black ]" << std::endl;
50 result<< "A_"<<it2->first << " -- " << "N_"<<it->first <<"[len=1.2]"<<std::endl;
51 }
52 result << std::endl;
53 }
54 result << std::endl;
55 result << "}";
56 result << std::endl;
57 result << std::endl;
58 return result.str();
59 } #endif
60