<commit_before>
#include "ShapeDemo.h"

#include <glbinding/gl/enum.h>

#include <gloperate/gloperate.h>

#include <gloperate/stages/base/TextureLoadStage.h>
#include <gloperate/stages/base/BasicFramebufferStage.h>
#include <gloperate/stages/base/TextureRenderTargetStage.h>
#include <gloperate/stages/base/ProgramStage.h>
#include <gloperate/stages/base/RenderPassStage.h>
#include <gloperate/stages/base/RasterizationStage.h>
#include <gloperate/stages/base/ClearStage.h>
#include <gloperate/stages/base/ShapeStage.h>
#include <gloperate/stages/base/TimerStage.h>
#include <gloperate/stages/base/TransformStage.h>
#include <gloperate/stages/base/FloatSelectionStage.h>
#include <gloperate/stages/navigation/TrackballStage.h>
#include <gloperate/rendering/Shape.h>
#include <gloperate/rendering/Quad.h>
#include <gloperate/rendering/ColorRenderTarget.h>
#include <gloperate/stages/base/TextureFromRenderTargetExtractionStage.h>


CPPEXPOSE_COMPONENT(ShapeDemo, gloperate::Stage)


using namespace cppexpose;
using namespace gloperate;


ShapeDemo::ShapeDemo(Environment * environment, const std::string & name)
: Pipeline(environment, "ShapeDemo", name)
, canvasInterface(this)
, shape("shape", this, ShapeType::Box)
, texture("texture", this)
, angle("angle", this, 0.0f)
, rotate("rotate", this, false)
, color("color", this, Color(255, 255, 255, 255))
, m_timer(cppassist::make_unique<TimerStage>(environment, "Timer"))
, m_floatSelection(cppassist::make_unique<FloatSelectionStage>(environment, "FloatSelection"))
, m_trackball(cppassist::make_unique<TrackballStage>(environment, "Trackball"))
, m_shape(cppassist::make_unique<ShapeStage>(environment, "Shape"))
, m_texture(cppassist::make_unique<TextureLoadStage>(environment, "Texture"))
, m_framebuffer(cppassist::make_unique<BasicFramebufferStage>(environment, "Framebuffer"))
, m_clear(cppassist::make_unique<ClearStage>(environment, "Clear"))
, m_shapeTransform(cppassist::make_unique<TransformStage>(environment, "ShapeTransform"))
, m_shapeProgram(cppassist::make_unique<ProgramStage>(environment, "ShapeProgram"))
, m_shapeRenderPass(cppassist::make_unique<RenderPassStage>(environment, "ShapeRenderPass"))
, m_shapeRasterization(cppassist::make_unique<RasterizationStage>(environment, "ShapeRasterization"))
, m_colorizeProgram(cppassist::make_unique<ProgramStage>(environment, "ColorizeProgram"))
, m_textureExtractionStage(cppassist::make_unique<TextureFromRenderTargetExtractionStage>(environment, "TextureExtraction"))
, m_colorizeRenderPass(cppassist::make_unique<RenderPassStage>(environment, "ColorizeRenderPass"))
, m_colorizeRasterization(cppassist::make_unique<RasterizationStage>(environment, "ColorizeRasterization"))
{
    // Get data path
    const auto dataPath = gloperate::dataPath();

    // Setup parameters
    texture = dataPath + "/gloperate/textures/gloperate-logo.glraw";

    angle.setOption("minimumValue", 0.0f);
    angle.setOption("maximumValue", 2.0f * glm::pi<float>());
    angle.setOption("updateOnDrag", true);

    rotate.valueChanged.connect(this, &ShapeDemo::onRotateChanged);
    m_timer->virtualTime.valueChanged.connect([this](const float & angle) {
        // Set angle to current timer value
        this->angle = angle;
    });

    // Timer stage
    addStage(m_timer.get());
    m_timer->interval = 2.0f * glm::pi<float>();

    addStage(m_floatSelection.get());
    m_floatSelection->createInput("timerValue") << m_timer->virtualTime;
    m_floatSelection->createInput("angle") << angle;
    m_floatSelection->index = 1u;

    // Trackball stage
    addStage(m_trackball.get());
    m_trackball->viewport << canvasInterface.viewport;

    // Shape stage
    addStage(m_shape.get());
    m_shape->shapeType << this->shape;
    m_shape->width     = 1.0f;
    m_shape->height    = 1.0f;
    m_shape->depth     = 1.0f;
    m_shape->radius    = 1.0f;
    m_shape->texCoords = true;

    // Texture loader stage
    addStage(m_texture.get());
    m_texture->filename << this->texture;

    // Framebuffer stage
    addStage(m_framebuffer.get());
    m_framebuffer->viewport << canvasInterface.viewport;

    // Transform stage for shape
    addStage(m_shapeTransform.get());<commit_msg>workaround for settings wrong value when entering pipeline editor<commit_after>
#include "ShapeDemo.h"

#include <glbinding/gl/enum.h>

#include <gloperate/gloperate.h>

#include <gloperate/stages/base/TextureLoadStage.h>
#include <gloperate/stages/base/BasicFramebufferStage.h>
#include <gloperate/stages/base/TextureRenderTargetStage.h>
#include <gloperate/stages/base/ProgramStage.h>
#include <gloperate/stages/base/RenderPassStage.h>
#include <gloperate/stages/base/RasterizationStage.h>
#include <gloperate/stages/base/ClearStage.h>
#include <gloperate/stages/base/ShapeStage.h>
#include <gloperate/stages/base/TimerStage.h>
#include <gloperate/stages/base/TransformStage.h>
#include <gloperate/stages/base/FloatSelectionStage.h>
#include <gloperate/stages/navigation/TrackballStage.h>
#include <gloperate/rendering/Shape.h>
#include <gloperate/rendering/Quad.h>
#include <gloperate/rendering/ColorRenderTarget.h>
#include <gloperate/stages/base/TextureFromRenderTargetExtractionStage.h>


CPPEXPOSE_COMPONENT(ShapeDemo, gloperate::Stage)


using namespace cppexpose;
using namespace gloperate;


ShapeDemo::ShapeDemo(Environment * environment, const std::string & name)
: Pipeline(environment, "ShapeDemo", name)
, canvasInterface(this)
, shape("shape", this, ShapeType::Box)
, texture("texture", this)
, angle("angle", this, 0.0f)
, rotate("rotate", this, false)
, color("color", this, Color(255, 255, 255, 255))
, m_timer(cppassist::make_unique<TimerStage>(environment, "Timer"))
, m_floatSelection(cppassist::make_unique<FloatSelectionStage>(environment, "FloatSelection"))
, m_trackball(cppassist::make_unique<TrackballStage>(environment, "Trackball"))
, m_shape(cppassist::make_unique<ShapeStage>(environment, "Shape"))
, m_texture(cppassist::make_unique<TextureLoadStage>(environment, "Texture"))
, m_framebuffer(cppassist::make_unique<BasicFramebufferStage>(environment, "Framebuffer"))
, m_clear(cppassist::make_unique<ClearStage>(environment, "Clear"))
, m_shapeTransform(cppassist::make_unique<TransformStage>(environment, "ShapeTransform"))
, m_shapeProgram(cppassist::make_unique<ProgramStage>(environment, "ShapeProgram"))
, m_shapeRenderPass(cppassist::make_unique<RenderPassStage>(environment, "ShapeRenderPass"))
, m_shapeRasterization(cppassist::make_unique<RasterizationStage>(environment, "ShapeRasterization"))
, m_colorizeProgram(cppassist::make_unique<ProgramStage>(environment, "ColorizeProgram"))
, m_textureExtractionStage(cppassist::make_unique<TextureFromRenderTargetExtractionStage>(environment, "TextureExtraction"))
, m_colorizeRenderPass(cppassist::make_unique<RenderPassStage>(environment, "ColorizeRenderPass"))
, m_colorizeRasterization(cppassist::make_unique<RasterizationStage>(environment, "ColorizeRasterization"))
{
    // Get data path
    const auto dataPath = gloperate::dataPath();

    // Setup parameters
    texture = dataPath + "/gloperate/textures/gloperate-logo.glraw";

    angle.setOption("minimumValue", 0.0f);
    angle.setOption("maximumValue", 2.0f * glm::pi<float>());
    angle.setOption("updateOnDrag", true);

    rotate.valueChanged.connect(this, &ShapeDemo::onRotateChanged);
    m_timer->virtualTime.valueChanged.connect([this](const float & angle) {
        // Set angle to current timer value
        this->angle = angle;
    });

    // Timer stage
    addStage(m_timer.get());
    m_timer->interval = 2.0f * glm::pi<float>();
    m_timer->interval.setOption("maximumValue", 2.0f * glm::pi<float>());

    addStage(m_floatSelection.get());
    m_floatSelection->createInput("timerValue") << m_timer->virtualTime;
    m_floatSelection->createInput("angle") << angle;
    m_floatSelection->index = 1u;

    // Trackball stage
    addStage(m_trackball.get());
    m_trackball->viewport << canvasInterface.viewport;

    // Shape stage
    addStage(m_shape.get());
    m_shape->shapeType << this->shape;
    m_shape->width     = 1.0f;
    m_shape->height    = 1.0f;
    m_shape->depth     = 1.0f;
    m_shape->radius    = 1.0f;
    m_shape->texCoords = true;

    // Texture loader stage
    addStage(m_texture.get());
    m_texture->filename << this->texture;

    // Framebuffer stage
    addStage(m_framebuffer.get());
    m_framebuffer->viewport << canvasInterface.viewport;

    // Transform stage for shape
    addStage(m_shapeTransform.get());
{'fraction_non_alphanumeric': 0.1418664786083686, 'fraction_numerical': 0.007052186177715092, 'mean_word_length': 6.412020905923345, 'pattern_counts': {'":': 0, '<': 98, '<?xml version=': 0, '>': 111, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3827079', 'n_tokens_mistral': 2829, 'n_tokens_neox': 2722, 'n_words': 378}