COIN-OR::LEMON - Graph Library

Changeset 2174:f9e43b5cc617 in lemon-0.x


Ignore:
Timestamp:
08/10/06 15:52:56 (18 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2889
Message:

Some color constants added (BLACK, WHITE, RED etc)

Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • demo/disjoint_paths_demo.cc

    r2084 r2174  
    4242
    4343Color color(bool b) {
    44   return b ? Color(1.0, 0.0, 0.0) : Color(0.0, 0.0, 0.0);
     44  return b ? RED : BLACK;
    4545}
    4646
  • demo/strongly_connected_orientation.cc

    r2173 r2174  
    4646
    4747Color color(bool c) {
    48   return c ? Color(0.0, 0.0, 0.0) : Color(1.0, 0.0, 0.0);
     48  return c ? BLACK : RED;
    4949}
    5050
  • demo/topology_demo.cc

    r2172 r2174  
    4141
    4242Color color(bool val) {
    43   return val ? Color(1.0, 0.0, 0.0) : Color(0.0, 0.0, 1.0);
     43  return val ? RED : BLUE;
    4444}
    4545
  • lemon/Makefile.am

    r2144 r2174  
    1111        lemon/lp_skeleton.cc \
    1212        lemon/base.cc \
     13        lemon/color.cc \
    1314        lemon/eps.cc \
    1415        lemon/bits/mingw32_rand.cc \
  • lemon/color.h

    r2172 r2174  
    4444
    4545namespace lemon {
     46
     47  /// \addtogroup misc
     48  /// @{
    4649
    4750///Data structure representing RGB colors.
     
    7376};
    7477
     78  /// White color constant
     79  extern const Color WHITE; 
     80  /// Black color constant
     81  extern const Color BLACK;
     82  /// Red color constant
     83  extern const Color RED;
     84  /// Green color constant
     85  extern const Color GREEN;
     86  /// Blue color constant
     87  extern const Color BLUE;
     88  /// Yellow color constant
     89  extern const Color YELLOW;
     90  /// Magenta color constant
     91  extern const Color MAGENTA;
     92  /// Cyan color constant
     93  extern const Color CYAN;
     94  /// Grey color constant
     95  extern const Color GREY;
     96  /// Dark red color constant
     97  extern const Color DARK_RED;
     98  /// Dark green color constant
     99  extern const Color DARK_GREEN;
     100  /// Drak blue color constant
     101  extern const Color DARK_BLUE;
     102  /// Dark yellow color constant
     103  extern const Color DARK_YELLOW;
     104  /// Dark magenta color constant
     105  extern const Color DARK_MAGENTA;
     106  /// Dark cyan color constant
     107  extern const Color DARK_CYAN;
     108
    75109///Maps <tt>int</tt>s to different \ref Color "Color"s
    76110
     
    92126  ///amongst the provided color (\c true) or not (\c false). If it is true,
    93127  ///white will be assigned to \c 0.
    94   ///\param num the number of the allocated colors. If it is \c 0
    95   ///the default color configuration is set up (26 color plus the while).
     128  ///\param num the number of the allocated colors. If it is \c 0,
     129  ///the default color configuration is set up (26 color plus the white).
    96130  ///If \c num is less then 26/27 then the default color list is cut. Otherwise
    97131  ///the color list is filled repeatedly with the default color list.
     
    168202///Returns black for light colors and white for the dark ones.
    169203inline Color distantBW(const Color &c){
    170   double v=(.2125*c.red()+.7154*c.green()+.0721*c.blue())<.5?1:0;
    171   return Color(v,v,v);
     204  return (.2125*c.red()+.7154*c.green()+.0721*c.blue())<.5 ? WHITE : BLACK;
    172205}
    173206
     207/// @}
     208
    174209} //END OF NAMESPACE LEMON
    175210
  • lemon/eps.h

    r2084 r2174  
    287287    ///\param brd Color of the node border. The default color is black
    288288    EpsDrawer &node(NodeShapes t, double x, double y, double r,
    289                     Color col=Color(1,1,1), Color brd=Color(0,0,0));
     289                    Color col=WHITE, Color brd=BLACK);
    290290    ///Draw a node shape
    291291   
     
    298298    template<class T>
    299299    EpsDrawer &node(NodeShapes t, xy<T> pos, double r,
    300                     Color col=Color(1,1,1), Color brd=Color(0,0,0))
     300                    Color col=WHITE, Color brd=BLACK)
    301301    {
    302302      return node(t,pos.x,pos.y,r,col,brd);
  • lemon/graph_to_eps.h

    r2172 r2174  
    145145    g(_g), os(_os),
    146146    _coords(xy<double>(1,1)), _nodeSizes(1.0), _nodeShapes(0),
    147     _nodeColors(Color(1,1,1)), _edgeColors(Color(0,0,0)),
     147    _nodeColors(WHITE), _edgeColors(BLACK),
    148148    _edgeWidths(1), _edgeWidthScale(0.3),
    149149    _nodeScale(1.0), _xBorder(10), _yBorder(10), _scale(1.0),
     
    156156    _undirected(false),
    157157    _pleaseRemoveOsStream(_pros), _scaleToA4(false),
    158     _nodeTextColorType(SAME_COL), _nodeTextColors(Color(0,0,0)),
     158    _nodeTextColorType(SAME_COL), _nodeTextColors(BLACK),
    159159    _autoNodeScale(false),
    160160    _autoEdgeWidthScale(false),
Note: See TracChangeset for help on using the changeset viewer.