class cv::viz::Widget

Overview

Base class of all widgets. Widget is implicitly shared. : Moreā€¦

#include <widgets.hpp>

class Widget
{
public:
    // construction

    Widget();
    Widget(const Widget& other);

    // methods

    template <typename _W>
    _W
    cast();

    Widget2D
    cast();

    WWidgetMerger
    cast();

    double
    getRenderingProperty(int property) const;

    Widget&
    operator=(const Widget& other);

    void
    setRenderingProperty(
        int property,
        double value
        );

    static
    Widget
    fromPlyFile(const String& file_name);
};

// direct descendants

class Widget2D;
class Widget3D;

Detailed Documentation

Base class of all widgets. Widget is implicitly shared. :

Methods

template <typename _W>
_W
cast()

Casts a widget to another.

// Create a sphere widget
viz::WSphere sw(Point3f(0.0f,0.0f,0.0f), 0.5f);
// Cast sphere widget to cloud widget
viz::WCloud cw = sw.cast<viz::WCloud>();

3D Widgets can only be cast to 3D Widgets. 2D Widgets can only be cast to 2D Widgets.

Widget2D
cast()

Utility exports.

double
getRenderingProperty(int property) const

Returns rendering property of the widget.

Rendering property** can be one of the following:

  • POINT_SIZE
  • OPACITY
  • LINE_WIDTH
  • FONT_SIZE
  • AMBIENT
  • REPRESENTATION**: Expected values are : - REPRESENTATION_POINTS
  • REPRESENTATION_WIREFRAME
  • REPRESENTATION_SURFACE
  • IMMEDIATE_RENDERING**: : - Turn on immediate rendering by setting the value to 1.
  • Turn off immediate rendering by setting the value to 0.
  • SHADING**: Expected values are : - SHADING_FLAT
  • SHADING_GOURAUD
  • SHADING_PHONG

Parameters:

property Property.
void
setRenderingProperty(
    int property,
    double value
    )

Sets rendering property of the widget.

Rendering property** can be one of the following:

  • POINT_SIZE
  • OPACITY
  • LINE_WIDTH
  • FONT_SIZE
  • REPRESENTATION**: Expected values are
  • REPRESENTATION_POINTS
  • REPRESENTATION_WIREFRAME
  • REPRESENTATION_SURFACE
  • IMMEDIATE_RENDERING**:
  • Turn on immediate rendering by setting the value to 1.
  • Turn off immediate rendering by setting the value to 0.
  • SHADING**: Expected values are
  • SHADING_FLAT
  • SHADING_GOURAUD
  • SHADING_PHONG

Parameters:

property Property that will be modified.
value The new value of the property.
static
Widget
fromPlyFile(const String& file_name)

Creates a widget from ply file.

Parameters:

file_name Ply file name.