org::scilab::modules::renderer::arcDrawing::ArcFillDrawerGL Class Reference

Inheritance diagram for org::scilab::modules::renderer::arcDrawing::ArcFillDrawerGL:

Inheritance graph
[legend]
Collaboration diagram for org::scilab::modules::renderer::arcDrawing::ArcFillDrawerGL:

Collaboration graph
[legend]

Public Member Functions

 ArcFillDrawerGL ()
void setUseNurbs (boolean useNurbs)
void drawArc (double centerX, double centerY, double centerZ, double semiMinorAxisX, double semiMinorAxisY, double semiMinorAxisZ, double semiMajorAxisX, double semiMajorAxisY, double semiMajorAxisZ, double startAngle, double endAngle)
void redrawArc ()
void drawArc ()
boolean isZConstant ()

Private Attributes

ArcFillTools drawer
boolean useNurbs
boolean isZconstant

Detailed Description

Class containing the driver dependant routines to draw inside of an arc object.
Author:
Jean-Baptiste Silvy

Definition at line 29 of file ArcFillDrawerGL.java.


Constructor & Destructor Documentation

org::scilab::modules::renderer::arcDrawing::ArcFillDrawerGL::ArcFillDrawerGL (  )  [inline]

Default constructor

Definition at line 41 of file ArcFillDrawerGL.java.

References drawer.

00041                                  {
00042                 super();
00043                 drawer = null;
00044         }


Member Function Documentation

void org::scilab::modules::renderer::arcDrawing::ArcFillDrawerGL::setUseNurbs ( boolean  useNurbs  )  [inline]

Specify wheter we should use nurbs or a polyline to draw the arc.

Parameters:
useNurbs if true nurbs are used

Definition at line 50 of file ArcFillDrawerGL.java.

00050                                                   {
00051                 this.useNurbs = useNurbs;
00052                 this.isZconstant = false;
00053         }

void org::scilab::modules::renderer::arcDrawing::ArcFillDrawerGL::drawArc ( double  centerX,
double  centerY,
double  centerZ,
double  semiMinorAxisX,
double  semiMinorAxisY,
double  semiMinorAxisZ,
double  semiMajorAxisX,
double  semiMajorAxisY,
double  semiMajorAxisZ,
double  startAngle,
double  endAngle 
) [inline]

create the display list for the arc

Parameters:
centerX X coordinate of the arc center
centerY Y coordinate of the arc center
centerZ Z coordinate of the arc center
semiMinorAxisX X coordinate of the ellipse minor axis
semiMinorAxisY Y coordinate of the ellipse minor axis
semiMinorAxisZ Z coordinate of the ellipse minor axis
semiMajorAxisX X coordinate of the ellipse major axis
semiMajorAxisY Y coordinate of the ellipse minor axis
semiMajorAxisZ Z coordinate of the ellipse minor axis
startAngle lowest angle in radian, relative to the semi-major axis of the ellipse. Start of the angular part to draw.
endAngle highest angle in radian, relative to the semi-major axis of the ellipse. End of the angular part to draw

Implements org::scilab::modules::renderer::arcDrawing::ArcDrawerStrategy.

Definition at line 71 of file ArcFillDrawerGL.java.

References org::scilab::modules::renderer::arcDrawing::ArcRendererFactory::createArcFillRenderer(), drawArc(), drawer, org::scilab::modules::renderer::figureDrawing::DrawableFigureGL::getArcRendererFactory(), org::scilab::modules::renderer::ObjectGL::getParentFigureGL(), isZconstant, and useNurbs.

