17 QPointF p11, QPointF p12, QPointF p21, QPointF p22 )
132 double radius,
double north, QPalette::ColorGroup cg )
const
135 pal.setCurrentColorGroup( cg );
137 drawRose( painter, pal, center, radius, north, m_data->width,
138 m_data->numThorns, m_data->numThornLevels, m_data->shrinkFactor );
156 const QPalette& palette,
157 const QPointF& center,
double radius,
double north,
double width,
158 int numThorns,
int numThornLevels,
double shrinkFactor )
177 painter->setPen( Qt::NoPen );
181 double step = std::pow( 2.0, j ) * M_PI /
numThorns;
186 for (
int k = 0; k < 3; k++ )
192 double leafWidth = r *
width;
193 if ( 2.0 * M_PI / step > 32 )
196 const double origin = qwtRadians( north );
197 for (
double angle = origin;
198 angle < 2.0 * M_PI + origin; angle += step )
200 const QPointF p = qwtPolar2Pos( center, r, angle );
201 const QPointF p1 = qwtPolar2Pos( center, leafWidth, angle + M_PI_2 );
202 const QPointF p2 = qwtPolar2Pos( center, leafWidth, angle - M_PI_2 );
203 const QPointF p3 = qwtPolar2Pos( center, r, angle + step / 2.0 );
204 const QPointF p4 = qwtPolar2Pos( center, r, angle - step / 2.0 );
206 QPainterPath darkPath;
207 darkPath.moveTo( center );
208 darkPath.lineTo( p );
209 darkPath.lineTo( qwtIntersection( center, p3, p1, p ) );
211 painter->setBrush(
palette.brush( QPalette::Dark ) );
212 painter->drawPath( darkPath );
214 QPainterPath lightPath;
215 lightPath.moveTo( center );
216 lightPath.lineTo( p );
217 lightPath.lineTo( qwtIntersection( center, p4, p2, p ) );
219 painter->setBrush(
palette.brush( QPalette::Light ) );
220 painter->drawPath( lightPath );
static void drawRose(QPainter *, const QPalette &, const QPointF ¢er, double radius, double north, double width, int numThorns, int numThornLevels, double shrinkFactor)