Chemical Data Processing Library C++ API - Version 1.2.0
Brush.hpp
Go to the documentation of this file.
1 /*
2  * Brush.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_VIS_BRUSH_HPP
30 #define CDPL_VIS_BRUSH_HPP
31 
32 #include "CDPL/Vis/APIPrefix.hpp"
33 #include "CDPL/Vis/Color.hpp"
34 
35 
36 namespace CDPL
37 {
38 
39  namespace Vis
40  {
41 
50  {
51 
52  public:
56  enum Style
57  {
58 
63 
68 
73 
78 
83 
88 
93 
98 
103 
108 
113 
118 
123 
128 
132  DIAG_CROSS_PATTERN
133  };
134 
138  Brush();
139 
144  Brush(Style style);
145 
151  Brush(const Color& color, Style style = SOLID_PATTERN);
152 
157  void setStyle(Style style);
158 
163  Style getStyle() const;
164 
169  void setColor(const Color& color);
170 
175  const Color& getColor() const;
176 
182  bool operator==(const Brush& brush) const;
183 
192  bool operator!=(const Brush& brush) const;
193 
194  private:
195  Style style;
196  Color color;
197  };
198  } // namespace Vis
199 } // namespace CDPL
200 
201 #endif // CDPL_VIS_BRUSH_HPP
Definition of the class CDPL::Vis::Color.
Definition of the preprocessor macro CDPL_VIS_API.
#define CDPL_VIS_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Specifies the fill pattern and fill color of shapes.
Definition: Brush.hpp:50
Style
Defines constants for supported fill pattern styles.
Definition: Brush.hpp:57
@ SOLID_PATTERN
Specifies a solid pattern without any transparent pixels.
Definition: Brush.hpp:67
@ LEFT_DIAG_PATTERN
Specifies a pattern with equidistant diagonal lines from the upper right to the lower left corner.
Definition: Brush.hpp:122
@ RIGHT_DIAG_PATTERN
Specifies a pattern with equidistant diagonal lines from the upper left to the lower right corner.
Definition: Brush.hpp:127
@ DENSE2_PATTERN
Specifies a pattern with 12.5% uniformly distributed transparent pixels.
Definition: Brush.hpp:77
@ H_PATTERN
Specifies a pattern with equidistant horizontal lines.
Definition: Brush.hpp:107
@ DENSE4_PATTERN
Specifies a pattern with 50.0% uniformly distributed transparent pixels.
Definition: Brush.hpp:87
@ DENSE6_PATTERN
Specifies a pattern with 87.5% uniformly distributed transparent pixels.
Definition: Brush.hpp:97
@ DENSE1_PATTERN
Specifies a pattern with 6.25% uniformly distributed transparent pixels.
Definition: Brush.hpp:72
@ DENSE3_PATTERN
Specifies a pattern with 37.5% uniformly distributed transparent pixels.
Definition: Brush.hpp:82
@ NO_PATTERN
Specifies that shapes should not be filled.
Definition: Brush.hpp:62
@ CROSS_PATTERN
Specifies a pattern with equidistant horizontal and vertical lines.
Definition: Brush.hpp:117
@ DENSE7_PATTERN
Specifies a pattern with 93.75% uniformly distributed transparent pixels.
Definition: Brush.hpp:102
@ V_PATTERN
Specifies a pattern with equidistant vertical lines.
Definition: Brush.hpp:112
@ DENSE5_PATTERN
Specifies a pattern with 62.5% uniformly distributed transparent pixels.
Definition: Brush.hpp:92
Brush(const Color &color, Style style=SOLID_PATTERN)
Constructs a brush with the specified fill pattern style and color.
Brush(Style style)
Constructs a brush with the specified fill pattern style and the color Color::BLACK.
const Color & getColor() const
Returns the fill pattern color.
Brush()
Constructs a brush with fill pattern style Brush::NO_PATTERN and color Color::BLACK.
bool operator!=(const Brush &brush) const
Inequality comparison operator.
void setStyle(Style style)
Sets the fill pattern style.
void setColor(const Color &color)
Sets the fill pattern color.
bool operator==(const Brush &brush) const
Equality comparison operator.
Style getStyle() const
Returns the fill pattern style.
Specifies a color in terms of its red, green and blue components and an alpha-channel for transparenc...
Definition: Color.hpp:52
The namespace of the Chemical Data Processing Library.