\param sender - object to be updated
\param zoom - zoom coefficient
*/
-void GLViewer_Group::updateZoom( GLViewer_Object* sender, float zoom )
+void GLViewer_Group::updateXZoom( GLViewer_Object* sender, float zoom )
{
OGIterator it = myList.begin();
OGIterator end_it = myList.end();
{
GLViewer_Object* anObject = *it;
if( anObject != sender )
- anObject->setZoom( zoom, true, true );
+ anObject->setXZoom( zoom, true, true );
}
}
\param sender - object to be updated
\param zoom - zoom coefficient
*/
-void GLViewer_Group::updateYZoom( 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->setYZoom( 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 updateZoom( GLViewer_Object* sender, float zoom );
+ void updateXZoom( GLViewer_Object* sender, float zoom );
//!\warning it is for ouv
- void updateYZoom( GLViewer_Object* sender, float zoom );
+ void updateZoom( GLViewer_Object* sender, float zoom );
private:
//! List of objects
int mySelObjNum;
};
-#endif //GLVIEWER_GROUP_H
+#endif
myYScale = 1.0;
myXGap = 0;
myYGap = 0;
+ myXZoom = 1.0;
myZoom = 1.0;
- myYZoom = 1.0;
myIsHigh = GL_FALSE;
myIsSel = GL_FALSE;
Sets horizontal zoom factor
\param zoom - zoom factor
*/
-GLboolean GLViewer_Object::setZoom( GLfloat zoom, bool, bool )
+GLboolean GLViewer_Object::setXZoom( GLfloat zoom, bool, bool )
{
- if( myZoom == zoom )
+ if( myXZoom == zoom )
return GL_FALSE;
- myZoom = zoom;
+ myXZoom = zoom;
return GL_TRUE;
}
Performs horizontal zoom change by step
\param zoomIn - to increase to decrease zoom
*/
-GLboolean GLViewer_Object::updateZoom( bool zoomIn )
+GLboolean GLViewer_Object::updateXZoom( bool zoomIn )
{
float newZoom;
float step = zoomIn ? 1 : -1;
double epsilon = 0.001;
- if( myZoom - 1 > epsilon )
- newZoom = ( myZoom * 2 + step ) / 2;
- else if( 1 - myZoom > epsilon )
- newZoom = 2 / ( 2 / myZoom - step );
+ if( myXZoom - 1 > epsilon )
+ newZoom = ( myXZoom * 2 + step ) / 2;
+ else if( 1 - myXZoom > epsilon )
+ newZoom = 2 / ( 2 / myXZoom - step );
else
newZoom = zoomIn ? 3./2. : 2./3.;
if( newZoom < 0.01 || newZoom > 100.0 )
return GL_FALSE;
- return setZoom( newZoom, true );
+ return setXZoom( newZoom, true );
}
/*!
Sets vertical zoom factor
\param zoom - zoom factor
*/
-GLboolean GLViewer_Object::setYZoom( GLfloat zoom, bool, bool )
+GLboolean GLViewer_Object::setZoom( GLfloat zoom, bool, bool )
{
- if( myYZoom == zoom )
+ if( myZoom == zoom )
return GL_FALSE;
- myYZoom = zoom;
+ myZoom = zoom;
return GL_TRUE;
}
Performs vertical zoom change by step
\param zoomIn - to increase to decrease zoom
*/
-GLboolean GLViewer_Object::updateYZoom( bool zoomIn )
+GLboolean GLViewer_Object::updateZoom( bool zoomIn )
{
float newZoom;
float step = zoomIn ? 1 : -1;
double epsilon = 0.001;
- if( myYZoom - 1 > epsilon )
- newZoom = ( myYZoom * 2 + step ) / 2;
- else if( 1 - myYZoom > epsilon )
- newZoom = 2 / ( 2 / myYZoom - 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 setYZoom( 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 setZoom( GLfloat zoom, bool recompute, bool fromGroup = false );
+ virtual GLboolean setXZoom( GLfloat zoom, bool recompute, bool fromGroup = false );
//!\warning It is for ouv
- virtual GLfloat getZoom() const { return myZoom; }
+ virtual GLfloat getXZoom() const { return myXZoom; }
//!\warning It is for ouv
- virtual GLboolean updateZoom( bool zoomIn );
+ virtual GLboolean updateXZoom( bool zoomIn );
//!\warning It is for ouv
- virtual GLboolean setYZoom( GLfloat yoom, bool recompute, bool fromGroup = false );
+ virtual GLboolean setZoom( GLfloat yoom, bool recompute, bool fromGroup = false );
//!\warning It is for ouv
- virtual GLfloat getYZoom() const { return myYZoom; }
+ virtual GLfloat getZoom() const { return myZoom; }
//!\warning It is for ouv
- virtual GLboolean updateYZoom( bool zoomIn );
+ virtual GLboolean updateZoom( bool zoomIn );
//! Returns true if object is highlighted
virtual GLboolean isHighlighted() const { return myIsHigh; }
GLfloat myYGap;
//!\warning It is for ouv
- GLfloat myZoom;
+ GLfloat myXZoom;
//!\warning It is for ouv
- GLfloat myYZoom;
+ GLfloat myZoom;
//! Highlight status
/*! = true after right highlighting*/
#pragma warning ( default:4251 )
#endif
-#endif
+#endif
\ No newline at end of file
{
GLViewer_Object* anObject = myGLContext->SelectedObject();
if( e->state() & ControlButton )
- update = anObject->updateZoom( zoomIn ) || update;
+ update = anObject->updateXZoom( zoomIn ) || update;
else
- update = anObject->updateYZoom( zoomIn ) || update;
+ update = anObject->updateZoom( zoomIn ) || update;
}
emit wheelZoomChange( zoomIn );