本文整理汇总了C++中KisBrushSP::data方法的典型用法代码示例。如果您正苦于以下问题:C++ KisBrushSP::data方法的具体用法?C++ KisBrushSP::data怎么用?C++ KisBrushSP::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisBrushSP
的用法示例。
在下文中一共展示了KisBrushSP::data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCurrentBrush
void KisBrushSelectionWidget::setCurrentBrush( KisBrushSP brush)
{
// XXX: clever code have brush plugins know their configuration
// pane, so we don't have to have this if statement and
// have an extensible set of brush types
if ( dynamic_cast<KisAutoBrush*>(brush.data()) ) {
m_brushesTab->setCurrentWidget( m_autoBrushWidget );
m_autoBrushWidget->setBrush(brush);
}
else if (dynamic_cast<KisTextBrush*>(brush.data())) {
m_brushesTab->setCurrentWidget( m_textBrushWidget );
m_textBrushWidget->setBrush(brush);
}
else {
m_brushesTab->setCurrentWidget( m_brushChooser );
m_brushChooser->setBrush(brush);
}
}
示例2: setBrush
void KisAutoBrushWidget::setBrush(KisBrushSP brush)
{
m_autoBrush = brush;
m_brush = brush->image();
// XXX: lock, set and unlock the widgets.
KisAutoBrush* aBrush = dynamic_cast<KisAutoBrush*>(brush.data());
if (aBrush->maskGenerator()->type() == KisMaskGenerator::CIRCLE) {
comboBoxShape->setCurrentIndex(0);
}
else if (aBrush->maskGenerator()->type() == KisMaskGenerator::RECTANGLE) {
comboBoxShape->setCurrentIndex(1);
}
else {
comboBoxShape->setCurrentIndex(2);
}
comboBoxMaskType->setCurrentIndex(comboBoxMaskType->findText(aBrush->maskGenerator()->name()));
inputRadius->setValue(aBrush->maskGenerator()->diameter());
inputRatio->setValue(aBrush->maskGenerator()->ratio());
inputVFade->blockSignals(true);
inputHFade->blockSignals(true);
inputHFade->setValue(aBrush->maskGenerator()->horizontalFade());
inputVFade->setValue(aBrush->maskGenerator()->verticalFade());
inputVFade->blockSignals(false);
inputHFade->blockSignals(false);
inputAngle->setValue(aBrush->angle() * 180 / M_PI);
inputSpikes->setValue(aBrush->maskGenerator()->spikes());
inputSpacing->setValue(aBrush->spacing());
inputSpacing->setExponentRatio(3.0);
inputRandomness->setValue(aBrush->randomness() * 100);
density->setValue(aBrush->density() * 100);
if (!aBrush->maskGenerator()->curveString().isEmpty()) {
KisCubicCurve curve;
curve.fromString(aBrush->maskGenerator()->curveString());
softnessCurve->setCurve(curve);
}
}