diguyViewPainter

Generated from diguyViewPainter.h

DI-Guy API Version 12.5.1

This file was automatically generated from diguyViewPainter.h. Do not edit this file directly; the changes will be lost.
Includes: declspec_diguy.h

Contents:

Alphabetical Index

Link against: libdiguy

Summary:

The diguyViewPainter class acts as a helper for drawing various graphics primitives in DI-Guy Scenario 3D views.

Currently this class is only supported in DI-Guy Scenario, and should be utilized only inside of a diguyScenario::CALLBACK_ID_POST_DRAW callback, or inside of a mind draw function.

There is only one diguyViewPainter. Retrieve a pointer to it by calling diguyApp::get_view_painter().

class diguyViewPainter

class BDI_DECLSPEC_diguy diguyViewPainter
{
public:
    virtual void set_line_width(float width);
    virtual void set_pen_color(float red, float green, float blue, float alpha = 1.0f);
    virtual void set_pen2_color(float red, float green, float blue, float alpha = 1.0f);
    virtual void set_brush_color(float red, float green, float blue, float alpha = 1.0f);
    virtual void get_viewport_size(float* width, float* height);
    virtual void world_to_screen(float world_x, float world_y, float world_z,
        float* view_x, float* view_y, float* view_z);
    virtual void draw_line(float x1, float y1, float z1,
        float x2, float y2, float z2);
    virtual void draw_line_2c(float x1, float y1, float z1,
        float x2, float y2, float z2);
    virtual void draw_sphere(float x, float y, float z,
        float radius,
        int draw_edges = 1,
        int draw_fill = 1);
    virtual void draw_box(float x1, float y1, float z1,
        float x2, float y2, float z2,
        int draw_edges = 1,
        int draw_fill = 1);
    virtual void draw_rotated_box(float x1, float y1, float z1,
        float x2, float y2, float z2,
        float yaw, float roll, float pitch,
        float xc, float yc, float zc,
        int edges = 1,
        int fill = 1);
    virtual void draw_arrow(float x1, float y1, float z1,
        float x2, float y2, float z2,
        float shaft_width = 0.02,
        float arrow_width = 0.05,
        int draw_edges = 1,
        int draw_fill = 1);
    virtual void draw_disc(float x, float y, float z,
        float radius,
        int draw_edges = 1,
        int draw_fill = 1,
        int num_sides = 12);
    virtual void draw_circle(float x, float y, float z,
        float normal_x, float normal_y, float normal_z,
        float radius,
        int draw_edges = 1,
        int draw_fill = 1,
        int num_sides = 12);
    virtual void draw_torus(float x, float y, float z,
        float inner_radius,
        float outer_radius,
        int draw_edges = 1,
        int draw_fill = 1,
        int num_sides = 12);
    virtual void draw_cylinder(float x, float y, float z,
        float radius,
        float height,
        int draw_edges = 1,
        int draw_fill = 1);
    virtual void draw_wedge(float x, float y, float z,
        float target_x, float target_y, float target_z,
        float inner_radius,
        float width,
        int draw_edges = 1,
        int draw_fill = 1);
    virtual void draw_wedge_with_normal(float x, float y, float z,
        float target_x, float target_y, float target_z,
        float nx, float ny, float nz,
        float inner_radius,
        float width,
        int draw_edges = 1,
        int draw_fill = 1);
    virtual void begin_2d_text_mode();
    virtual void end_2d_text_mode();
    virtual void draw_text(float screen_x, float screen_y, const char* text);
    virtual void draw_2d_rect(float x0,
        float y0,
        float x1,
        float y1,
        int draw_edges = 1,
        int draw_fill = 1);
    virtual void draw_private_path_shape(diguyCharacter* diguy_character,
        int include_waypoints = 0);
State-Setting Functions

function diguyViewPainter::set_line_width

Prototype:

virtual void set_line_width(float width);
Description:

Sets the current width of lines drawn by the painter.

Callable From:

function diguyViewPainter::set_pen_color

Prototype:

virtual void set_pen_color(float red, float green, float blue, float alpha = 1.0f);
Description:

Sets the color of the default pen. Pens typically draw lines and borders around shapes. Color values should be between 0.0 and 1.0.

Callable From:

function diguyViewPainter::set_pen2_color

Prototype:

virtual void set_pen2_color(float red, float green, float blue, float alpha = 1.0f);
Description:

Sets the color of the secondary pen. Color values should be between 0.0 and 1.0.

Callable From:

function diguyViewPainter::set_brush_color

Prototype:

virtual void set_brush_color(float red, float green, float blue, float alpha = 1.0f);
Description:

Sets the color of the brush. Brushes are typically used for filling shapes. Color values should be between 0.0 and 1.0.

Callable From:

View Functions

function diguyViewPainter::get_viewport_size

Prototype:

virtual void get_viewport_size(float* width, float* height);
Description:

Fills out the width and height arguments with the dimensions of the primary 3D view.

Callable From:

function diguyViewPainter::world_to_screen

Prototype:

virtual void world_to_screen(float world_x, float world_y, float world_z,
    float* view_x, float* view_y, float* view_z);
Description:

This function converts a world (x, y, z) coordinate into a view (x, y, z) coordinate.

Note: this function must be called before 2d text mode is entered with the begin_2d_text_mode() function.

If the returned view z value is greater then 1, the returned coordinate is behind the camera.

3D Draw Functions
In all 3D draw functions, if there are edges to be drawn they are drawn with the current pen color as set by set_pen_color(). If there is an area to be filled it will be filled with the current brush color, as set by set_brush_color().

function diguyViewPainter::draw_line

Prototype:

virtual void draw_line(float x1, float y1, float z1,
    float x2, float y2, float z2);
Description:

Draws a line from (x1, y1, z1) to (x2, y2, z2) using the pen color.

Callable From:

function diguyViewPainter::draw_line_2c

Prototype:

virtual void draw_line_2c(float x1, float y1, float z1,
    float x2, float y2, float z2);
Description:

Draws a line from (x1, y1, z1) to (x2, y2, z2) using both of the pen colors. The color of the line is interpolated from point 1 to point 2.

Callable From:

function diguyViewPainter::draw_sphere

Prototype:

virtual void draw_sphere(float x, float y, float z,
    float radius,
    int draw_edges = 1,
    int draw_fill = 1);
Description:

Draws a sphere with its center at (x, y, z), with radius radius.

Callable From:

function diguyViewPainter::draw_box

Prototype:

virtual void draw_box(float x1, float y1, float z1,
    float x2, float y2, float z2,
    int draw_edges = 1,
    int draw_fill = 1);
Description:

Draws an axis aligned bounding box with one corner at (x1, y1, z1), the other at (x2, y2, z2).

Callable From:

function diguyViewPainter::draw_rotated_box

Prototype:

virtual void draw_rotated_box(float x1, float y1, float z1,
    float x2, float y2, float z2,
    float yaw, float roll, float pitch,
    float xc, float yc, float zc,
    int edges = 1,
    int fill = 1);
Description:

Draws a rotated bounding box with one corner at unrotated (x1, y1, z1), and another at unrotated (x2, y2, z2), applying the rotation Euler angles (given in BDI_EULER_ANGLE_ORDER_ZXY order in degrees). The box is drawn at center point (xc, yc, zc) in global space, and then rotated.

Callable From:

function diguyViewPainter::draw_arrow

Prototype:

virtual void draw_arrow(float x1, float y1, float z1,
    float x2, float y2, float z2,
    float shaft_width = 0.02,
    float arrow_width = 0.05,
    int draw_edges = 1,
    int draw_fill = 1);
Description:

Draws an arrow from (x1, y1, z1) to (x2, y2, z2).

Callable From:

function diguyViewPainter::draw_disc

Prototype:

virtual void draw_disc(float x, float y, float z,
    float radius,
    int draw_edges = 1,
    int draw_fill = 1,
    int num_sides = 12);
Description:

Draws a disc with its center at (x, y, z), and the given radius.

Callable From:

function diguyViewPainter::draw_circle

Prototype:

virtual void draw_circle(float x, float y, float z,
    float normal_x, float normal_y, float normal_z,
    float radius,
    int draw_edges = 1,
    int draw_fill = 1,
    int num_sides = 12);
Description:

Draws a circle at (x, y, z), with normal (normal_x, normal_y, normal_z), and the given radius.

Callable From:

function diguyViewPainter::draw_torus

Prototype:

virtual void draw_torus(float x, float y, float z,
    float inner_radius,
    float outer_radius,
    int draw_edges = 1,
    int draw_fill = 1,
    int num_sides = 12);
Description:

Draws a torus at (x, y, z), with normal (normal_x, normal_y, normal_z), and the given radius.

Callable From:

function diguyViewPainter::draw_cylinder

Prototype:

virtual void draw_cylinder(float x, float y, float z,
    float radius,
    float height,
    int draw_edges = 1,
    int draw_fill = 1);
Description:

Draws a Z-axis-up cylinder, with its bottom cap centered at (x1, y1, z). The cylinder will have the given radius and height.

Callable From:

function diguyViewPainter::draw_wedge

Prototype:

virtual void draw_wedge(float x, float y, float z,
    float target_x, float target_y, float target_z,
    float inner_radius,
    float width,
    int draw_edges = 1,
    int draw_fill = 1);
Description:

Draws wedge.

Callable From:

function diguyViewPainter::draw_wedge_with_normal

Prototype:

virtual void draw_wedge_with_normal(float x, float y, float z,
    float target_x, float target_y, float target_z,
    float nx, float ny, float nz,
    float inner_radius,
    float width,
    int draw_edges = 1,
    int draw_fill = 1);
2D Draw Functions
Before 2D drawing functions are called the view must be put into a 2D drawing state by calling begin_2d_text_mode().

function diguyViewPainter::begin_2d_text_mode

Prototype:

virtual void begin_2d_text_mode();
Description:

Puts the OpenGL view matrix into a 2D orthogonal state so that 2D primitives will be drawn in 2D view coordinates rather than in 3D world coordinates.

This call must be balanced by a call to end_2d_text_mode(), or overall drawing will be broken.

Callable From:

function diguyViewPainter::end_2d_text_mode

Prototype:

virtual void end_2d_text_mode();
Description:

Returns the OpenGL view matrix back into a 3D perspective state.

This call must be balanced by a call to begin_2d_text_mode(), or overall drawing will be broken.

Callable From:

function diguyViewPainter::draw_text

Prototype:

virtual void draw_text(float screen_x, float screen_y, const char* text);
Description:

Draws the passed text string at view coordinates (x, y).

Should only be called inside of a begin_2d_text_mode() and end_2d_text_mode() block.

The text is drawn with the current pen color.

Callable From:

function diguyViewPainter::draw_2d_rect

Prototype:

virtual void draw_2d_rect(float x0,
    float y0,
    float x1,
    float y1,
    int draw_edges = 1,
    int draw_fill = 1);
Description:

Draws a 2D rectangle with the given points as the corners.

Should only be called inside of a begin_2d_text_mode() and end_2d_text_mode() block.

The edges are drawn with the current pen color, the fill is drawn with the current brush color.

Callable From:

function diguyViewPainter::draw_private_path_shape

Prototype:

virtual void draw_private_path_shape(diguyCharacter* diguy_character,
    int include_waypoints = 0);

Alphabetical Index




Copyright (C) 1992-2012 Boston Dynamics

ALL RIGHTS RESERVED.

These coded instructions, statements, and computer programs contain unpublished proprietary information of Boston Dynamics and are protected by Copyright Laws of the United States. They may not be used, duplicated, or disclosed in any form, in whole or in part, without the prior written consent from Boston Dynamics.

RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Sofware clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the Commercial Computer Software--Restricted Rights at 48 CFR 52.227-19, as applicable. Unpublished-rights reserved under the Copyright Laws of the United States.

Contractor/Manufacturer is:

Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.