org::scilab::modules::renderer::subwinDrawing::ZGridDrawerGL Class Reference

Inheritance diagram for org::scilab::modules::renderer::subwinDrawing::ZGridDrawerGL:

Inheritance graph
[legend]
Collaboration diagram for org::scilab::modules::renderer::subwinDrawing::ZGridDrawerGL:

Collaboration graph
[legend]

Public Member Functions

 ZGridDrawerGL ()
void drawGrid ()

Private Member Functions

Vector3D[] getGridStartingPoints (double xCoordinate, double yCoordinate)
Vector3D[] getGridMiddlePoints (double xCoordinate, double yCoordinate)
Vector3D[] getGridEndPoints (double xCoordinate, double yCoordinate)

Detailed Description

Class for drawing grid on Z axis
Author:
Jean-Baptiste Silvy

Definition at line 24 of file ZGridDrawerGL.java.


Constructor & Destructor Documentation

org::scilab::modules::renderer::subwinDrawing::ZGridDrawerGL::ZGridDrawerGL (  )  [inline]

Default constructor

Definition at line 29 of file ZGridDrawerGL.java.

00029                                {
00030                 super();
00031         }


Member Function Documentation

Vector3D [] org::scilab::modules::renderer::subwinDrawing::ZGridDrawerGL::getGridStartingPoints ( double  xCoordinate,
double  yCoordinate 
) [inline, private]

Get the starting points for grid drawing

Parameters:
xCoordinate X coordinate of the Z axis
yCoordinate Y coordinate of the Z axis
Returns:
array containing positions of grid

Definition at line 39 of file ZGridDrawerGL.java.

References org::scilab::modules::renderer::subwinDrawing::GridDrawerGL::getGridNbPositions(), org::scilab::modules::renderer::subwinDrawing::GridDrawerGL::getGridPosition(), org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::getZmax(), org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::getZmin(), and res.

Referenced by drawGrid(), getGridEndPoints(), and getGridMiddlePoints().

00039                                                                                          {
00040                 int nbGridLines = getGridNbPositions();
00041                 Vector3D[] res = new Vector3D[nbGridLines];
00042                 
00043                 for (int i = 0; i < nbGridLines; i++) {
00044                         double zCoordinate = getGridPosition(i);
00045                         if (zCoordinate < getZmin() || zCoordinate > getZmax()) {
00046                                 res[i] = null;
00047                         } else {
00048                                 res[i] = new Vector3D(xCoordinate, yCoordinate, zCoordinate);
00049                         }
00050                 }
00051                 
00052                 return res;
00053                 
00054         }

Here is the call graph for this function:

Here is the caller graph for this function:

Vector3D [] org::scilab::modules::renderer::subwinDrawing::ZGridDrawerGL::getGridMiddlePoints ( double  xCoordinate,
double  yCoordinate 
) [inline, private]

Get the middle points for grid drawing, there are the points belinging to both grid lines segment

Parameters:
xCoordinate X coordinate of the Z axis
yCoordinate Y coordinate of the Z axis
Returns:
array containing the positions

Definition at line 63 of file ZGridDrawerGL.java.

References org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::findLowerZCoordinate(), org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::findOtherXBound(), org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::findOtherYBound(), getGridStartingPoints(), and org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::isSharingEndWithXaxis().

Referenced by drawGrid().

00063                                                                                        {
00064                 // middle points are on the opposite of  X or Y axis
00065                 double zCoordFront = findLowerZCoordinate();
00066                 
00067                 if (isSharingEndWithXaxis(zCoordFront, xCoordinate)) {
00068                         // inverse y
00069                         return getGridStartingPoints(xCoordinate, findOtherYBound(yCoordinate));
00070                 } else {
00071                         return getGridStartingPoints(findOtherXBound(xCoordinate), yCoordinate);
00072                 }
00073         }

Here is the call graph for this function:

Here is the caller graph for this function:

Vector3D [] org::scilab::modules::renderer::subwinDrawing::ZGridDrawerGL::getGridEndPoints ( double  xCoordinate,
double  yCoordinate 
) [inline, private]

Get the last point to display on the grid line. It is on the opposed edge of the box

Parameters:
xCoordinate X coordinate of the Z axis
yCoordinate Y coordinate of the Z axis
Returns:
array containing the positions

Definition at line 82 of file ZGridDrawerGL.java.

References org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::findOtherXBound(), org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::findOtherYBound(), and getGridStartingPoints().

Referenced by drawGrid().

00082                                                                                     {
00083                 
00084                 return getGridStartingPoints(findOtherXBound(xCoordinate), findOtherYBound(yCoordinate));
00085         }

Here is the call graph for this function:

Here is the caller graph for this function:

void org::scilab::modules::renderer::subwinDrawing::ZGridDrawerGL::drawGrid (  )  [inline, virtual]

Draw the grid with already set positions

Implements org::scilab::modules::renderer::subwinDrawing::GridDrawerGL.

Definition at line 90 of file ZGridDrawerGL.java.

References org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::findLeftMostXCoordinate(), org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::findLeftMostYCoordinate(), getGridEndPoints(), getGridMiddlePoints(), and getGridStartingPoints().

00090                                {
00091 
00092                 double xCoordinate = findLeftMostXCoordinate();
00093                 double yCoordinate = findLeftMostYCoordinate();
00094                 
00095                 Vector3D[] startingPoints = getGridStartingPoints(xCoordinate, yCoordinate);
00096                 Vector3D[] middlePoints = getGridMiddlePoints(xCoordinate, yCoordinate);
00097                 Vector3D[] endPoints = getGridEndPoints(xCoordinate, yCoordinate);
00098                 
00099                 drawGrid(startingPoints, middlePoints, endPoints);
00100                 
00101         }

Here is the call graph for this function:


The documentation for this class was generated from the following file:
Generated on Sun Apr 27 16:26:05 2008 for Scilab [trunk] by  doxygen 1.5.4