Fade2D Documentation pages v2.16.3
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 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
18 
19 
20 #pragma once
21 
22 #include "common.h"
23 #if GEOM_PSEUDO3D==GEOM_TRUE
24  namespace GEOM_FADE25D {
25 #elif GEOM_PSEUDO3D==GEOM_FALSE
26  namespace GEOM_FADE2D {
27 #else
28  #error GEOM_PSEUDO3D is not defined
29 #endif
30 
34 {
35  CRED,
36  CGREEN,
37  CBLUE,
38  CBLACK,
39  CPINK,
40  CGRAY,
41  CORANGE,
42  CLIGHTBLUE,
43  CLIGHTBROWN,
44  CDARKBROWN,
45  CPURPLE,
46  COLIVE,
47  CLAWNGREEN,
48  CPALEGREEN,
49  CCYAN,
50  CYELLOW,
51  CWHITE
52 };
53 
58 class CLASS_DECLSPEC Color
59 {
60 public:
71  Color(double r_,double g_,double b_,double width_,bool bFill_=false);
72 
85  explicit Color(Colorname c,float width_=0.001,bool bFill_=false);
86  Color();
87 
88  bool operator<(const Color& other) const;
89  bool operator!=(const Color& other) const;
90  bool operator==(const Color& other) const;
91  float r;
92  float g;
93  float b;
94  float width;
95  bool bFill;
96  friend std::ostream &operator<<(std::ostream &stream, const Color& c);
97  static Colorname getNextColorName();
98  //static size_t currentColorName;
99 };
100 
101 
102 
103 inline std::ostream &operator<<(std::ostream &stream, const Color& c)
104 {
105  stream<<"Color (r,g,b): "<<c.r<<","<<c.g<<","<<c.b<<", linewidth="<<c.width<<", fill="<<c.bFill;
106  return stream;
107 }
108 
109 
110 } // (namespace)
Colorname
Predefined colors for convenience.
Definition: Color.h:34
Color for visualization.
Definition: Color.h:59
float g
Green.
Definition: Color.h:92
float r
Red.
Definition: Color.h:91
float b
Blue.
Definition: Color.h:93
Color(double r_, double g_, double b_, double width_, bool bFill_=false)
bool bFill
Fill the shape or not.
Definition: Color.h:95
float width
Linewidth.
Definition: Color.h:94
Color(Colorname c, float width_=0.001, bool bFill_=false)