@@ -89,6 +89,7 @@ class Viewer_impl {
8989 bool extension_is_found;
9090 int pass;
9191 int total_pass;
92+ int current_total_pass;
9293 TextRenderer *textRenderer;
9394 /* !
9495 * \brief makeArrow creates an arrow and stores it in a struct of vectors.
@@ -128,7 +129,7 @@ class Viewer_impl {
128129 fpsString=Viewer::tr (" %1Hz" , " Frames per seconds, in Hertz" ).arg (" ?" );
129130 distance_is_displayed = false ;
130131 is_d_pressed = false ;
131- total_pass = 4 ;
132+ total_pass = 5 ;
132133 }
133134 void makeArrow (double R, int prec, qglviewer::Vec from, qglviewer::Vec to, qglviewer::Vec color, AxisData &data);
134135 // !Clears the distance display
@@ -232,7 +233,7 @@ void Viewer::setScene(CGAL::Three::Scene_draw_interface* scene)
232233
233234bool Viewer::antiAliasing () const
234235{
235- return d->antialiasing ;
236+ return d->antialiasing ;
236237}
237238
238239void Viewer::setAntiAliasing (bool b)
@@ -263,7 +264,7 @@ bool Viewer::inFastDrawing() const
263264}
264265
265266void Viewer::draw ()
266- {
267+ {
267268 glEnable (GL_DEPTH_TEST);
268269 d->draw_aux (false , this );
269270}
@@ -538,7 +539,7 @@ void Viewer::initializeGL()
538539void Viewer::mousePressEvent (QMouseEvent* event)
539540{
540541 if (event->button () == Qt::RightButton &&
541- event->modifiers ().testFlag (Qt::ShiftModifier))
542+ event->modifiers ().testFlag (Qt::ShiftModifier))
542543 {
543544 select (event->pos ());
544545 requestContextMenu (event->globalPos ());
@@ -688,7 +689,7 @@ void Viewer_impl::draw_aux(bool with_names, Viewer* viewer)
688689{
689690 if (scene == 0 )
690691 return ;
691- total_pass = viewer->inFastDrawing () ? 3 : 6 ;
692+ current_total_pass = viewer->inFastDrawing () ? total_pass/ 2 : total_pass ;
692693 viewer->glLineWidth (1 .0f );
693694 viewer->glPointSize (2 .f );
694695 viewer->glEnable (GL_POLYGON_OFFSET_FILL);
@@ -796,7 +797,7 @@ QString CGAL::Three::Viewer_interface::dumpFrame(const qglviewer::Frame& frame)
796797bool Viewer::moveCameraToCoordinates (QString s, float animation_duration) {
797798 qglviewer::Frame new_frame;
798799 if (readFrame (s, new_frame)) {
799- camera ()->interpolateTo (new_frame, animation_duration);
800+ camera ()->interpolateTo (new_frame, animation_duration);
800801 return true ;
801802 }
802803 else
@@ -1740,12 +1741,13 @@ void Viewer::enableClippingBox(QVector4D box[6])
17401741
17411742float Viewer::total_pass ()
17421743{
1743- return d->total_pass * 1 .0f ;
1744+ return d->current_total_pass * 1 .0f ;
17441745}
17451746
17461747void Viewer::setTotalPass (int p)
17471748{
17481749 d->total_pass = p;
1750+ update ();
17491751}
17501752bool Viewer::isOpenGL_4_3 () const { return d->is_ogl_4_3 ; }
17511753
@@ -1787,6 +1789,9 @@ void Viewer::setLighting_clicked()
17871789
17881790void Viewer::setTotalPass_clicked ()
17891791{
1790-
1791-
1792+ bool ok;
1793+ int passes = QInputDialog::getInt (0 , QString (" Set Number of Passes" ), QString (" Number of Depth Peeling Passes: " ), 4 , 2 ,100 , 1 , &ok);
1794+ if (!ok)
1795+ return ;
1796+ setTotalPass (passes);
17921797}
0 commit comments