Fade2.5D Documentation pages v2.12
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:
75  Color(double r_,double g_,double b_,double width_,bool bFill_=false);
76 
89  explicit Color(Colorname c,float width_=0.001,bool bFill_=false);
90  Color();
91 
92  bool operator<(const Color& other) const;
93  bool operator!=(const Color& other) const;
94  bool operator==(const Color& other) const;
95  float r;
96  float g;
97  float b;
98  float width;
99  bool bFill;
100  friend std::ostream &operator<<(std::ostream &stream, const Color& c);
101  static Colorname getNextColorName();
102  //static size_t currentColorName;
103 };
104 
105 
106 
107 inline std::ostream &operator<<(std::ostream &stream, const Color& c)
108 {
109  stream<<"Color (r,g,b): "<<c.r<<","<<c.g<<","<<c.b<<", linewidth="<<c.width<<", fill="<<c.bFill;
110  return stream;
111 }
112 
113 
114 } // (namespace)
std::ostream & operator<<(std::ostream &stream, const Bbox2 &pC)
Print the box.
Definition: Bbox2.h:492
Colorname
Predefined colors for convenience.
Definition: Color.h:34
Color for visualization.
Definition: Color.h:59
bool bFill
Fill the shape or not.
Definition: Color.h:99
float width
Linewidth.
Definition: Color.h:98
float b
Blue.
Definition: Color.h:97
float g
Green.
Definition: Color.h:96
Color(double r_, double g_, double b_, double width_, bool bFill_=false)
float r
Red.
Definition: Color.h:95
Color(Colorname c, float width_=0.001, bool bFill_=false)