236 Lightgoldenrodyellow,
316 Color() : m_red(0), m_green(0), m_blue(0), m_alpha(255) { }
320 : m_red(
r), m_green(g), m_blue(b), m_alpha(a) { }
400 : m_color(
Color::Name::Black)
429 : m_color(c), m_bgColor(
Color::Name::Black), m_pattern(
pattern) { }
451 toMap.emplace(it.second, it.first);
510template<
class ToClass>
512 std::cout <<
"getMapToEnum was wrongly called\n";
517template<
class FromClass>
520 std::cout <<
"getMapToString was wrongly called " <<
typeid(
fc).name() <<
"\n";
556template<
class FromClass>
558 auto* map = graphics::getMapToString<FromClass>();
560 graphics::init<FromClass>();
562 auto it = map->find(key);
567template<
class ToClass>
569 auto map = graphics::getMapToEnum<ToClass>();
571 graphics::init<ToClass>();
573 auto it = map->find(key);
574 if (it != map->end()) {
578 << key <<
" " << map->size() <<
" " << map->empty() << std::endl;
579 return static_cast<ToClass>(std::numeric_limits<int>::min());
Contains logging functionality.
Basic declarations, included by all source files.
Colors represented as RGBA values.
Color(Color::Name name)
Creates a color from given color name name.
bool operator==(const Color &c) const
Returns true iff c and this color are equal in every component.
Color(const char *str)
Crates a color from string str.
uint8_t blue() const
Returns the blue component.
void alpha(uint8_t a)
Sets the alpha channel to a.
Name
Named colors (same as SVG color keywords).
Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Creates a color from given RGBA-values.
uint8_t red() const
Returns the red component.
uint8_t green() const
Returns the green component.
bool operator!=(const Color &c) const
Returns true iff c and this color differ in any component.
Color(const string &str)
Crates a color from string str.
void blue(uint8_t b)
Sets the blue component to b.
void red(uint8_t r)
Sets the red component to r.
uint8_t alpha() const
Returns the alpha channel.
Color(int r, int g, int b, int a=255)
Creates a color from given RGBA-values.
bool fromString(const string &str)
Sets this color to the color defined by str.
friend std::ostream & operator<<(std::ostream &os, const Color &c)
Writes the string representation of color c to output stream os.
Color()
Creates an opaque black color.
void green(uint8_t g)
Sets the green component to g.
string toString() const
Converts the color to a string and returns it.
static std::ostream & slout(Level level=Level::Default)
stream for logging-output (global)
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
StrokeType intToStrokeType(int i)
Converts integer i to stroke type.
StrokeLineJoin
Line join types of strokes.
FillPattern
Fill patterns.
FillPattern intToFillPattern(int i)
Converts integer i to fill pattern.
StrokeLineCap
Line cap types of strokes.
StrokeType
Line types of strokes.
Shape
Types for node shapes.
EdgeArrow
Types for edge arrows.
@ Dashdotdot
line style "dash dot dot dash dot dot ..."
@ Dashdot
line style "dash dot dash dot ..."
@ InvTrapeze
inverted trapeze (upper side longer)
@ RoundedRect
rectangle with rounded corners
@ InvParallelogram
inverted parallelogram (slanted to the left)
@ Triangle
isosceles triangle (base side down)
@ Trapeze
trapeze (upper side shorter)
@ Parallelogram
parallelogram (slanted to the right)
@ InvTriangle
isosceles triangle (base side up)
@ Both
edge arrow at target and source node of the edge
@ First
edge arrow at source node of the edge
@ Last
edge arrow at target node of the edge
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
std::map< string, FillPattern > toFillPattern
void init< StrokeType >()
void initSecondMap(std::map< Enum, string > &fromMap, std::map< string, Enum > &toMap)
void init< FillPattern >()
std::map< string, ToClass > * getMapToEnum()
std::map< Shape, string > fromShape
std::map< FromClass, string > * getMapToString()
std::map< FillPattern, string > fromFillPattern
std::map< StrokeType, string > fromStrokeType
std::map< string, Shape > toShape
std::map< string, StrokeType > toStrokeType
The namespace for all OGDF objects.
@ None
Two geometric objects do not intersect.
void initFillPatternHashing()
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.
bool operator==(const Tuple2< E1, E2 > &t1, const Tuple2< E1, E2 > &t2)
Equality operator for 2-tuples.
string toString(FromClass key)
ToClass fromString(string key)
FillPattern m_pattern
fill pattern
Fill(Color c, FillPattern pattern)
Fill(Color c, Color bgColor, FillPattern pattern)
Color m_bgColor
background color of fill pattern
float m_width
stroke width
Color m_color
stroke color
StrokeLineJoin m_join
line-join of the stroke
StrokeType m_type
stroke type (e.g.
StrokeLineCap m_cap
line-cap of the stroke