Chemical Data Processing Library C++ API - Version 1.1.1
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
CDPL::Vis::Brush::Style
Style
Defines constants for supported fill pattern styles.
Definition: Brush.hpp:57
CDPL::Vis::Brush::DENSE3_PATTERN
@ DENSE3_PATTERN
Specifies a pattern with 37.5% uniformly distributed transparent pixels.
Definition: Brush.hpp:82
CDPL::Vis::Brush::DENSE2_PATTERN
@ DENSE2_PATTERN
Specifies a pattern with 12.5% uniformly distributed transparent pixels.
Definition: Brush.hpp:77
CDPL::Vis::Brush::Brush
Brush()
Constructs a brush with fill pattern style Brush::NO_PATTERN and color Color::BLACK.
CDPL::Vis::Brush::SOLID_PATTERN
@ SOLID_PATTERN
Specifies a solid pattern without any transparent pixels.
Definition: Brush.hpp:67
CDPL::Vis::Brush::DENSE4_PATTERN
@ DENSE4_PATTERN
Specifies a pattern with 50.0% uniformly distributed transparent pixels.
Definition: Brush.hpp:87
CDPL::Vis::Brush::setStyle
void setStyle(Style style)
Sets the fill pattern style.
CDPL::Vis::Brush::LEFT_DIAG_PATTERN
@ LEFT_DIAG_PATTERN
Specifies a pattern with equidistant diagonal lines from the upper right to the lower left corner.
Definition: Brush.hpp:122
CDPL::Vis::Brush::DENSE7_PATTERN
@ DENSE7_PATTERN
Specifies a pattern with 93.75% uniformly distributed transparent pixels.
Definition: Brush.hpp:102
CDPL_VIS_API
#define CDPL_VIS_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::Vis::Brush::RIGHT_DIAG_PATTERN
@ RIGHT_DIAG_PATTERN
Specifies a pattern with equidistant diagonal lines from the upper left to the lower right corner.
Definition: Brush.hpp:127
CDPL::Vis::Brush::operator!=
bool operator!=(const Brush &brush) const
Inequality comparison operator.
CDPL::Vis::Brush::getStyle
Style getStyle() const
Returns the fill pattern style.
CDPL::Vis::Brush::setColor
void setColor(const Color &color)
Sets the fill pattern color.
CDPL::Vis::Brush::DENSE5_PATTERN
@ DENSE5_PATTERN
Specifies a pattern with 62.5% uniformly distributed transparent pixels.
Definition: Brush.hpp:92
CDPL::Vis::Brush::Brush
Brush(Style style)
Constructs a brush with the specified fill pattern style and the color Color::BLACK.
CDPL::Vis::Brush::CROSS_PATTERN
@ CROSS_PATTERN
Specifies a pattern with equidistant horizontal and vertical lines.
Definition: Brush.hpp:117
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Vis::Brush::DENSE1_PATTERN
@ DENSE1_PATTERN
Specifies a pattern with 6.25% uniformly distributed transparent pixels.
Definition: Brush.hpp:72
CDPL::Vis::Brush::H_PATTERN
@ H_PATTERN
Specifies a pattern with equidistant horizontal lines.
Definition: Brush.hpp:107
CDPL::Vis::Brush::Brush
Brush(const Color &color, Style style=SOLID_PATTERN)
Constructs a brush with the specified fill pattern style and color.
CDPL::Vis::Brush::V_PATTERN
@ V_PATTERN
Specifies a pattern with equidistant vertical lines.
Definition: Brush.hpp:112
CDPL::Vis::Brush
Specifies the fill pattern and fill color of shapes.
Definition: Brush.hpp:50
CDPL::Vis::Brush::getColor
const Color & getColor() const
Returns the fill pattern color.
CDPL::Vis::Brush::NO_PATTERN
@ NO_PATTERN
Specifies that shapes should not be filled.
Definition: Brush.hpp:62
Color.hpp
Definition of the class CDPL::Vis::Color.
APIPrefix.hpp
Definition of the preprocessor macro CDPL_VIS_API.
CDPL::Vis::Brush::operator==
bool operator==(const Brush &brush) const
Equality comparison operator.
CDPL::Vis::Color
Specifies a color in terms of its red, green and blue components and an alpha-channel for transparenc...
Definition: Color.hpp:52
CDPL::Vis::Brush::DENSE6_PATTERN
@ DENSE6_PATTERN
Specifies a pattern with 87.5% uniformly distributed transparent pixels.
Definition: Brush.hpp:97