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

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

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

Collaboration graph
[legend]

Public Member Functions

 ZTicksDrawerGL ()
Vector3D findTicksDirection (double xCoordinate, double yCoordinate)
double drawTicks ()

Protected Member Functions

Vector3D getAxisSegmentStart (double xCoordinate, double yCoordinate)
Vector3D getAxisSegmentEnd (double xCoordinate, double yCoordinate)
Vector3D[] getTicksPositions (double xCoordinate, double yCoordinate)
Vector3D[] getSubTicksPositions (double xCoordinate, double yCoordinate)

Private Member Functions

Vector3D[] getTicksPosition (double xCoordinate, double yCoordinate, double[] zCoordinates)

Detailed Description

Class drawing ticks for the Z axis
Author:
Jean-Baptiste Silvy

Definition at line 25 of file ZTicksDrawerGL.java.


Constructor & Destructor Documentation

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

Default constructor

Definition at line 30 of file ZTicksDrawerGL.java.

00030                                 {
00031                 super();
00032         }


Member Function Documentation

Vector3D org::scilab::modules::renderer::subwinDrawing::ZTicksDrawerGL::getAxisSegmentStart ( double  xCoordinate,
double  yCoordinate 
) [inline, protected]

Parameters:
xCoordinate X coordinate of the Z axis
yCoordinate Y coordinate of the Z axis
Returns:
one of the axis segment edge

Definition at line 39 of file ZTicksDrawerGL.java.

References org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::getZmin().

Referenced by drawTicks().

00039                                                                                        {
00040                 return new Vector3D(xCoordinate, yCoordinate, getZmin());
00041         }

Here is the call graph for this function:

Here is the caller graph for this function:

Vector3D org::scilab::modules::renderer::subwinDrawing::ZTicksDrawerGL::getAxisSegmentEnd ( double  xCoordinate,
double  yCoordinate 
) [inline, protected]

Parameters:
xCoordinate X coordinate of the Z axis
yCoordinate Y coordinate of the Z axis
Returns:
the other axis segment edge

Definition at line 48 of file ZTicksDrawerGL.java.

References org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::getZmax().

Referenced by drawTicks().

00048                                                                                      {
00049                 return new Vector3D(xCoordinate, yCoordinate, getZmax());
00050         }

Here is the call graph for this function:

Here is the caller graph for this function:

Vector3D org::scilab::modules::renderer::subwinDrawing::ZTicksDrawerGL::findTicksDirection ( double  xCoordinate,
double  yCoordinate 
) [inline]

Parameters:
xCoordinate X coordinate of the Z axis
yCoordinate Y coordinate of the Z axis
Returns:
direction in which to draw the ticks

Definition at line 57 of file ZTicksDrawerGL.java.

References org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::findZTicksDirection(), res, and org::scilab::modules::renderer::subwinDrawing::TicksDrawerGL::setTicksDirectionLength().

Referenced by drawTicks().

00057                                                                                    {
00058                 Vector3D res = findZTicksDirection(xCoordinate, yCoordinate);
00059                 
00060                 return setTicksDirectionLength(res);
00061                 
00062         }

Here is the call graph for this function:

Here is the caller graph for this function:

Vector3D [] org::scilab::modules::renderer::subwinDrawing::ZTicksDrawerGL::getTicksPosition ( double  xCoordinate,
double  yCoordinate,
double[]  zCoordinates 
) [inline, private]

Compute ticks positions from an array of Y coordinates

Parameters:
xCoordinate X coordinates common for all ticks
yCoordinate Y coordinates common for all ticks
zCoordinates Z coordinates of ticks
Returns:
array of vector with only displayable ticks

Definition at line 71 of file ZTicksDrawerGL.java.

References org::scilab::modules::renderer::utils::CoordinateTransformation::getCanvasCoordinates(), org::scilab::modules::renderer::ObjectGL::getGL(), org::scilab::modules::renderer::subwinDrawing::TicksDrawerGL::getTransform(), org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::getYmax(), org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::getYmin(), and res.

Referenced by getSubTicksPositions(), and getTicksPositions().

