Fade2D Documentation pages v2.16.8
Delaunay Features
Color.h
Go to the documentation of this file.
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade2D library. The student license is free
4 // of charge and covers personal, non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // unclear to you.
14 //
15 // Support: https://www.geom.at/contact/
16 // Project: https://www.geom.at/fade2d/html/
17 
18 
20 
21 
22 #pragma once
23 
24 #include "common.h"
25 #if GEOM_PSEUDO3D==GEOM_TRUE
26  namespace GEOM_FADE25D {
27 #elif GEOM_PSEUDO3D==GEOM_FALSE
28  namespace GEOM_FADE2D {
29 #else
30  #error GEOM_PSEUDO3D is not defined
31 #endif
32 
36 {
37  CRED,
55 };
56 
64 class CLASS_DECLSPEC Color
65 {
66 public:
73  Color(double r,double g,double b,double width,bool bFill=false);
74 
81  explicit Color(Colorname c,float width=0.001,bool bFill=false);
82 
84  Color();
85 
86  bool operator<(const Color& other) const;
87  bool operator!=(const Color& other) const;
88  bool operator==(const Color& other) const;
89  float r;
90  float g;
91  float b;
92  float width;
93  bool bFill;
94 
106  friend std::ostream &operator<<(std::ostream &stream, const Color& c);
112 };
113 
114 inline std::ostream &operator<<(std::ostream &stream, const Color& c)
115 {
116  stream<<"Color (r,g,b): "<<c.r<<","<<c.g<<","<<c.b<<", linewidth="<<c.width<<", fill="<<c.bFill;
117  return stream;
118 }
119 
120 } // (namespace)
std::ostream & operator<<(std::ostream &stream, const Bbox2 &pC)
Prints the bounding box to a stream.
Definition: Bbox2.h:605
Colorname
Predefined colors for convenience.
Definition: Color.h:36
@ CLAWNGREEN
Definition: Color.h:51
@ CPINK
Definition: Color.h:42
@ CDARKBROWN
Definition: Color.h:48
@ CCYAN
Definition: Color.h:53
@ CPURPLE
Definition: Color.h:49
@ COLIVE
Definition: Color.h:50
@ CRED
Definition: Color.h:37
@ CGREEN
Definition: Color.h:38
@ CYELLOW
Definition: Color.h:41
@ CWHITE
Definition: Color.h:44
@ CTRANSPARENT
Definition: Color.h:54
@ CBLUE
Definition: Color.h:39
@ CLIGHTBLUE
Definition: Color.h:46
@ CGRAY
Definition: Color.h:43
@ CPALEGREEN
Definition: Color.h:52
@ CBLACK
Definition: Color.h:40
@ CORANGE
Definition: Color.h:45
@ CLIGHTBROWN
Definition: Color.h:47
Color for visualization.
Definition: Color.h:65
float g
Green component.
Definition: Color.h:90
Color(double r, double g, double b, double width, bool bFill=false)
float r
Red component.
Definition: Color.h:89
float b
Blue component.
Definition: Color.h:91
bool bFill
Fill the shape or not.
Definition: Color.h:93
static Colorname getNextColorName()
Get the next available predefined color name.
float width
Line width.
Definition: Color.h:92
Color(Colorname c, float width=0.001, bool bFill=false)