tahoma2d/toonz/sources/tnztools/fullcolorfilltool.h

59 lines
1.6 KiB
C
Raw Normal View History

#pragma once
#ifndef FULLCOLORFILLTOOL_H
#define FULLCOLORFILLTOOL_H
// TnzCore includes
#include "tproperty.h"
// TnzTools includes
#include "tools/tool.h"
#include "toonz/fill.h"
#include "toonz/txshsimplelevel.h"
#include <QCoreApplication>
#include <QObject>
2023-03-01 10:44:58 +13:00
#define IGNOREGAPS L"Ignore Gaps"
#define FILLGAPS L"Fill Gaps"
#define CLOSEANDFILLGAPS L"Close and Fill"
class FullColorFillTool final : public QObject, public TTool {
Q_DECLARE_TR_FUNCTIONS(FullColorFillTool)
TXshSimpleLevelP m_level;
TDoublePairProperty m_fillDepth;
TPropertyGroup m_prop;
TPointD m_clickPoint;
2021-07-30 00:09:41 +12:00
TBoolProperty m_referenced;
2023-03-01 10:44:58 +13:00
TDoubleProperty m_rasterGapDistance;
TEnumProperty m_closeRasterGaps;
TStyleIndexProperty m_closeStyleIndex;
public:
FullColorFillTool();
ToolType getToolType() const override { return TTool::LevelWriteTool; }
void updateTranslation() override;
TPropertyGroup *getProperties(int targetType) override { return &m_prop; }
FillParameters getFillParameters() const;
void leftButtonDown(const TPointD &pos, const TMouseEvent &e) override;
void leftButtonDrag(const TPointD &pos, const TMouseEvent &e) override;
bool onPropertyChanged(std::string propertyName) override;
void onActivate() override;
int getCursorId() const override;
2023-02-04 15:05:42 +13:00
private:
void applyFill(const TImageP &img, const TPointD &pos, FillParameters &params,
bool isShiftFill, TXshSimpleLevel *sl, const TFrameId &fid,
2023-03-01 10:44:58 +13:00
TXsheet *xsheet, int frameIndex, bool fillGap, bool closeGap,
int closeStyleIndex);
};
#endif // FULLCOLORFILLTOOL_H