\param sender - object to be updated
\param zoom - zoom coefficient
*/
-void GLViewer_Group::updateXZoom( GLViewer_Object* sender, float zoom )
+void GLViewer_Group::updateZoom( GLViewer_Object* sender, float zoom )
{
OGIterator it = myList.begin();
OGIterator end_it = myList.end();
{
GLViewer_Object* anObject = *it;
if( anObject != sender )
- anObject->setXZoom( zoom, true, true );
+ anObject->setZoom( zoom, true, true );
}
}
/*! Once = true, if this operation calls only one time for all object*/
void dragingObjects( float x, float y, bool once = false );
//!\warning it is for ouv
- void updateXZoom( GLViewer_Object* sender, float zoom );
+ void updateZoom( GLViewer_Object* sender, float zoom );
//!\warning it is for ouv
void updateYZoom( GLViewer_Object* sender, float zoom );
myYScale = 1.0;
myXGap = 0;
myYGap = 0;
- myXZoom = 1.0;
+ myZoom = 1.0;
myYZoom = 1.0;
myIsHigh = GL_FALSE;
Sets horizontal zoom factor
\param zoom - zoom factor
*/
-GLboolean GLViewer_Object::setXZoom( GLfloat zoom, bool, bool )
+GLboolean GLViewer_Object::setZoom( GLfloat zoom, bool, bool )
{
- if( myXZoom == zoom )
+ if( myZoom == zoom )
return GL_FALSE;
- myXZoom = zoom;
+ myZoom = zoom;
return GL_TRUE;
}
Performs horizontal zoom change by step
\param zoomIn - to increase to decrease zoom
*/
-GLboolean GLViewer_Object::updateXZoom( bool zoomIn )
+GLboolean GLViewer_Object::updateZoom( bool zoomIn )
{
float newZoom;
float step = zoomIn ? 1 : -1;
double epsilon = 0.001;
- if( myXZoom - 1 > epsilon )
- newZoom = ( myXZoom * 2 + step ) / 2;
- else if( 1 - myXZoom > epsilon )
- newZoom = 2 / ( 2 / myXZoom - step );
+ if( myZoom - 1 > epsilon )
+ newZoom = ( myZoom * 2 + step ) / 2;
+ else if( 1 - myZoom > epsilon )
+ newZoom = 2 / ( 2 / myZoom - step );
else
newZoom = zoomIn ? 3./2. : 2./3.;
if( newZoom < 0.01 || newZoom > 100.0 )
return GL_FALSE;
- return setXZoom( newZoom, true );
+ return setZoom( newZoom, true );
}
/*!
virtual void getScale( GLfloat& xScale, GLfloat& yScale ) const { xScale = myXScale; yScale = myYScale;}
//!\warning It is for ouv
- virtual GLboolean setXZoom( GLfloat zoom, bool recompute, bool fromGroup = false );
+ virtual GLboolean setZoom( GLfloat zoom, bool recompute, bool fromGroup = false );
//!\warning It is for ouv
- virtual GLfloat getXZoom() const { return myXZoom; }
+ virtual GLfloat getZoom() const { return myZoom; }
//!\warning It is for ouv
- virtual GLboolean updateXZoom( bool zoomIn );
+ virtual GLboolean updateZoom( bool zoomIn );
//!\warning It is for ouv
virtual GLboolean setYZoom( GLfloat yoom, bool recompute, bool fromGroup = false );
GLfloat myYGap;
//!\warning It is for ouv
- GLfloat myXZoom;
+ GLfloat myZoom;
//!\warning It is for ouv
GLfloat myYZoom;
{
GLViewer_Object* anObject = myGLContext->SelectedObject();
if( e->state() & ControlButton )
- update = anObject->updateXZoom( zoomIn ) || update;
+ update = anObject->updateZoom( zoomIn ) || update;
else
update = anObject->updateYZoom( zoomIn ) || update;
}