COIN-OR::LEMON - Graph Library

Changeset 1088:358526a620f8 in lemon-0.x for src/lemon


Ignore:
Timestamp:
01/19/05 13:17:11 (19 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1484
Message:

One more node-shape added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/graph_to_eps.h

    r1087 r1088  
    158158  bool dontPrint;
    159159
    160   enum NodeShapes { CIRCLE=0, SQUARE=1 };
     160  enum NodeShapes { CIRCLE=0, SQUARE=1, DIAMOND=2 };
    161161                   
    162162  class edgeLess {
     
    415415    case SQUARE:
    416416      return p.x<=r&&p.x>=-r&&p.y<=r&&p.y>=-r;
     417    case DIAMOND:
     418      return p.x+p.y<=r && p.x-p.y<=r && -p.x+p.y<=r && -p.x-p.y<=r;
    417419    }
    418420    return false;
     
    450452       << "      2 index 1 index add 2 index 2 index sub lineto\n"
    451453       << "      closepath pop pop pop} bind def\n";
     454    //x y r
     455    os << "/di { newpath 2 index 1 index add 2 index moveto\n"
     456       << "      2 index             2 index 2 index add lineto\n"
     457       << "      2 index 1 index sub 2 index             lineto\n"
     458       << "      2 index             2 index 2 index sub lineto\n"
     459       << "      closepath pop pop pop} bind def\n";
    452460    // x y r cr cg cb
    453461    os << "/nc { setrgbcolor 2 index 2 index 2 index c fill\n"
     
    460468       << _nodeBorderQuotient << " mul setlinewidth "
    461469       << 1+_nodeBorderQuotient/2 << " div sq stroke\n"
     470       << "   } bind def\n";
     471    os << "/ndi { setrgbcolor 2 index 2 index 2 index di fill\n"
     472       << "     0 0 0 setrgbcolor dup "
     473       << _nodeBorderQuotient << " mul setlinewidth "
     474       << 1+_nodeBorderQuotient/2 << " div di stroke\n"
    462475       << "   } bind def\n";
    463476    os << "/arrl " << _arrowLength << " def\n";
     
    620633        case SQUARE:
    621634          os<< "nsq";break;
     635        case DIAMOND:
     636          os<< "ndi";break;
    622637        }
    623638        os<<'\n';
Note: See TracChangeset for help on using the changeset viewer.