Chemical Data Processing Library C++ API - Version 1.2.0
Public Types | Public Member Functions | List of all members
CDPL::Vis::Brush Class Reference

Specifies the fill pattern and fill color of shapes. More...

#include <Brush.hpp>

Public Types

enum  Style {
  NO_PATTERN ,
  SOLID_PATTERN ,
  DENSE1_PATTERN ,
  DENSE2_PATTERN ,
  DENSE3_PATTERN ,
  DENSE4_PATTERN ,
  DENSE5_PATTERN ,
  DENSE6_PATTERN ,
  DENSE7_PATTERN ,
  H_PATTERN ,
  V_PATTERN ,
  CROSS_PATTERN ,
  LEFT_DIAG_PATTERN ,
  RIGHT_DIAG_PATTERN ,
  DIAG_CROSS_PATTERN
}
 Defines constants for supported fill pattern styles. More...
 

Public Member Functions

 Brush ()
 Constructs a brush with fill pattern style Brush::NO_PATTERN and color Color::BLACK. More...
 
 Brush (Style style)
 Constructs a brush with the specified fill pattern style and the color Color::BLACK. More...
 
 Brush (const Color &color, Style style=SOLID_PATTERN)
 Constructs a brush with the specified fill pattern style and color. More...
 
void setStyle (Style style)
 Sets the fill pattern style. More...
 
Style getStyle () const
 Returns the fill pattern style. More...
 
void setColor (const Color &color)
 Sets the fill pattern color. More...
 
const ColorgetColor () const
 Returns the fill pattern color. More...
 
bool operator== (const Brush &brush) const
 Equality comparison operator. More...
 
bool operator!= (const Brush &brush) const
 Inequality comparison operator. More...
 

Detailed Description

Specifies the fill pattern and fill color of shapes.

A brush has a style and a color attribute. The style defines the look of the fill pattern and the color attribute specifies the color of the specified fill pattern. The style of a default constructed Brush object is Brush::NO_PATTERN, which tells the renderer not to fill drawn shapes.

Member Enumeration Documentation

◆ Style

Defines constants for supported fill pattern styles.

Enumerator
NO_PATTERN 

Specifies that shapes should not be filled.

SOLID_PATTERN 

Specifies a solid pattern without any transparent pixels.

DENSE1_PATTERN 

Specifies a pattern with 6.25% uniformly distributed transparent pixels.

DENSE2_PATTERN 

Specifies a pattern with 12.5% uniformly distributed transparent pixels.

DENSE3_PATTERN 

Specifies a pattern with 37.5% uniformly distributed transparent pixels.

DENSE4_PATTERN 

Specifies a pattern with 50.0% uniformly distributed transparent pixels.

DENSE5_PATTERN 

Specifies a pattern with 62.5% uniformly distributed transparent pixels.

DENSE6_PATTERN 

Specifies a pattern with 87.5% uniformly distributed transparent pixels.

DENSE7_PATTERN 

Specifies a pattern with 93.75% uniformly distributed transparent pixels.

H_PATTERN 

Specifies a pattern with equidistant horizontal lines.

V_PATTERN 

Specifies a pattern with equidistant vertical lines.

CROSS_PATTERN 

Specifies a pattern with equidistant horizontal and vertical lines.

LEFT_DIAG_PATTERN 

Specifies a pattern with equidistant diagonal lines from the upper right to the lower left corner.

RIGHT_DIAG_PATTERN 

Specifies a pattern with equidistant diagonal lines from the upper left to the lower right corner.

DIAG_CROSS_PATTERN 

Specifies a pattern with equidistant diagonal lines in both directions.

Constructor & Destructor Documentation

◆ Brush() [1/3]

CDPL::Vis::Brush::Brush ( )

Constructs a brush with fill pattern style Brush::NO_PATTERN and color Color::BLACK.

◆ Brush() [2/3]

CDPL::Vis::Brush::Brush ( Style  style)

Constructs a brush with the specified fill pattern style and the color Color::BLACK.

Parameters
styleThe style of the fill pattern.

◆ Brush() [3/3]

CDPL::Vis::Brush::Brush ( const Color color,
Style  style = SOLID_PATTERN 
)

Constructs a brush with the specified fill pattern style and color.

Parameters
colorThe fill pattern color.
styleThe fill pattern style .

Member Function Documentation

◆ setStyle()

void CDPL::Vis::Brush::setStyle ( Style  style)

Sets the fill pattern style.

Parameters
styleThe the fill pattern style.

◆ getStyle()

Style CDPL::Vis::Brush::getStyle ( ) const

Returns the fill pattern style.

Returns
The fill pattern style.

◆ setColor()

void CDPL::Vis::Brush::setColor ( const Color color)

Sets the fill pattern color.

Parameters
colorThe fill pattern color.

◆ getColor()

const Color& CDPL::Vis::Brush::getColor ( ) const

Returns the fill pattern color.

Returns
The fill pattern color.

◆ operator==()

bool CDPL::Vis::Brush::operator== ( const Brush brush) const

Equality comparison operator.

Parameters
brushThe other Brush object to be compared with.
Returns
true if the style and color attributes compare equal, and false otherwise.

◆ operator!=()

bool CDPL::Vis::Brush::operator!= ( const Brush brush) const

Inequality comparison operator.

The result is equivalent to !(*this == brush).

Parameters
brushThe other Brush object to be compared with.
Returns
true if either the style or the color attributes compare non-equal, and false otherwise.

The documentation for this class was generated from the following file: