108 qreal additionalScale)
114 if (!brush)
return path;
115 qreal finalScale =
brush->scale() * additionalScale;
121 QPainterPath ellipse;
123 realOutline = ellipse;
133 path.addPath(
outlineFetcher()->fetchOutline(info,
this, tiltLine, mode, alignForZoom, finalScale, 0.0,
true, realOutline.
boundingRect().center().x(), realOutline.
boundingRect().center().y()));
148 if (!w.brush())
return;
149 w.brush()->setSpacing(
value);
155 return this->
brush()->spacing();
161 if (!w.brush())
return;
162 w.brush()->setAutoSpacing(active, coeff);
169 return this->
brush()->autoSpacingActive();
175 return this->
brush()->autoSpacingCoeff();
181 if (!w.brush())
return;
183 w.brush()->setUserEffectiveSize(
value);
189 return this->
brush()->userEffectiveSize();
195 if (!w.brush())
return;
199 w.brush()->setAngle(
value);
219 if (props.isEmpty()) {
223 KisIntSliderBasedPaintOpPropertyCallback::SubType_Angle,
224 KoID(
"angle", i18n(
"Angle")),
228 prop->setRange(0, 360);
245 QObject::connect(updateProxy, SIGNAL(sigSettingsChanged()), prop, SLOT(requestReadValue()));
246 prop->requestReadValue();
268 QObject::connect(updateProxy, SIGNAL(sigSettingsChanged()), prop, SLOT(requestReadValue()));
269 prop->requestReadValue();
276 KoID(
"spacing", i18n(
"Spacing")),
280 prop->setRange(0.01, 10);
281 prop->setSingleStep(0.01);
282 prop->setExponentRatio(3.0);
292 prop->setValue(
value);
308 QObject::connect(updateProxy, SIGNAL(sigSettingsChanged()), prop, SLOT(requestReadValue()));
309 prop->requestReadValue();
350 QVariant
brush = cacheInterface ? cacheInterface->fetch(
"settings/brush") : QVariant();
352 if (
brush.isValid()) {
371 brush->coldInitBrush();
373 cacheInterface->put(
"settings/brush", QVariant::fromValue(
brush->clone().dynamicCast<
KisBrush>()));
float value(const T *src, size_t ch)
KisBrushBasedPaintOpSettings(KisResourcesInterfaceSP resourcesInterface)
qreal paintOpSize() const override
KisPaintOpSettingsSP clone() const override
virtual bool hasPatternSettings() const override
bool paintIncremental() override
Reimplemented.
QList< int > requiredCanvasResources() const override
void setResourceCacheInterface(KoResourceCacheInterfaceSP cacheInterface) override
QList< KisUniformPaintOpPropertyWSP > m_uniformProperties
void setAutoSpacing(bool active, qreal coeff)
void regenerateResourceCache(KoResourceCacheInterfaceSP cacheInterface) override
KisOptimizedBrushOutline brushOutline(const KisPaintInformation &info, const OutlineMode &mode, qreal alignForZoom) override
qreal paintOpAngle() const override
void setSpacing(qreal spacing)
KisOptimizedBrushOutline brushOutlineImpl(const KisPaintInformation &info, const OutlineMode &mode, qreal alignForZoom, qreal additionalScale)
void setPaintOpSize(qreal value) override
void onPropertyChanged() override
void setPaintOpAngle(qreal value) override
void setWriteCallback(Callback func)
void setReadCallback(Callback func)
KisOptimizedBrushOutline fetchOutline(const KisPaintInformation &info, const KisPaintOpSettingsSP settings, const KisOptimizedBrushOutline &originalOutline, const KisPaintOpSettings::OutlineMode &mode, qreal alignForZoom, qreal additionalScale=1.0, qreal additionalRotation=0.0, bool tilt=false, qreal tiltcenterx=1.0, qreal tiltcentery=1.0) const
QRectF boundingRect() const
const KisCurrentOutlineFetcher * outlineFetcher() const
void onPropertyChanged() override
void readOptionSetting(KisPropertiesConfigurationPointer settings, KisResourcesInterfaceSP resourcesInterface, KoCanvasResourcesInterfaceSP canvasResourcesInterface)
void writeOptionSetting(KisPropertiesConfigurationPointer settings) const
static bool requiresEffectiveCompositeOp(const KisPropertiesConfiguration *settings)
bool applyingGradient() const
static bool qFuzzyCompare(half p1, half p2)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
T kisRadiansToDegrees(T radians)
std::enable_if< std::is_floating_point< T >::value, T >::type normalizeAngleDegrees(T a)
T kisDegreesToRadians(T degrees)
QSharedPointer< T > toQShared(T *ptr)
Container< QSharedPointer< T > > listWeakToStrong(const Container< QWeakPointer< T > > &container, bool allOrNothing=true)
KisCallbackBasedPaintopProperty< KisSliderBasedPaintOpProperty< int > > KisIntSliderBasedPaintOpPropertyCallback
KisCallbackBasedPaintopProperty< KisSliderBasedPaintOpProperty< qreal > > KisDoubleSliderBasedPaintOpPropertyCallback
@ CurrentEffectiveCompositeOp
@ BackgroundColor
The active background color selected for this canvas.
@ ForegroundColor
The active foreground color selected for this canvas.
const KisBrushBasedPaintOpSettings * m_parent
BrushReader(const KisBrushBasedPaintOpSettings *parent)
KisBrushOptionProperties m_option
KisBrushBasedPaintOpSettings * m_parent
BrushWriter(KisBrushBasedPaintOpSettings *parent)
KisBrushOptionProperties m_option
static QPainterPath makeTiltIndicator(KisPaintInformation const &info, QPointF const &start, qreal lengthScale, qreal angle)
QList< KisUniformPaintOpPropertyWSP > uniformProperties
KoResourceCacheInterfaceSP resourceCacheInterface
bool read(const KisPropertiesConfiguration *setting)
bool hasPaintingModeProperty
enumPaintingMode paintingMode