org::scilab::modules::renderer::surfaceDrawing::SurfaceLineDrawerGL Class Reference

Inheritance diagram for org::scilab::modules::renderer::surfaceDrawing::SurfaceLineDrawerGL:

Inheritance graph
[legend]
Collaboration diagram for org::scilab::modules::renderer::surfaceDrawing::SurfaceLineDrawerGL:

Collaboration graph
[legend]

Public Member Functions

 SurfaceLineDrawerGL ()
void setSurfaceType (int typeOfSurface)
void drawSurface (double[] xCoords, double[] yCoords, double[] zCoords, int nbVertices)
void drawSurface ()

Private Attributes

SurfaceDecomposer decomposer
int nbVertices

Detailed Description

Class containing the driver dependant routines to draw lines surrounding facets of a surface object.
Author:
Jean-Baptiste Silvy

Definition at line 29 of file SurfaceLineDrawerGL.java.


Constructor & Destructor Documentation

org::scilab::modules::renderer::surfaceDrawing::SurfaceLineDrawerGL::SurfaceLineDrawerGL (  )  [inline]

Default constructor

Definition at line 40 of file SurfaceLineDrawerGL.java.

00040                                      {
00041                 super();
00042         }


Member Function Documentation

void org::scilab::modules::renderer::surfaceDrawing::SurfaceLineDrawerGL::setSurfaceType ( int  typeOfSurface  )  [inline]

Specify the kind of surface to use

Parameters:
typeOfSurface type of surface (ie Plot3d or Fac3d)

Definition at line 48 of file SurfaceLineDrawerGL.java.

References org::scilab::modules::renderer::surfaceDrawing::SurfaceDecomposer::create(), and decomposer.

00048                                                       {
00049                 decomposer = SurfaceDecomposer.create(typeOfSurface);
00050         }

Here is the call graph for this function:

void org::scilab::modules::renderer::surfaceDrawing::SurfaceLineDrawerGL::drawSurface ( double[]  xCoords,
double[]  yCoords,
double[]  zCoords,
int  nbVertices 
) [inline]

Specify the positions of each vertices and raw the surface

Parameters:
xCoords array of size nbFacet * nbVertices
yCoords array of size nbFacet * nbVertices
zCoords array of size nbFacet * nbVertices
nbVertices number of vertices for each facet

Definition at line 59 of file SurfaceLineDrawerGL.java.

References decomposer, drawSurface(), and org::scilab::modules::renderer::surfaceDrawing::SurfaceDecomposer::setFacetsPositions().

00059                                                                                                       {
00060         
00061                 decomposer.setFacetsPositions(xCoords, yCoords, zCoords, nbVertices);
00062                 this.nbVertices = nbVertices;
00063                 drawSurface();
00064                 decomposer = null;
00065         }

Here is the call graph for this function:

void org::scilab::modules::renderer::surfaceDrawing::SurfaceLineDrawerGL::drawSurface ( void   )  [inline]

Draw the lines of the surface

Definition at line 70 of file SurfaceLineDrawerGL.java.

References decomposer, org::scilab::modules::renderer::ObjectGL::getGL(), org::scilab::modules::renderer::drawers::LineDrawerGL::getLineColor(), org::scilab::modules::renderer::drawers::LineDrawerGL::getLineStyle(), org::scilab::modules::renderer::drawers::LineDrawerGL::getThickness(), i, and nbVertices.

Referenced by drawSurface().

00070                                   {
00071                 GL gl = getGL();
00072                 
00073                 double[] color = getLineColor();
00074                 gl.glColor3d(color[0], color[1], color[2]);
00075                 
00076                 GLTools.beginDashMode(gl, getLineStyle(), getThickness());
00077                 
00078                 gl.glBegin(GL.GL_LINES);
00079                 while (decomposer.hasNext()) {
00080                         
00081                         // find position of the facet
00082                         Vector3D[] curFacetPos = decomposer.next();
00083                         
00084                         // draw the lines composing the facet
00085                         if (curFacetPos != null) {
00086                                 for (int i = 0; i < nbVertices - 1; i++) {
00087                                         gl.glVertex3d(curFacetPos[i].getX(), curFacetPos[i].getY(), curFacetPos[i].getZ());
00088                                         gl.glVertex3d(curFacetPos[i + 1].getX(), curFacetPos[i + 1].getY(), curFacetPos[i + 1].getZ());
00089                                 }
00090                         
00091                                 // last line
00092                                 gl.glVertex3d(curFacetPos[nbVertices - 1].getX(),
00093                                                           curFacetPos[nbVertices - 1].getY(),
00094                                                           curFacetPos[nbVertices - 1].getZ());
00095                                 gl.glVertex3d(curFacetPos[0].getX(), curFacetPos[0].getY(), curFacetPos[0].getZ());
00096                         }
00097                         
00098                 }
00099                 
00100                 gl.glEnd();
00101                 
00102                 GLTools.endDashMode(gl);
00103         }

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

Definition at line 32 of file SurfaceLineDrawerGL.java.

Referenced by drawSurface(), and setSurfaceType().

Number of vertice per facet

Definition at line 35 of file SurfaceLineDrawerGL.java.

Referenced by drawSurface().


The documentation for this class was generated from the following file:

Generated on Tue Sep 9 18:29:19 2008 for Scilab [trunk] by  doxygen 1.5.5