00074                                                                                     {
00075                 
00076                 Vector3D center = new Vector3D(centerX, centerY, centerZ);
00077                 Vector3D semiMinorAxis = new Vector3D(semiMinorAxisX, semiMinorAxisY, semiMinorAxisZ);
00078                 Vector3D semiMajorAxis = new Vector3D(semiMajorAxisX, semiMajorAxisY, semiMajorAxisZ);
00079         
00080                 // check if Z is constant
00081                 if (semiMajorAxisZ == 0.0 && semiMajorAxisZ == 0.0) {
00082                         isZconstant = true;
00083                 } else {
00084                         isZconstant = false;
00085                 }
00086                 
00087                 ArcRendererFactory arcFactory = null;
00088                 if (useNurbs) {
00089                         arcFactory = getParentFigureGL().getArcRendererFactory();
00090                         
00091                 } else {
00092                         // use lines in any case
00093                         arcFactory = new FastArcRendererFactory();
00094                 }
00095                 drawer = arcFactory.createArcFillRenderer(center, semiMinorAxis, semiMajorAxis, startAngle, endAngle);
00096                 drawArc();
00097                 
00098         }

Here is the call graph for this function:

void org::scilab::modules::renderer::arcDrawing::ArcFillDrawerGL::redrawArc ( void   )  [inline]

Redraw the arc using precomputed data

Definition at line 103 of file ArcFillDrawerGL.java.

References drawArc(), org::scilab::modules::renderer::ObjectGL::getParentFigureGL(), org::scilab::modules::renderer::AutoDrawableObjectGL::show(), and useNurbs.

00103                                 {
00104                 if (useNurbs) {
00105                         // with nurbs, arc drawing must adapt when view changes
00106                         drawArc();
00107                 } else {
00108                         show(getParentFigureGL().getFigureId());
00109                 }
00110         }

Here is the call graph for this function:

void org::scilab::modules::renderer::arcDrawing::ArcFillDrawerGL::drawArc ( void   )  [inline]

Call gl routine to draw to the inside of the arc.

Definition at line 115 of file ArcFillDrawerGL.java.

References org::scilab::modules::renderer::arcDrawing::ArcFillTools::beginRendering(), org::scilab::modules::renderer::arcDrawing::ArcTools::drawCircle(), drawer, org::scilab::modules::renderer::utils::CoordinateTransformation::endPushPolygonsBack(), org::scilab::modules::renderer::arcDrawing::ArcFillTools::endRendering(), org::scilab::modules::renderer::drawers::FillDrawerGL::getBackColor(), org::scilab::modules::renderer::figureDrawing::DrawableFigureGL::getCoordinateTransformation(), org::scilab::modules::renderer::ObjectGL::getGL(), org::scilab::modules::renderer::ObjectGL::getParentFigureGL(), and org::scilab::modules::renderer::utils::CoordinateTransformation::pushPolygonsBack().

Referenced by drawArc(), and redrawArc().

00115                               {
00116                 GL gl = getGL();
00117                 
00118                 // push polygons back if needed
00119                 CoordinateTransformation transform = getParentFigureGL().getCoordinateTransformation();
00120                 transform.pushPolygonsBack(gl, this);
00121                 
00122                 drawer.beginRendering(gl, getBackColor());
00123                 drawer.drawCircle(gl);
00124                 drawer.endRendering(gl);
00125                 
00126                 transform.endPushPolygonsBack(gl, this);
00127                 
00128         }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean org::scilab::modules::renderer::arcDrawing::ArcFillDrawerGL::isZConstant (  )  [inline]

This method is used to know if polygon offset is needed in 2d mode. If this function returns true, then the polygon offset is not needed in 2d mode. If it returns false, polygon offset is always needed.

Returns:
true if the object is flat along Z coordinate

Reimplemented from org::scilab::modules::renderer::drawers::FillDrawerGL.

Definition at line 136 of file ArcFillDrawerGL.java.

References isZconstant.

00136                                      {
00137                 return isZconstant;
00138         }


Field Documentation

Definition at line 32 of file ArcFillDrawerGL.java.

Referenced by ArcFillDrawerGL(), and drawArc().

Definition at line 34 of file ArcFillDrawerGL.java.

Referenced by drawArc(), and redrawArc().

Definition at line 36 of file ArcFillDrawerGL.java.

Referenced by drawArc(), and isZConstant().


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

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