

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 |
Definition at line 29 of file ArcFillDrawerGL.java.
| 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 }
| void org::scilab::modules::renderer::arcDrawing::ArcFillDrawerGL::setUseNurbs | ( | boolean | useNurbs | ) | [inline] |
Specify wheter we should use nurbs or a polyline to draw the arc.
| 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
| 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 }

| 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 }

| 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 }


| 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.
Reimplemented from org::scilab::modules::renderer::drawers::FillDrawerGL.
Definition at line 136 of file ArcFillDrawerGL.java.
References isZconstant.
00136 { 00137 return isZconstant; 00138 }
boolean org::scilab::modules::renderer::arcDrawing::ArcFillDrawerGL::useNurbs [private] |
boolean org::scilab::modules::renderer::arcDrawing::ArcFillDrawerGL::isZconstant [private] |
1.5.5