00071                                                                                                            {
00072                 int nbTicks = zCoordinates.length;
00073                 Vector3D[] res = new Vector3D[nbTicks];
00074                 
00075                 GL gl = getGL();
00076                 
00077                 for (int i = 0; i < nbTicks; i++) {
00078                         double zCoordinate = zCoordinates[i];
00079                         // remove ticks wich are out of bounds
00080                         if (yCoordinate <= getYmax() && yCoordinate >= getYmin()) {
00081                                 res[i] = new Vector3D(xCoordinate, yCoordinate, zCoordinate);
00082                                 res[i] = getTransform().getCanvasCoordinates(gl, res[i]);
00083                         } else {
00084                                 res[i] = null;
00085                         }
00086                 }
00087 
00088                 return res;
00089         }

Here is the call graph for this function:

Here is the caller graph for this function:

Vector3D [] org::scilab::modules::renderer::subwinDrawing::ZTicksDrawerGL::getTicksPositions ( double  xCoordinate,
double  yCoordinate 
) [inline, protected]

Get the base of each ticks segment.

Parameters:
xCoordinate X coordinate of the Z axis
yCoordinate Y coordinate of the Z axis
Returns:
array containing the base of each ticks

Definition at line 97 of file ZTicksDrawerGL.java.

References getTicksPosition(), and org::scilab::modules::renderer::subwinDrawing::TicksDrawerGL::getTicksPositions().

00097                                                                                        {
00098                 return getTicksPosition(xCoordinate, yCoordinate, getTicksPositions());
00099         }

Here is the call graph for this function:

Vector3D [] org::scilab::modules::renderer::subwinDrawing::ZTicksDrawerGL::getSubTicksPositions ( double  xCoordinate,
double  yCoordinate 
) [inline, protected]

Get the base of each ticks segment.

Parameters:
xCoordinate X coordinate of the Z axis
yCoordinate Y coordinate of the Z axis
Returns:
array containing the base of each subticks

Definition at line 107 of file ZTicksDrawerGL.java.

References org::scilab::modules::renderer::subwinDrawing::TicksDrawerGL::getSubTicksPositions(), and getTicksPosition().

00107                                                                                           {
00108                 return getTicksPosition(xCoordinate, yCoordinate, getSubTicksPositions());
00109         }

Here is the call graph for this function:

double org::scilab::modules::renderer::subwinDrawing::ZTicksDrawerGL::drawTicks ( void   )  [inline, virtual]

Returns:
maximum distance from ticks to the axis.Draw ticks from the recorded data.

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

Definition at line 114 of file ZTicksDrawerGL.java.

References org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::findLeftMostXCoordinate(), org::scilab::modules::renderer::subwinDrawing::BoxTrimmingObjectGL::findLeftMostYCoordinate(), findTicksDirection(), getAxisSegmentEnd(), getAxisSegmentStart(), org::scilab::modules::renderer::utils::CoordinateTransformation::getCanvasCoordinates(), org::scilab::modules::renderer::ObjectGL::getGL(), org::scilab::modules::renderer::subwinDrawing::TicksDrawerGL::getSubTicksPositions(), org::scilab::modules::renderer::subwinDrawing::TicksDrawerGL::getTicksPositions(), and org::scilab::modules::renderer::subwinDrawing::TicksDrawerGL::getTransform().

00114                                   {
00115                 double yCoordinate = findLeftMostYCoordinate();
00116                 double xCoordinate = findLeftMostXCoordinate();
00117                 
00118                 Vector3D[] ticksPosition = getTicksPositions(xCoordinate, yCoordinate);
00119                 Vector3D[] subticksPosition = getSubTicksPositions(xCoordinate, yCoordinate);
00120                 Vector3D ticksDirection = findTicksDirection(xCoordinate, yCoordinate);
00121                 
00122                 GL gl = getGL();
00123                 Vector3D axisStartPix = getTransform().getCanvasCoordinates(gl, getAxisSegmentStart(xCoordinate, yCoordinate));
00124                 Vector3D axisStartEnd = getTransform().getCanvasCoordinates(gl, getAxisSegmentEnd(xCoordinate, yCoordinate));
00125                 
00126                 return drawTicks(ticksPosition, subticksPosition, ticksDirection,
00127                                          axisStartPix, axisStartEnd);
00128                 
00129         }

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:13 2008 for Scilab [trunk] by  doxygen 1.5.4