help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
cpp-shape-drawer
/
include
RSK World
cpp-shape-drawer
C++ Shape Drawer - Advanced Graphics Application + Raylib + OOP Design + Shape Tools + Transformation + Export + Educational Design
include
  • Circle.hpp2 KB
  • DrawingCanvas.hpp7.3 KB
  • PatternGenerator.hpp1.6 KB
  • Polygon.hpp2.3 KB
  • RectangleShape.hpp2.7 KB
  • Shape.hpp4.2 KB
  • Star.hpp2.8 KB
  • TextShape.hpp2 KB
  • Triangle.hpp2.5 KB
PatternGenerator.hpp
include/PatternGenerator.hpp
Raw Download
Find: Go to:
/**
 * @file PatternGenerator.hpp
 * @brief Utility to generate complex shape patterns.
 * 
 * Part of the C++ Shape Drawer Project.
 * 
 * @author Molla Samser (Founder of RSK World)
 * @designer Rima Khatun
 * @website https://rskworld.in
 * @email hello@rskworld.in
 * @phone +91 93305 39277
 * @location Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
 * @year 2026
 */

#ifndef PATTERN_GENERATOR_HPP
#define PATTERN_GENERATOR_HPP

#include "DrawingCanvas.hpp"
#include "Circle.hpp"
#include "RectangleShape.hpp"
#include <cmath>

class PatternGenerator {
public:
    static void generateGrid(DrawingCanvas& canvas, int rows, int cols, float spacing) {
        for (int i = 0; i < rows; ++i) {
            for (int j = 0; j < cols; ++j) {
                Vector2 pos = { 50.0f + j * spacing, 50.0f + i * spacing };
                Color col = { (unsigned char)(j * 20), (unsigned char)(i * 20), 150, 255 };
                canvas.addShape(std::make_unique<Circle>(pos, spacing / 2.5f, col, true));
            }
        }
    }

    static void generateSpiral(DrawingCanvas& canvas, Vector2 center, int count) {
        for (int i = 0; i < count; ++i) {
            float angle = i * 0.2f;
            float radius = i * 2.0f;
            Vector2 pos = { center.x + cos(angle) * radius, center.y + sin(angle) * radius };
            Color col = ColorFromHSV(angle * 57.29f, 0.8f, 0.9f);
            canvas.addShape(std::make_unique<Circle>(pos, 5.0f + i * 0.1f, col, true));
        }
    }
};

#endif // PATTERN_GENERATOR_HPP
48 lines•1.6 KB
cpp

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer