| ... |
... |
@@ -60,13 +60,13 @@
|
| 60 |
60 |
Value operator[](Key n) { return Value(map[n].x,map[n].y*yscale);}
|
| 61 |
61 |
};
|
| 62 |
62 |
}
|
| 63 |
63 |
|
| 64 |
64 |
///Default traits class of \ref GraphToEps
|
| 65 |
65 |
|
| 66 |
|
///Default traits class of \ref GraphToEps
|
|
66 |
///Default traits class of \ref GraphToEps.
|
| 67 |
67 |
///
|
| 68 |
68 |
///\c G is the type of the underlying graph.
|
| 69 |
69 |
template<class G>
|
| 70 |
70 |
struct DefaultGraphToEpsTraits
|
| 71 |
71 |
{
|
| 72 |
72 |
typedef G Graph;
|
| ... |
... |
@@ -137,18 +137,17 @@
|
| 137 |
137 |
bool _negY;
|
| 138 |
138 |
|
| 139 |
139 |
bool _preScale;
|
| 140 |
140 |
///Constructor
|
| 141 |
141 |
|
| 142 |
142 |
///Constructor
|
| 143 |
|
///\param _g is a reference to the graph to be printed
|
| 144 |
|
///\param _os is a reference to the output stream.
|
| 145 |
|
///\param _os is a reference to the output stream.
|
|
143 |
///\param _g Reference to the graph to be printed.
|
|
144 |
///\param _os Reference to the output stream.
|
|
145 |
///\param _os Reference to the output stream. By default it is <tt>std::cout</tt>.
|
| 146 |
146 |
///\param _pros If it is \c true, then the \c ostream referenced by \c _os
|
| 147 |
147 |
///will be explicitly deallocated by the destructor.
|
| 148 |
|
///By default it is <tt>std::cout</tt>
|
| 149 |
148 |
DefaultGraphToEpsTraits(const G &_g,std::ostream& _os=std::cout,
|
| 150 |
149 |
bool _pros=false) :
|
| 151 |
150 |
g(_g), os(_os),
|
| 152 |
151 |
_coords(dim2::Point<double>(1,1)), _nodeSizes(1), _nodeShapes(0),
|
| 153 |
152 |
_nodeColors(WHITE), _arcColors(BLACK),
|
| 154 |
153 |
_arcWidths(1.0), _arcWidthScale(0.003),
|
| ... |
... |
@@ -170,13 +169,15 @@
|
| 170 |
169 |
_preScale(true)
|
| 171 |
170 |
{}
|
| 172 |
171 |
};
|
| 173 |
172 |
|
| 174 |
173 |
///Auxiliary class to implement the named parameters of \ref graphToEps()
|
| 175 |
174 |
|
| 176 |
|
///Auxiliary class to implement the named parameters of \ref graphToEps()
|
|
175 |
///Auxiliary class to implement the named parameters of \ref graphToEps().
|
|
176 |
///
|
|
177 |
///For detailed examples see the \ref graph_to_eps_demo.cc demo file.
|
| 177 |
178 |
template<class T> class GraphToEps : public T
|
| 178 |
179 |
{
|
| 179 |
180 |
// Can't believe it is required by the C++ standard
|
| 180 |
181 |
using T::g;
|
| 181 |
182 |
using T::os;
|
| 182 |
183 |
|
| ... |
... |
@@ -255,13 +256,13 @@
|
| 255 |
256 |
|
| 256 |
257 |
bool dontPrint;
|
| 257 |
258 |
|
| 258 |
259 |
public:
|
| 259 |
260 |
///Node shapes
|
| 260 |
261 |
|
| 261 |
|
///Node shapes
|
|
262 |
///Node shapes.
|
| 262 |
263 |
///
|
| 263 |
264 |
enum NodeShapes {
|
| 264 |
265 |
/// = 0
|
| 265 |
266 |
///\image html nodeshape_0.png
|
| 266 |
267 |
///\image latex nodeshape_0.eps "CIRCLE shape (0)" width=2cm
|
| 267 |
268 |
CIRCLE=0,
|
| ... |
... |
@@ -332,25 +333,25 @@
|
| 332 |
333 |
const X &_coords;
|
| 333 |
334 |
CoordsTraits(const T &t,const X &x) : T(t), _coords(x) {}
|
| 334 |
335 |
};
|
| 335 |
336 |
///Sets the map of the node coordinates
|
| 336 |
337 |
|
| 337 |
338 |
///Sets the map of the node coordinates.
|
| 338 |
|
///\param x must be a node map with dim2::Point<double> or
|
|
339 |
///\param x must be a node map with \ref dim2::Point "dim2::Point<double>" or
|
| 339 |
340 |
///\ref dim2::Point "dim2::Point<int>" values.
|
| 340 |
341 |
template<class X> GraphToEps<CoordsTraits<X> > coords(const X &x) {
|
| 341 |
342 |
dontPrint=true;
|
| 342 |
343 |
return GraphToEps<CoordsTraits<X> >(CoordsTraits<X>(*this,x));
|
| 343 |
344 |
}
|
| 344 |
345 |
template<class X> struct NodeSizesTraits : public T {
|
| 345 |
346 |
const X &_nodeSizes;
|
| 346 |
347 |
NodeSizesTraits(const T &t,const X &x) : T(t), _nodeSizes(x) {}
|
| 347 |
348 |
};
|
| 348 |
349 |
///Sets the map of the node sizes
|
| 349 |
350 |
|
| 350 |
|
///Sets the map of the node sizes
|
|
351 |
///Sets the map of the node sizes.
|
| 351 |
352 |
///\param x must be a node map with \c double (or convertible) values.
|
| 352 |
353 |
template<class X> GraphToEps<NodeSizesTraits<X> > nodeSizes(const X &x)
|
| 353 |
354 |
{
|
| 354 |
355 |
dontPrint=true;
|
| 355 |
356 |
return GraphToEps<NodeSizesTraits<X> >(NodeSizesTraits<X>(*this,x));
|
| 356 |
357 |
}
|
| ... |
... |
@@ -373,15 +374,15 @@
|
| 373 |
374 |
template<class X> struct NodeTextsTraits : public T {
|
| 374 |
375 |
const X &_nodeTexts;
|
| 375 |
376 |
NodeTextsTraits(const T &t,const X &x) : T(t), _nodeTexts(x) {}
|
| 376 |
377 |
};
|
| 377 |
378 |
///Sets the text printed on the nodes
|
| 378 |
379 |
|
| 379 |
|
///Sets the text printed on the nodes
|
|
380 |
///Sets the text printed on the nodes.
|
| 380 |
381 |
///\param x must be a node map with type that can be pushed to a standard
|
| 381 |
|
///ostream.
|
|
382 |
///\c ostream.
|
| 382 |
383 |
template<class X> GraphToEps<NodeTextsTraits<X> > nodeTexts(const X &x)
|
| 383 |
384 |
{
|
| 384 |
385 |
dontPrint=true;
|
| 385 |
386 |
_showNodeText=true;
|
| 386 |
387 |
return GraphToEps<NodeTextsTraits<X> >(NodeTextsTraits<X>(*this,x));
|
| 387 |
388 |
}
|
| ... |
... |
@@ -390,20 +391,20 @@
|
| 390 |
391 |
NodePsTextsTraits(const T &t,const X &x) : T(t), _nodePsTexts(x) {}
|
| 391 |
392 |
};
|
| 392 |
393 |
///Inserts a PostScript block to the nodes
|
| 393 |
394 |
|
| 394 |
395 |
///With this command it is possible to insert a verbatim PostScript
|
| 395 |
396 |
///block to the nodes.
|
| 396 |
|
///The PS current point will be moved to the centre of the node before
|
|
397 |
///The PS current point will be moved to the center of the node before
|
| 397 |
398 |
///the PostScript block inserted.
|
| 398 |
399 |
///
|
| 399 |
400 |
///Before and after the block a newline character is inserted so you
|
| 400 |
401 |
///don't have to bother with the separators.
|
| 401 |
402 |
///
|
| 402 |
403 |
///\param x must be a node map with type that can be pushed to a standard
|
| 403 |
|
///ostream.
|
|
404 |
///\c ostream.
|
| 404 |
405 |
///
|
| 405 |
406 |
///\sa nodePsTextsPreamble()
|
| 406 |
407 |
template<class X> GraphToEps<NodePsTextsTraits<X> > nodePsTexts(const X &x)
|
| 407 |
408 |
{
|
| 408 |
409 |
dontPrint=true;
|
| 409 |
410 |
_showNodePsText=true;
|
| ... |
... |
@@ -412,13 +413,13 @@
|
| 412 |
413 |
template<class X> struct ArcWidthsTraits : public T {
|
| 413 |
414 |
const X &_arcWidths;
|
| 414 |
415 |
ArcWidthsTraits(const T &t,const X &x) : T(t), _arcWidths(x) {}
|
| 415 |
416 |
};
|
| 416 |
417 |
///Sets the map of the arc widths
|
| 417 |
418 |
|
| 418 |
|
///Sets the map of the arc widths
|
|
419 |
///Sets the map of the arc widths.
|
| 419 |
420 |
///\param x must be an arc map with \c double (or convertible) values.
|
| 420 |
421 |
template<class X> GraphToEps<ArcWidthsTraits<X> > arcWidths(const X &x)
|
| 421 |
422 |
{
|
| 422 |
423 |
dontPrint=true;
|
| 423 |
424 |
return GraphToEps<ArcWidthsTraits<X> >(ArcWidthsTraits<X>(*this,x));
|
| 424 |
425 |
}
|
| ... |
... |
@@ -426,13 +427,13 @@
|
| 426 |
427 |
template<class X> struct NodeColorsTraits : public T {
|
| 427 |
428 |
const X &_nodeColors;
|
| 428 |
429 |
NodeColorsTraits(const T &t,const X &x) : T(t), _nodeColors(x) {}
|
| 429 |
430 |
};
|
| 430 |
431 |
///Sets the map of the node colors
|
| 431 |
432 |
|
| 432 |
|
///Sets the map of the node colors
|
|
433 |
///Sets the map of the node colors.
|
| 433 |
434 |
///\param x must be a node map with \ref Color values.
|
| 434 |
435 |
///
|
| 435 |
436 |
///\sa Palette
|
| 436 |
437 |
template<class X> GraphToEps<NodeColorsTraits<X> >
|
| 437 |
438 |
nodeColors(const X &x)
|
| 438 |
439 |
{
|
| ... |
... |
@@ -442,13 +443,13 @@
|
| 442 |
443 |
template<class X> struct NodeTextColorsTraits : public T {
|
| 443 |
444 |
const X &_nodeTextColors;
|
| 444 |
445 |
NodeTextColorsTraits(const T &t,const X &x) : T(t), _nodeTextColors(x) {}
|
| 445 |
446 |
};
|
| 446 |
447 |
///Sets the map of the node text colors
|
| 447 |
448 |
|
| 448 |
|
///Sets the map of the node text colors
|
|
449 |
///Sets the map of the node text colors.
|
| 449 |
450 |
///\param x must be a node map with \ref Color values.
|
| 450 |
451 |
///
|
| 451 |
452 |
///\sa Palette
|
| 452 |
453 |
template<class X> GraphToEps<NodeTextColorsTraits<X> >
|
| 453 |
454 |
nodeTextColors(const X &x)
|
| 454 |
455 |
{
|
| ... |
... |
@@ -460,13 +461,13 @@
|
| 460 |
461 |
template<class X> struct ArcColorsTraits : public T {
|
| 461 |
462 |
const X &_arcColors;
|
| 462 |
463 |
ArcColorsTraits(const T &t,const X &x) : T(t), _arcColors(x) {}
|
| 463 |
464 |
};
|
| 464 |
465 |
///Sets the map of the arc colors
|
| 465 |
466 |
|
| 466 |
|
///Sets the map of the arc colors
|
|
467 |
///Sets the map of the arc colors.
|
| 467 |
468 |
///\param x must be an arc map with \ref Color values.
|
| 468 |
469 |
///
|
| 469 |
470 |
///\sa Palette
|
| 470 |
471 |
template<class X> GraphToEps<ArcColorsTraits<X> >
|
| 471 |
472 |
arcColors(const X &x)
|
| 472 |
473 |
{
|
| ... |
... |
@@ -484,36 +485,33 @@
|
| 484 |
485 |
/// If both nodeSizes() and autoNodeScale() are used, then the
|
| 485 |
486 |
/// node sizes will be scaled in such a way that the greatest size will be
|
| 486 |
487 |
/// equal to \c d.
|
| 487 |
488 |
/// \sa nodeSizes()
|
| 488 |
489 |
/// \sa autoNodeScale()
|
| 489 |
490 |
GraphToEps<T> &nodeScale(double d=.01) {_nodeScale=d;return *this;}
|
| 490 |
|
///Turns on/off the automatic node width scaling.
|
|
491 |
///Turns on/off the automatic node size scaling.
|
| 491 |
492 |
|
| 492 |
|
///Turns on/off the automatic node width scaling.
|
|
493 |
///Turns on/off the automatic node size scaling.
|
| 493 |
494 |
///
|
| 494 |
495 |
///\sa nodeScale()
|
| 495 |
496 |
///
|
| 496 |
497 |
GraphToEps<T> &autoNodeScale(bool b=true) {
|
| 497 |
498 |
_autoNodeScale=b;return *this;
|
| 498 |
499 |
}
|
| 499 |
500 |
|
| 500 |
|
///Turns on/off the absolutematic node width scaling.
|
|
501 |
///Turns on/off the absolutematic node size scaling.
|
| 501 |
502 |
|
| 502 |
|
///Turns on/off the absolutematic node width scaling.
|
|
503 |
///Turns on/off the absolutematic node size scaling.
|
| 503 |
504 |
///
|
| 504 |
505 |
///\sa nodeScale()
|
| 505 |
506 |
///
|
| 506 |
507 |
GraphToEps<T> &absoluteNodeSizes(bool b=true) {
|
| 507 |
508 |
_absoluteNodeSizes=b;return *this;
|
| 508 |
509 |
}
|
| 509 |
510 |
|
| 510 |
511 |
///Negates the Y coordinates.
|
| 511 |
|
|
| 512 |
|
///Negates the Y coordinates.
|
| 513 |
|
///
|
| 514 |
512 |
GraphToEps<T> &negateY(bool b=true) {
|
| 515 |
513 |
_negY=b;return *this;
|
| 516 |
514 |
}
|
| 517 |
515 |
|
| 518 |
516 |
///Turn on/off pre-scaling
|
| 519 |
517 |
|
| ... |
... |
@@ -554,115 +552,76 @@
|
| 554 |
552 |
///\sa arcWidthScale()
|
| 555 |
553 |
///
|
| 556 |
554 |
GraphToEps<T> &absoluteArcWidths(bool b=true) {
|
| 557 |
555 |
_absoluteArcWidths=b;return *this;
|
| 558 |
556 |
}
|
| 559 |
557 |
///Sets a global scale factor for the whole picture
|
| 560 |
|
|
| 561 |
|
///Sets a global scale factor for the whole picture
|
| 562 |
|
///
|
| 563 |
|
|
| 564 |
558 |
GraphToEps<T> &scale(double d) {_scale=d;return *this;}
|
| 565 |
559 |
///Sets the width of the border around the picture
|
| 566 |
|
|
| 567 |
|
///Sets the width of the border around the picture
|
| 568 |
|
///
|
| 569 |
560 |
GraphToEps<T> &border(double b=10) {_xBorder=_yBorder=b;return *this;}
|
| 570 |
561 |
///Sets the width of the border around the picture
|
| 571 |
|
|
| 572 |
|
///Sets the width of the border around the picture
|
| 573 |
|
///
|
| 574 |
562 |
GraphToEps<T> &border(double x, double y) {
|
| 575 |
563 |
_xBorder=x;_yBorder=y;return *this;
|
| 576 |
564 |
}
|
| 577 |
565 |
///Sets whether to draw arrows
|
| 578 |
|
|
| 579 |
|
///Sets whether to draw arrows
|
| 580 |
|
///
|
| 581 |
566 |
GraphToEps<T> &drawArrows(bool b=true) {_drawArrows=b;return *this;}
|
| 582 |
567 |
///Sets the length of the arrowheads
|
| 583 |
|
|
| 584 |
|
///Sets the length of the arrowheads
|
| 585 |
|
///
|
| 586 |
568 |
GraphToEps<T> &arrowLength(double d=1.0) {_arrowLength*=d;return *this;}
|
| 587 |
569 |
///Sets the width of the arrowheads
|
| 588 |
|
|
| 589 |
|
///Sets the width of the arrowheads
|
| 590 |
|
///
|
| 591 |
570 |
GraphToEps<T> &arrowWidth(double d=.3) {_arrowWidth*=d;return *this;}
|
| 592 |
571 |
|
| 593 |
572 |
///Scales the drawing to fit to A4 page
|
| 594 |
|
|
| 595 |
|
///Scales the drawing to fit to A4 page
|
| 596 |
|
///
|
| 597 |
573 |
GraphToEps<T> &scaleToA4() {_scaleToA4=true;return *this;}
|
| 598 |
574 |
|
| 599 |
575 |
///Enables parallel arcs
|
| 600 |
|
|
| 601 |
|
///Enables parallel arcs
|
| 602 |
576 |
GraphToEps<T> &enableParallel(bool b=true) {_enableParallel=b;return *this;}
|
| 603 |
577 |
|
| 604 |
|
///Sets the distance
|
| 605 |
|
|
| 606 |
|
///Sets the distance
|
| 607 |
|
///
|
|
578 |
///Sets the distance between parallel arcs
|
| 608 |
579 |
GraphToEps<T> &parArcDist(double d) {_parArcDist*=d;return *this;}
|
| 609 |
580 |
|
| 610 |
581 |
///Hides the arcs
|
| 611 |
|
|
| 612 |
|
///Hides the arcs
|
| 613 |
|
///
|
| 614 |
582 |
GraphToEps<T> &hideArcs(bool b=true) {_showArcs=!b;return *this;}
|
| 615 |
583 |
///Hides the nodes
|
| 616 |
|
|
| 617 |
|
///Hides the nodes
|
| 618 |
|
///
|
| 619 |
584 |
GraphToEps<T> &hideNodes(bool b=true) {_showNodes=!b;return *this;}
|
| 620 |
585 |
|
| 621 |
586 |
///Sets the size of the node texts
|
| 622 |
|
|
| 623 |
|
///Sets the size of the node texts
|
| 624 |
|
///
|
| 625 |
587 |
GraphToEps<T> &nodeTextSize(double d) {_nodeTextSize=d;return *this;}
|
| 626 |
588 |
|
| 627 |
589 |
///Sets the color of the node texts to be different from the node color
|
| 628 |
590 |
|
| 629 |
591 |
///Sets the color of the node texts to be as different from the node color
|
| 630 |
|
///as it is possible
|
| 631 |
|
///
|
|
592 |
///as it is possible.
|
| 632 |
593 |
GraphToEps<T> &distantColorNodeTexts()
|
| 633 |
594 |
{_nodeTextColorType=DIST_COL;return *this;}
|
| 634 |
595 |
///Sets the color of the node texts to be black or white and always visible.
|
| 635 |
596 |
|
| 636 |
597 |
///Sets the color of the node texts to be black or white according to
|
| 637 |
|
///which is more
|
| 638 |
|
///different from the node color
|
| 639 |
|
///
|
|
598 |
///which is more different from the node color.
|
| 640 |
599 |
GraphToEps<T> &distantBWNodeTexts()
|
| 641 |
600 |
{_nodeTextColorType=DIST_BW;return *this;}
|
| 642 |
601 |
|
| 643 |
602 |
///Gives a preamble block for node Postscript block.
|
| 644 |
603 |
|
| 645 |
604 |
///Gives a preamble block for node Postscript block.
|
| 646 |
605 |
///
|
| 647 |
606 |
///\sa nodePsTexts()
|
| 648 |
607 |
GraphToEps<T> & nodePsTextsPreamble(const char *str) {
|
| 649 |
608 |
_nodePsTextsPreamble=str ;return *this;
|
| 650 |
609 |
}
|
| 651 |
|
///Sets whether the the graph is undirected
|
|
610 |
///Sets whether the graph is undirected
|
| 652 |
611 |
|
| 653 |
|
///Sets whether the the graph is undirected.
|
|
612 |
///Sets whether the graph is undirected.
|
| 654 |
613 |
///
|
| 655 |
614 |
///This setting is the default for undirected graphs.
|
| 656 |
615 |
///
|
| 657 |
616 |
///\sa directed()
|
| 658 |
617 |
GraphToEps<T> &undirected(bool b=true) {_undirected=b;return *this;}
|
| 659 |
618 |
|
| 660 |
|
///Sets whether the the graph is directed
|
|
619 |
///Sets whether the graph is directed
|
| 661 |
620 |
|
| 662 |
|
///Sets whether the the graph is directed.
|
|
621 |
///Sets whether the graph is directed.
|
| 663 |
622 |
///Use it to show the edges as a pair of directed ones.
|
| 664 |
623 |
///
|
| 665 |
624 |
///This setting is the default for digraphs.
|
| 666 |
625 |
///
|
| 667 |
626 |
///\sa undirected()
|
| 668 |
627 |
GraphToEps<T> &directed(bool b=true) {_undirected=!b;return *this;}
|
| ... |
... |
@@ -713,13 +672,12 @@
|
| 713 |
672 |
_graph_to_eps_bits::_NegY<typename T::CoordsMapType>
|
| 714 |
673 |
mycoords(_coords,_negY);
|
| 715 |
674 |
|
| 716 |
675 |
os << "%!PS-Adobe-2.0 EPSF-2.0\n";
|
| 717 |
676 |
if(_title.size()>0) os << "%%Title: " << _title << '\n';
|
| 718 |
677 |
if(_copyright.size()>0) os << "%%Copyright: " << _copyright << '\n';
|
| 719 |
|
// << "%%Copyright: XXXX\n"
|
| 720 |
678 |
os << "%%Creator: LEMON, graphToEps()\n";
|
| 721 |
679 |
|
| 722 |
680 |
{
|
| 723 |
681 |
#ifndef WIN32
|
| 724 |
682 |
timeval tv;
|
| 725 |
683 |
gettimeofday(&tv, 0);
|
| ... |
... |
@@ -745,23 +703,23 @@
|
| 745 |
703 |
}
|
| 746 |
704 |
|
| 747 |
705 |
if (_autoArcWidthScale) {
|
| 748 |
706 |
double max_w=0;
|
| 749 |
707 |
for(ArcIt e(g);e!=INVALID;++e)
|
| 750 |
708 |
max_w=std::max(double(_arcWidths[e]),max_w);
|
| 751 |
|
///\todo better 'epsilon' would be nice here.
|
|
709 |
//\todo better 'epsilon' would be nice here.
|
| 752 |
710 |
if(max_w>EPSILON) {
|
| 753 |
711 |
_arcWidthScale/=max_w;
|
| 754 |
712 |
}
|
| 755 |
713 |
}
|
| 756 |
714 |
|
| 757 |
715 |
if (_autoNodeScale) {
|
| 758 |
716 |
double max_s=0;
|
| 759 |
717 |
for(NodeIt n(g);n!=INVALID;++n)
|
| 760 |
718 |
max_s=std::max(double(_nodeSizes[n]),max_s);
|
| 761 |
|
///\todo better 'epsilon' would be nice here.
|
|
719 |
//\todo better 'epsilon' would be nice here.
|
| 762 |
720 |
if(max_s>EPSILON) {
|
| 763 |
721 |
_nodeScale/=max_s;
|
| 764 |
722 |
}
|
| 765 |
723 |
}
|
| 766 |
724 |
|
| 767 |
725 |
double diag_len = 1;
|
| ... |
... |
@@ -1111,64 +1069,43 @@
|
| 1111 |
1069 |
///\name Aliases
|
| 1112 |
1070 |
///These are just some aliases to other parameter setting functions.
|
| 1113 |
1071 |
|
| 1114 |
1072 |
///@{
|
| 1115 |
1073 |
|
| 1116 |
1074 |
///An alias for arcWidths()
|
| 1117 |
|
|
| 1118 |
|
///An alias for arcWidths()
|
| 1119 |
|
///
|
| 1120 |
1075 |
template<class X> GraphToEps<ArcWidthsTraits<X> > edgeWidths(const X &x)
|
| 1121 |
1076 |
{
|
| 1122 |
1077 |
return arcWidths(x);
|
| 1123 |
1078 |
}
|
| 1124 |
1079 |
|
| 1125 |
1080 |
///An alias for arcColors()
|
| 1126 |
|
|
| 1127 |
|
///An alias for arcColors()
|
| 1128 |
|
///
|
| 1129 |
1081 |
template<class X> GraphToEps<ArcColorsTraits<X> >
|
| 1130 |
1082 |
edgeColors(const X &x)
|
| 1131 |
1083 |
{
|
| 1132 |
1084 |
return arcColors(x);
|
| 1133 |
1085 |
}
|
| 1134 |
1086 |
|
| 1135 |
1087 |
///An alias for arcWidthScale()
|
| 1136 |
|
|
| 1137 |
|
///An alias for arcWidthScale()
|
| 1138 |
|
///
|
| 1139 |
1088 |
GraphToEps<T> &edgeWidthScale(double d) {return arcWidthScale(d);}
|
| 1140 |
1089 |
|
| 1141 |
1090 |
///An alias for autoArcWidthScale()
|
| 1142 |
|
|
| 1143 |
|
///An alias for autoArcWidthScale()
|
| 1144 |
|
///
|
| 1145 |
1091 |
GraphToEps<T> &autoEdgeWidthScale(bool b=true)
|
| 1146 |
1092 |
{
|
| 1147 |
1093 |
return autoArcWidthScale(b);
|
| 1148 |
1094 |
}
|
| 1149 |
1095 |
|
| 1150 |
1096 |
///An alias for absoluteArcWidths()
|
| 1151 |
|
|
| 1152 |
|
///An alias for absoluteArcWidths()
|
| 1153 |
|
///
|
| 1154 |
1097 |
GraphToEps<T> &absoluteEdgeWidths(bool b=true)
|
| 1155 |
1098 |
{
|
| 1156 |
1099 |
return absoluteArcWidths(b);
|
| 1157 |
1100 |
}
|
| 1158 |
1101 |
|
| 1159 |
1102 |
///An alias for parArcDist()
|
| 1160 |
|
|
| 1161 |
|
///An alias for parArcDist()
|
| 1162 |
|
///
|
| 1163 |
1103 |
GraphToEps<T> &parEdgeDist(double d) {return parArcDist(d);}
|
| 1164 |
1104 |
|
| 1165 |
1105 |
///An alias for hideArcs()
|
| 1166 |
|
|
| 1167 |
|
///An alias for hideArcs()
|
| 1168 |
|
///
|
| 1169 |
1106 |
GraphToEps<T> &hideEdges(bool b=true) {return hideArcs(b);}
|
| 1170 |
1107 |
|
| 1171 |
1108 |
///@}
|
| 1172 |
1109 |
};
|
| 1173 |
1110 |
|
| 1174 |
1111 |
template<class T>
|
| ... |
... |
@@ -1182,25 +1119,28 @@
|
| 1182 |
1119 |
|
| 1183 |
1120 |
|
| 1184 |
1121 |
///Generates an EPS file from a graph
|
| 1185 |
1122 |
|
| 1186 |
1123 |
///\ingroup eps_io
|
| 1187 |
1124 |
///Generates an EPS file from a graph.
|
| 1188 |
|
///\param g is a reference to the graph to be printed
|
| 1189 |
|
///\param os is a reference to the output stream.
|
| 1190 |
|
///By default it is <tt>std::cout</tt>
|
|
1125 |
///\param g Reference to the graph to be printed.
|
|
1126 |
///\param os Reference to the output stream.
|
|
1127 |
///By default it is <tt>std::cout</tt>.
|
| 1191 |
1128 |
///
|
| 1192 |
1129 |
///This function also has a lot of
|
| 1193 |
1130 |
///\ref named-templ-func-param "named parameters",
|
| 1194 |
1131 |
///they are declared as the members of class \ref GraphToEps. The following
|
| 1195 |
1132 |
///example shows how to use these parameters.
|
| 1196 |
1133 |
///\code
|
| 1197 |
1134 |
/// graphToEps(g,os).scale(10).coords(coords)
|
| 1198 |
1135 |
/// .nodeScale(2).nodeSizes(sizes)
|
| 1199 |
1136 |
/// .arcWidthScale(.4).run();
|
| 1200 |
1137 |
///\endcode
|
|
1138 |
///
|
|
1139 |
///For more detailed examples see the \ref graph_to_eps_demo.cc demo file.
|
|
1140 |
///
|
| 1201 |
1141 |
///\warning Don't forget to put the \ref GraphToEps::run() "run()"
|
| 1202 |
1142 |
///to the end of the parameter list.
|
| 1203 |
1143 |
///\sa GraphToEps
|
| 1204 |
1144 |
///\sa graphToEps(G &g, const char *file_name)
|
| 1205 |
1145 |
template<class G>
|
| 1206 |
1146 |
GraphToEps<DefaultGraphToEpsTraits<G> >
|