kis_tangent_normal_paintop.h 3.02 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
/*
 *  Copyright (C) 2015 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifndef _KIS_TANGENTNORMALPAINTOP_H_
#define _KIS_TANGENTNORMALPAINTOP_H_

#include <QRect>

#include <kis_brush_based_paintop.h>
#include <kis_types.h>

#include <kis_pressure_size_option.h>
#include <kis_tangent_tilt_option.h>
29
#include <kis_airbrush_option_widget.h>
30 31
#include <kis_pressure_flow_opacity_option.h>
#include <kis_pressure_spacing_option.h>
32
#include <kis_pressure_rate_option.h>
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
#include <kis_pressure_rotation_option.h>
#include <kis_pressure_scatter_option.h>
#include <kis_pressure_flow_option.h>
#include <kis_pressure_softness_option.h>
#include <kis_pressure_sharpness_option.h>

class KisBrushBasedPaintOpSettings;
class KisPainter;

class KisTangentNormalPaintOp: public KisBrushBasedPaintOp
{
public:
    //public functions//

    /* Create a Tangent Normal Brush Operator*/
48
    KisTangentNormalPaintOp(const KisPaintOpSettingsSP settings, KisPainter* painter, KisNodeSP node, KisImageSP image);
49
    ~KisTangentNormalPaintOp() override;
50

51 52 53
    void paintLine(const KisPaintInformation &pi1, const KisPaintInformation &pi2, KisDistanceInformation *currentDistance) override;

protected:
54
    /*paint the dabs*/
55
    KisSpacingInformation paintAt(const KisPaintInformation& info) override;
56 57 58

    KisSpacingInformation updateSpacingImpl(const KisPaintInformation &info) const override;

59 60
    KisTimingInformation updateTimingImpl(const KisPaintInformation &info) const override;

61 62 63 64
private:
    KisSpacingInformation computeSpacing(const KisPaintInformation &info, qreal scale,
                                         qreal rotation) const;

65 66 67 68 69
private:
    //private functions//
    KisPressureSizeOption m_sizeOption;
    KisFlowOpacityOption m_opacityOption;
    KisPressureSpacingOption m_spacingOption;
70
    KisPressureRateOption m_rateOption;
71 72 73
    KisPressureRotationOption m_rotationOption;
    KisPressureScatterOption m_scatterOption;
    KisTangentTiltOption m_tangentTiltOption;
74
    KisAirbrushOptionProperties m_airbrushOption;
75 76 77 78 79 80 81 82 83 84 85
    KisPressureSoftnessOption m_softnessOption;
    KisPressureSharpnessOption m_sharpnessOption;
    KisPressureFlowOption m_flowOption;

    KisFixedPaintDeviceSP m_maskDab;
    KisPaintDeviceSP m_tempDev;
    QRect m_dstDabRect;

    KisPaintDeviceSP m_lineCacheDevice;
};
#endif // _KIS_TANGENTNORMALPAINTOP_H_