Admin Production ni-theme
Current Publication

OGLPlot3DUniform

LabWindows/CVI

OGLPlot3DUniform

int OGLPlot3DUniform (int panelHandle, int OGLControlId, const void *arrayOfZValues, int numberOfXPoints, int numberOfYPoints, int dataType, double xGain, double xOffset, double yGain, double yOffset);

Purpose

Creates a 3D uniform plot on the specified OGL control.

Note   The plot will not be displayed until the next call to OGLRefreshGraph even if the the plot is not set to be invisible.

Parameters

Input
Name Type Description
panelHandle int The specifier for a particular panel that is currently in memory.

This handle will have been returned by the LoadPanel, NewPanel, or DuplicatePanel function.
OGLControlId int The ID returned by OGLNewCtrl or OGLConvertCtrl.
arrayOfZValues const void * The array of z values at various locations of the XY grid.

The data type must be one of following types:

double-precision
float
integer
short integer
character
unsigned integer
unsigned short integer
unsigned character

The array should be two a dimensional array of the form

zArray[NumYPoints][NumXPoints]


Each element of the array is associated with a {x,y} location on the graph. The location associated with element zArray[y][x] is at

{x*xGain + xOffset, y*yGain + yOffset}


on the graph.
numberOfXPoints int Size of the row dimension of the array.
numberOfYPoints int Size of the column dimension of the array.
dataType int Specifies the data type of the Z Array.

Valid Data Types:
character OGLVAL_CHAR
short integer OGLVAL_SHORT_INTEGER
integer OGLVAL_INTEGER
float OGLVAL_FLOAT
double-precision OGLVAL_DOUBLE
unsigned short integer OGLVAL_UNSIGNED_SHORT_INTEGER
unsigned integer OGLVAL_UNSIGNED_INTEGER
unsigned character OGLVAL_UNSIGNED_CHAR
xGain double Specifies the gain to be applied to the x locations implied by zArray x index values.

The value of zArray[y][x] is the z value at

{x*xGain + xOffset, y*yGain + yOffset}


on the graph.

The default value is 1.0.
xOffset double Specifies the offset to be applied to the x locations implied by zArray x index values.

The value of zArray[y][x] is the z value at

{x*xGain + xOffset, y*yGain + yOffset}


on the graph.

The default value is 0.0.
yGain double Specifies the gain to be applied to the y locations implied by zArray y index values.

The value of zArray[y][x] is the z value at

{x*xGain + xOffset, y*yGain + yOffset}


on the graph.

The default value is 1.0.
yOffset double Specifies the offset to be applied to the y locations implied by zArray y index values.

The value of zArray[y][x] is the z value at

{x*xGain + xOffset, y*yGain + yOffset}


on the graph.

The default value is 0.0.

Return Value

Name Type Description
plotHandle int Returns the handle used to specify this plot in subsequent function calls. Negative values indicate that an error occurred.

Error Codes

–1 to –999 A User Interface Library error code. (constants are available in userint.h)
–1001 The panel is a child panel.
–1002 No window system handle for panel.
–1003 Only a canvas or picture can be converted into an OGL control.
–1004 Error registering window.
–1005 Error creating window.
–1006 The OGL control could not be found.
–1007 Too many controls.
–1008 The OGL plot could not be found.
–1009 Too many plots.
–1010 The label attribute could not be obtained.
–1011 Could not hide the control.
–1012 Could not unhide the control.
–1013 Could not move the control.
–1014 Could not resize the control.
–1015 Invalid parameters passed to the function.
–1016 The attribute is an invalid OGL control attribute.
–1017 The attribute is an invalid OGL plot attribute.
–1018 The last operation caused an OpenGL error. Use OGLGetLastOpenGLError to get the error code.
–1019 The last operation caused a Windows error. Use GetLastError to get the error code.
–1020 The font name is too long.
–1021 The attribute value cannot be set.
–1022 Not enough memory.
–1023 Could not set the context.
–1024 Could not restore the context.
–1025 The control was created by another thread.
–1026 The data type passed to this function was invalid.
–1027 Trying to get an uninitialized or zero length array attribute.
–1028 The function has to be called from the main thread.
–1029 The control is already being refreshed.
–1030 The pixel depth cannot be less than 8 bits (256 colors).

Additional Information

Library: OpenGL 3D Plotting Control

Include file: custctrl\cviogl.h

LabWindows/CVI compatibility: LabWindows/CVI 5.0 and later

Examples

Refer to the following examples that use the OGLPlot3DUniform function:

  • apps\oglscxi\oglscxi.cws

    Open example
  • userint\custctrl\cviogl\ogldemo.cws

    Open example
  • userint\custctrl\cviogl\oglsim.cws

    Open example
  • userint\custctrl\cviogl\simple.cws

    Open example