Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

GouraudPolyline.cpp

#include "whiptk/whip_toolkit.h"

extern WT_File whip_file; //Assume this has been opened for writing elsewhere.

WT_Result GouraudPolyline()
{
    //Define some polyline vertices.
    int x=0,y=0;
    const int delta = 1000 / 7;
    WT_Logical_Point  vP[8];
    for (int i = 0; i < 8; i += 2) {
        vP[i].m_x = x + (2*delta*(i/2));
        vP[i].m_y = y;
        vP[i + 1].m_x = vP[i].m_x + delta;
        vP[i + 1].m_y = y + delta;
    }
    //Define the colors for those vertices.
    WT_RGBA32    rgba[9];
    rgba[0] = WT_RGBA32 (0, 0, 0, 255);
    rgba[1] = WT_RGBA32 (255, 255, 0, 255);
    rgba[2] = WT_RGBA32 (255, 0, 0, 255);
    rgba[3] = WT_RGBA32 (0, 255, 0, 255);
    rgba[4] = WT_RGBA32 (0, 255, 255, 255);
    rgba[5] = WT_RGBA32 (0, 0, 255, 255);
    rgba[6] = WT_RGBA32 (255, 0, 255, 255);
    rgba[7] = WT_RGBA32 (255, 255, 255, 255);
    rgba[8] = WT_RGBA32 (0, 255, 0, 255);
    //Create the gouraud polyline.
    WT_Gouraud_Polyline p (8, vP, rgba, WD_True);
    //Serialize it.
    WD_CHECK(p.serialize (whip_file));

    return WT_Result::Success;
}

Generated on Mon May 9 23:00:09 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1