7#ifndef __KIS_GRID_CONFIG_H
8#define __KIS_GRID_CONFIG_H
16#include <boost/operators.hpp>
17#include "kritaui_export.h"
23class KRITAUI_EXPORT
KisGridConfig : boost::equality_comparable<KisGridConfig>
56 m_xSpacingActive(true),
57 m_ySpacingActive(true),
58 m_offsetActive(false),
59 m_offsetAspectLocked(true),
60 m_spacingAspectLocked(true),
63 m_angleAspectLocked(true),
64 m_angleLeftActive(true),
65 m_angleRightActive(true),
68 m_gridType(GRID_RECTANGULAR),
70 m_lineTypeMain(LINE_SOLID),
71 m_lineTypeSubdivision(LINE_DOTTED),
72 m_lineTypeIsoVertical(LINE_DASHED),
73 m_colorMain(200, 200, 200, 200),
74 m_colorSubdivision(200, 200, 200, 150),
75 m_colorIsoVertical(200, 200, 200, 100),
77 m_penSubdivision(QPen()),
81 m_penMain.setWidth(0);
82 m_penSubdivision.setWidth(0);
83 m_penVertical.setWidth(0);
125 m_snapToGrid =
value;
129 return m_offsetActive;
132 m_offsetActive =
value;
151 return m_xSpacingActive;
154 m_xSpacingActive =
value;
158 return m_ySpacingActive;
161 m_ySpacingActive =
value;
165 return m_subdivision;
168 m_subdivision =
value;
184 m_angleRight = angle;
189 return m_angleLeftActive;
193 m_angleLeftActive =
value;
197 return m_angleRightActive;
201 m_angleRightActive =
value;
205 return m_cellSpacing;
208 m_cellSpacing = spacing;
215 m_cellSize = spacing;
227 return m_offsetAspectLocked;
230 m_offsetAspectLocked =
value;
234 return m_spacingAspectLocked;
237 m_spacingAspectLocked =
value;
241 return m_angleAspectLocked;
244 m_angleAspectLocked =
value;
248 return m_lineTypeMain;
251 m_lineTypeMain =
value;
252 updatePenStyle(&m_penMain, m_colorMain, m_lineTypeMain);
256 return m_lineTypeSubdivision;
260 m_lineTypeSubdivision =
value;
261 updatePenStyle(&m_penSubdivision, m_colorSubdivision, m_lineTypeSubdivision);
265 return m_lineTypeIsoVertical;
269 m_lineTypeIsoVertical=
value;
270 updatePenStyle(&m_penVertical, m_colorIsoVertical, m_lineTypeIsoVertical);
279 updatePenStyle(&m_penMain, m_colorMain, m_lineTypeMain);
283 return m_colorSubdivision;
286 m_colorSubdivision =
value;
287 updatePenStyle(&m_penSubdivision, m_colorSubdivision, m_lineTypeSubdivision);
291 return m_colorIsoVertical;
294 m_colorIsoVertical =
value;
295 updatePenStyle(&m_penVertical, m_colorIsoVertical, m_lineTypeIsoVertical);
303 return m_penSubdivision;
307 return m_penVertical;
314 void loadStaticData();
315 void saveStaticData()
const;
317 QDomElement saveDynamicDataToXml(QDomDocument& doc,
const QString &tag)
const;
318 bool loadDynamicDataFromXml(
const QDomElement &parent);
329 void transform(
const QTransform &transform);
332 void updatePenStyle(QPen *pen, QColor color, LineTypeInternal type);
333 void updateTrigoCache();
float value(const T *src, size_t ch)
LineTypeInternal lineTypeMain() const
QColor colorVertical() const
QColor m_colorIsoVertical
void setOffsetActive(bool value)
GridType gridType() const
void setSnapToGrid(bool value)
void setAngleLeft(qreal angle)
LineTypeInternal m_lineTypeIsoVertical
QPen penSubdivision() const
void setSubdivision(int value)
bool ySpacingActive() const
void setXSpacingActive(bool value)
void setOffset(const QPoint &value)
void setLineTypeMain(LineTypeInternal value)
bool xSpacingActive() const
void setColorSubdivision(const QColor &value)
void setAngleLeftActive(bool value)
void setCellSpacing(int spacing)
void setColorVertical(const QColor &value)
LineTypeInternal lineTypeSubdivision() const
bool operator==(const KisGridConfig &rhs) const
bool angleRightActive() const
void setGridType(GridType type)
bool angleLeftActive() const
void setLineTypeVertical(LineTypeInternal value)
QColor m_colorSubdivision
void setLineTypeSubdivision(LineTypeInternal value)
TrigoCache trigoCache() const
void setAngleRight(qreal angle)
bool spacingAspectLocked() const
QColor colorSubdivision() const
void setYSpacingActive(bool value)
bool angleAspectLocked() const
void setSpacingAspectLocked(bool value)
LineTypeInternal m_lineTypeSubdivision
bool m_offsetAspectLocked
bool offsetActive() const
LineTypeInternal m_lineTypeMain
void setSpacing(const QPoint &value)
LineTypeInternal lineTypeVertical() const
void setOffsetAspectLocked(bool value)
void setCellSize(int spacing)
void setAngleRightActive(bool value)
void setShowGrid(bool value)
void setColorMain(const QColor &value)
bool m_spacingAspectLocked
bool offsetAspectLocked() const
void setAngleAspectLocked(bool value)
Q_DECLARE_METATYPE(KisPaintopLodLimitations)
qreal correctedAngleLeftOffsetX
qreal correctedAngleLeftCellSize
qreal correctedAngleRightOffsetX
qreal correctedAngleRightCellSize