class hiro::draw::GraphRenderer — HIRO 0.7.0 documentation

# class hiro::draw::GraphRenderer

## Overview

Renderer used for rendering 2D graphs. More…

    #include <GraphRenderer.h>

    class GraphRenderer: public hiro::draw::Renderer {
    public:
        // construction

        GraphRenderer(const std::vector<float>& values_y);
        GraphRenderer(std::vector<glm::vec2> values);
        GraphRenderer(const hiro::draw::GraphRenderer& source);
        GraphRenderer(hiro::draw::GraphRenderer&&);
        virtual ~GraphRenderer();

        // methods

        GraphRenderer& operator=(const hiro::draw::GraphRenderer& source);
        GraphRenderer& operator=(hiro::draw::GraphRenderer&&);
        virtual bool IsCompatibileWithStyle(const hiro::draw::Style* style);

    protected:
        // methods

        virtual void Render2D(const std::string& program);
        virtual void FillTextRenderer(hiro::draw::TextRenderer* t_renderer);
        virtual void LoadRequiredShaderPrograms(glw::ProgramList* programs);
    };

### Inherited Members

    public:
        // methods

        virtual bool IsCompatibileWithStyle(const hiro::draw::Style* style) = 0;

    protected:
        // methods

        virtual void LoadRequiredShaderPrograms(glw::ProgramList* programs);
        virtual void Render(const std::string& program);
        virtual void OnRenderSimple();
        virtual void Render2D(const std::string& program);
        virtual void OnRenderSimple2D();
        virtual void FillTextRenderer(hiro::draw::TextRenderer* t_renderer);

        template <typename StyleType>
        const StyleType* GetStyle() const;

        const Scene* GetScene() const;

## Detailed Documentation

Renderer used for rendering 2D graphs.

### Construction

    GraphRenderer(const std::vector<float>& values_y)

Creates a graph with data points of specified y values.

    GraphRenderer(std::vector<glm::vec2> values)

Creates a graph with data points of specified values. Sorted by x value before used.

### Methods

    virtual bool IsCompatibileWithStyle(const hiro::draw::Style* style)

Test whether specified style is compatible with the object.

    virtual void Render2D(const std::string& program)

Defines 2d rendering behavior.

    virtual void FillTextRenderer(hiro::draw::TextRenderer* t_renderer)

DEfines texts to be rendered.

    virtual void LoadRequiredShaderPrograms(glw::ProgramList* programs)

Loads shader programs required by this renderer.