Chapter 17:
3D Wire Frame Functions
 

CheckWireframe(); Check the 3D graph wire frame

 

ClearWireframe(); Clear the 3D graph wire frame

 

DrawWireframe(); Draw 3D wire frame

 

GetWireFrameBounds(); Get Wire Frame Bounds

CheckWireframe()

 

This function tests the wire frame points for possible INT32 overflow. It verifies that none of the points that define the graph cube causes Transform3DPoint to overflow.

Syntax:

BOOLEAN16 PUBLIC
CheckWireframe (
     GraphPtr pGraph
);

Input:

pGraph: Pointer to a graph object created by AllocGraphPtr()

Return:

BOOLEAN16: TRUE/FALSE

 

TRUE=

wire frame points are within safe range

 

FALSE=

points overflow

Example:

/* CheckWireframe is TRUE if none of the 17 wire
* frame points causes Transform3DPoint to overflow.
* If it returns FALSE, we're dangerously close and
* should just ignore the current operation by
* restoring the old Matrix, Size3D and Wall3D values.
*/
if ( !CheckWireframe(pGraph) )
{
for (i=0; i<4; i++)
for (j=0; j<XYZ; j++)
     LOOK.fMatrix[i][j] = saveMatrix[i][j];
     pGraph->LObj.Size3D.x = saveSize3D.x;
     pGraph->LObj.Size3D.y = saveSize3D.y;
     pGraph->LObj.Size3D.z = saveSize3D.z;
     pGraph->LObj.Wall3D.x = saveWall3D.x;
     pGraph->LObj.Wall3D.y = saveWall3D.y;
     pGraph->LObj.Wall3D.z = saveWall3D.z;
     }

Also See:

ClearWireframe(), DrawWireframe(), GetWireFrameBounds()

ClearWireframe()

 

This function is an access routine that allows the caller to tell the charting engine to initialize the 3D-wire frame again. All 3D charts provide true 3D viewing, with 16 preset viewing angles. Your application can control 2D panning in X and Y, perspective panning and distortion, zoom, rotation around the X, Y and Z axes, and the size of the cube area that contains the chart. The thickness of the walls, floor, and risers can also be controlled by your application. The A3D_CUSTOMVIEW and A3D_VIEWANGLES attributes apply the viewing, panning, rotation, etc. characteristics to the 3D cube. This function tells the charting engine that the 3D-wire frame needs to be re-initialized.

Syntax:

void PUBLIC ClearWireframe (GraphPtr pGraph);

Input:

pGraph: Pointer to a graph object created by AllocGraphPtr()

Return:

None

Notes:

This function is called by the 3D-view tool code after erasing.

Also See:

CheckWireframe(), DrawWireframe(), GetWireFrameBounds()

   

DrawWireframe()

 

This function erases the current 3D wire frame (if it is displayed) and redraws it in the new location. All 3D charts provide true 3D viewing, with 16 preset viewing angles. Your application can control 2D panning in X and Y, perspective panning and distortion, zoom, rotation around the X, Y and Z axes, and the size of the cube area that contains the chart. The thickness of the walls, floor, and risers can also be controlled by your application. The A3D_CUSTOMVIEW and A3D_VIEWANGLES attributes apply the viewing, panning, rotation, etc. characteristics to the 3D cube. This function erases and redraws the 3D-wire frame to show the results of these 3D viewing operations.

Syntax:

void PUBLIC
DrawWireframe (
     DrawEnvPtr pDE,
     GraphPtr pGraph,
     INT16 nPixels
);

Input:

pDE: Pointer to a draw environment created by AllocDrawEnvPtr()

 

pGraph: Pointer to a graph created by AllocGraphPtr

 

nPixels: Not Currently Used

Return:

None

Also See:

CheckWireFrame(), ClearWireFrame(), GetWireFrameBounds()

   

GetWireFrameBounds()

 

GetWireFrameBounds() is an access routine that allows the caller to get the bounding rectangle of the wire frame in virtual coordinates as it appears on screen.

Syntax:

BOOLEAN16 PUBLIC
GetWireFrameBounds (
     GraphPtr pGraph,
     Rect FAR * pRect
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

 

pRect: Pointer to a rectangle data structure where the bounds (in virtual coordinates) of the wire frame can be stored. See the Rect structure in Appendix A.

Return:

BOOLEAN16: TRUE

Also See:

CheckWireFrame(), ClearWireFrame(), DrawWireFrame()