if( mDrawBoxZoom == true )
{
setAutoBufferSwap( false );
qglColor( mPlotBoxZoomColor );
glDrawBuffer( GL_FRONT );
glLogicOp( GL_XOR );
glEnable( GL_COLOR_LOGIC_OP );
glEnable( GL_BLEND );
glBlendEquationEXT( GL_COLOR_LOGIC_OP );
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
glLineWidth( 2.0 );
// Draw back over the previously drawn box
glBegin( GL_LINE_LOOP );
glVertex3d( mBeginDrawBox[0], mBeginDrawBox[1], 0.0 );
glVertex3d( mBeginDrawBox[0], mOldEndDrawBox[1], 0.0 );
glVertex3d( mOldEndDrawBox[0], mOldEndDrawBox[1], 0.0 );
glVertex3d( mOldEndDrawBox[0], mBeginDrawBox[1], 0.0 );
glEnd( );
// Draw the new box with the current mouse position
glBegin( GL_LINE_LOOP );
glVertex3d( mBeginDrawBox[0], mBeginDrawBox[1], 0.0 );
glVertex3d( mBeginDrawBox[0], mEndDrawBox[1], 0.0 );
glVertex3d( mEndDrawBox[0], mEndDrawBox[1], 0.0 );
glVertex3d( mEndDrawBox[0], mBeginDrawBox[1], 0.0 );
glEnd( );
glFlush( );
glLineWidth( 1.0 );
glDisable( GL_COLOR_LOGIC_OP );
glDisable( GL_BLEND );
glDrawBuffer( GL_BACK );
setAutoBufferSwapping( true );
}
if( mDrawBoxZoom == true )
{
setAutoBufferSwap( false );
qglColor( mPlotBoxZoomColor );
glDrawBuffer( GL_FRONT );
glLogicOp( GL_XOR );
glEnable( GL_COLOR_LOGIC_OP );
glEnable( GL_BLEND );
glBlendEquationEXT( GL_COLOR_LOGIC_OP );
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
glLineWidth( 2.0 );
// Draw back over the previously drawn box
glBegin( GL_LINE_LOOP );
glVertex3d( mBeginDrawBox[0], mBeginDrawBox[1], 0.0 );
glVertex3d( mBeginDrawBox[0], mOldEndDrawBox[1], 0.0 );
glVertex3d( mOldEndDrawBox[0], mOldEndDrawBox[1], 0.0 );
glVertex3d( mOldEndDrawBox[0], mBeginDrawBox[1], 0.0 );
glEnd( );
// Draw the new box with the current mouse position
glBegin( GL_LINE_LOOP );
glVertex3d( mBeginDrawBox[0], mBeginDrawBox[1], 0.0 );
glVertex3d( mBeginDrawBox[0], mEndDrawBox[1], 0.0 );
glVertex3d( mEndDrawBox[0], mEndDrawBox[1], 0.0 );
glVertex3d( mEndDrawBox[0], mBeginDrawBox[1], 0.0 );
glEnd( );
glFlush( );
glLineWidth( 1.0 );
glDisable( GL_COLOR_LOGIC_OP );
glDisable( GL_BLEND );
glDrawBuffer( GL_BACK );
setAutoBufferSwapping( true );
}
To copy to clipboard, switch view to plain text mode
Bookmarks