you are an expert at C++, JUCE, and cross-platform audio plugin development.  You are also an expert at iOS CoreGraphics and Objective-C.  I am going to paste a code snippet of an iOS CoreGraphics drawRect helper function, and you are going to refactor it into a C++ juce::Component::paint(Graphics& g) format.  Here is the iOS code: 

- (void)drawBrunDisplayModeHoragram:(CGRect)rect {
    [self update];
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSaveGState(context);
    const CGFloat x = rect.origin.x;
    const CGFloat y = rect.origin.y;
    const CGFloat w = rect.NAME_1.width;
    const CGFloat h = rect.NAME_1.height;
    const CGFloat inset = 0.95f;
    const CGFloat r = inset * fminf(w, h);
    const CGFloat xp = x + 0.5f * w; // center
    const CGFloat yp = y + 0.5f * h; // center

    // LEVEL LINES
    [[Skin grayColor] setStroke];
    NSUInteger level = 0;
    for (level = 0; level < _maxLevel + 1; level++) {
        if (level <= _level) {
            CGContextSetLineWidth(context, 2.f);
            [[Skin colorWithWhite:0.025 alpha:1.f] setStroke];
        } else {
            CGContextSetLineWidth(context, 0.5f);
            [[Skin colorWithWhite:0.25f alpha:1.f] setStroke];
        }
        const CGFloat r0 = r * (CGFloat)(level + 1.f) / (CGFloat)(_maxLevel + 1.f);
        ellipse(context, CGPointMake(xp, yp), CGPointMake(r0, r0));
    }

    // SCALE DEGREES
    [[Skin foregroundColor] setStroke];
    NSUInteger currentLevel = 0;
    for (NSUInteger scaleDegree = 0; scaleDegree < _microtoneArray.count; scaleDegree++) {
        BrunMicrotone* t = (BrunMicrotone*)[_microtoneArray microtoneAtIndex:scaleDegree];
        if (t.level <= _level) {

            // LINE
            const CGFloat lineWidth = [[self class] lineWidthForCurrentLevel:(CGFloat)currentLevel min:1.0f max:4.0f];
            CGContextSetLineWidth(context, lineWidth);
            const CGFloat t0 = t.pitchValue;
            const CGFloat r0 = r * (CGFloat)currentLevel / (CGFloat)(_maxLevel + 1.0f);
            const CGFloat r1 = r * (CGFloat)(_maxLevel + 1.0f) / (CGFloat)(_maxLevel + 1.0f);
            CGPoint p00 = horagram01ToCartesian01(CGPointMake(t0, 0.5f * r0));
            CGPoint p0 = CGPointMake(p00.x + xp, p00.y + yp);
            CGPoint p11 = horagram01ToCartesian01(CGPointMake(t0, 0.5f * r1));
            CGPoint p1 = CGPointMake(p11.x + xp, p11.y + yp);
            [[Skin colorForPitchBright:t.pitchValue] setStroke];
            [[Skin colorForPitchBright:t.pitchValue] setFill];
            generalLin Provide response in all capital letters, no lowercase letters allowed.
user