Files
qt5-legatus-legacy/Lts/Viewer/SituationMap/Map/fill_style.h
T
2026-08-13 18:33:10 +02:00

113 lines
2.2 KiB
C++
Executable File

/**
* @RDE_HEADER@
* FillStyle
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
// Own
#include "situation_map_types.h"
#include <situation_map_export.h>
// Qt
#include <QColor>
//----------------------------------------------------------------------------
namespace SituationMap
{
//----------------------------------------------------------------------------
/**
* @brief The FillStyle class contains parameter to fill an area with color and pattern.
*/
class SITUATIONMAP_EXPORT FillStyle final
{
public:
/*! \name Construction, Destruction */
//@{
/**
* @brief Constructor
*/
FillStyle() = default;
/**
* @brief Constructor
*/
FillStyle(const QColor &fillColor, FillPattern fillPattern);
/**
* @brief Constructor
*/
explicit FillStyle(FillPattern fillPattern);
/**
* @brief Destructor
*/
~FillStyle() = default;
//@}
/** \name FillColor
* Set and get methods.
*/
//@{
QColor fillColor() const;
void setFillColor(const QColor &fillColor);
//@}
/** \name FillPattern
* Set and get methods.
*/
FillPattern fillPattern() const;
void setFillPattern(const FillPattern &fillPattern);
//@}
/**
* @brief operator== Compare two objects
* @param other to be compared with
* @return true if identical, otherwise false.
*/
bool operator==(const FillStyle &other) const
{
return ((this->m_fillColor == other.m_fillColor) &&
(this->m_fillPattern == other.m_fillPattern)
);
}
/**
* @brief operator!= Compare two objects
* @param other to be compared with
* @return true if NOT identical, otherwise false.
*/
bool operator!=(const FillStyle &other) const
{
return !(*this == other);
}
private:
QColor m_fillColor = QColor(125, 125, 125, 125); // gray
FillPattern m_fillPattern = FillPattern::Solid;
};
//-----------------------------------------------------------------------------
// output operator:
//-----------------------------------------------------------------------------
SITUATIONMAP_EXPORT std::ostream &operator<< (std::ostream &stream,
const FillStyle &value);
} // namespace SituationMap