mapstorage.cc
changeset 198 d6cc0579b94b
parent 195 125c56c1efda
child 199 128195bbab73
equal deleted inserted replaced
33:8148b8570330 34:d035a628ffa5
   589 void MapStorage::setBackgroundScaling(double scaling)
   589 void MapStorage::setBackgroundScaling(double scaling)
   590 {
   590 {
   591   background_scaling = scaling;
   591   background_scaling = scaling;
   592 }
   592 }
   593 
   593 
   594 void MapStorage::exportGraphToEPS(std::vector<bool> options, std::string filename)
   594 void MapStorage::exportGraphToEPS(std::vector<bool> options, std::string filename, std::string shapemap)
   595 {
   595 {
       
   596   Graph::NodeMap<int> _shapes(graph, 0);
   596   Graph::NodeMap<int> _nodeColors(graph, 0);
   597   Graph::NodeMap<int> _nodeColors(graph, 0);
   597   Graph::EdgeMap<int> _edgeColors(graph, 0);
   598   Graph::EdgeMap<int> _edgeColors(graph, 0);
   598   Graph::NodeMap<double> _nodeSizes(graph, 6.0);
   599   Graph::NodeMap<double> _nodeSizes(graph, 6.0);
   599   Graph::EdgeMap<double> _edgeWidths(graph, 1.0);
   600   Graph::EdgeMap<double> _edgeWidths(graph, 1.0);
   600   bool _drawArrows=options[ARROWS];
   601   bool _drawArrows=options[ARROWS];
   640 	    {
   641 	    {
   641 	      _edgeColors[ei]=(int)((*(edgemap_storage[active_edgemaps[E_COLOR]]))[ei]);
   642 	      _edgeColors[ei]=(int)((*(edgemap_storage[active_edgemaps[E_COLOR]]))[ei]);
   642 	    }
   643 	    }
   643 	}
   644 	}
   644     }
   645     }
       
   646   if(shapemap!="")
       
   647     {
       
   648       if((minOfNodeMap(shapemap)>=0)&&(maxOfNodeMap(shapemap)<=4))
       
   649 	{
       
   650 	  _shapes=*(nodemap_storage[shapemap]);
       
   651 	}
       
   652     }
   645 
   653 
   646   Palette palette;
   654   Palette palette;
   647   Palette paletteW(true);
   655   Palette paletteW(true);
   648 
   656 
   649   graphToEps(graph,filename).
   657   graphToEps(graph,filename).
   650     title("Sample .eps figure (fits to A4)").
   658     title("Sample .eps figure (fits to A4)").
   651     copyright("(C) 2006 LEMON Project").
   659     copyright("(C) 2006 LEMON Project").
   652     absoluteNodeSizes().absoluteEdgeWidths().
   660     absoluteNodeSizes().absoluteEdgeWidths().
   653     nodeScale(2).nodeSizes(_nodeSizes).
   661     nodeScale(2).nodeSizes(_nodeSizes).
   654     coords(coords).
   662     coords(coords).
       
   663     nodeShapes(_shapes).
   655     nodeColors(composeMap(paletteW,_nodeColors)).
   664     nodeColors(composeMap(paletteW,_nodeColors)).
   656     edgeColors(composeMap(palette,_edgeColors)).
   665     edgeColors(composeMap(palette,_edgeColors)).
   657     edgeWidthScale(0.3).edgeWidths(_edgeWidths).
   666     edgeWidthScale(0.3).edgeWidths(_edgeWidths).
   658     nodeTexts(_nodeTextMap).nodeTextSize(7).
   667     nodeTexts(_nodeTextMap).nodeTextSize(7).
   659     enableParallel(_enableParallel).parEdgeDist(4).
   668     enableParallel(_enableParallel).parEdgeDist(5).
   660     drawArrows(_drawArrows).arrowWidth(7).arrowLength(7).
   669     drawArrows(_drawArrows).arrowWidth(7).arrowLength(7).
   661     run();
   670     run();
   662 
   671 
   663 }
   672 }