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

# class hiro::draw::PointCloudRenderer

## Overview

Renderer used for rendering point clouds. More…

    #include <PointCloudRenderer.h>

    class PointCloudRenderer: public hiro::draw::ElementRenderer {
    public:
        // construction

        PointCloudRenderer();
        PointCloudRenderer(const cogs::PointCloud& pc);
        PointCloudRenderer(const hiro::draw::PointCloudRenderer& source);
        PointCloudRenderer(hiro::draw::PointCloudRenderer&&);
        virtual ~PointCloudRenderer();

        // methods

        PointCloudRenderer& operator=(const hiro::draw::PointCloudRenderer& source);
        PointCloudRenderer& operator=(hiro::draw::PointCloudRenderer&&);
        void Reset(const cogs::PointCloud& pc);
        size_t GetPointCount() const;
        void SetColors(const std::vector<cogs::Color3f>& colors);
        virtual bool IsCompatibileWithStyle(const hiro::draw::Style* style);

    protected:
        // methods

        virtual void OnRenderPoints();
        virtual void OnRenderNormals();
    };

### Inherited Members

    public:
        // methods

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

    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;
        virtual void LoadRequiredShaderPrograms(glw::ProgramList* programs);
        virtual void Render(const std::string& program);
        virtual void OnRenderPoints();
        virtual void OnRenderFaces();
        virtual void OnRenderNormals();
        void RenderPoints(const hiro::draw::PointsStyle& style, std::function<void(void)> render_func);
        void RenderFaces(const hiro::draw::FacesStyle& style, std::function<void(void)> render_func);
        void RenderNormals(const hiro::draw::NormalsStyle& style, std::function<void(void)> render_func);

## Detailed Documentation

Renderer used for rendering point clouds.

### Construction

    PointCloudRenderer()

Creates a renderer without point cloud.

    PointCloudRenderer(const cogs::PointCloud& pc)

Creates a renderer with the specified point cloud.

### Methods

    void Reset(const cogs::PointCloud& pc)

Replaces currently set point cloud with a new one.

    size_t GetPointCount() const

Returns number of points in the rendered pointcloud.

    void SetColors(const std::vector<cogs::Color3f>& colors)

Set custom color for each point.

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

Test whether specified style is compatible with the object.

    virtual void OnRenderPoints()

Defines behavior on point rendering.

    virtual void OnRenderNormals()

Defines behavior on normal rendering.