Implementing a Zoom To previous/Zoom Next functionality
Posted: Thu Nov 09, 2017 5:24 am
hi Daniel,
I was thinking of implementing a functionality that lets users undo the zoom and pan operations. Sometimes we hit the zoom to whole cloud extent or do several pan/zoom it would be good if we could just go back to the extent where it was. My idea was to store the camera parameter for the last 10 views and move back and forth between them using "View Previous/View Next" buttons in some toolbar.
Browsing the source, I found the zoom is handled here..
and pan is handled here..
So an array inside ccGLWindow could possible store these camera parameters.
The issue that i noticed was that when mousewheel is scrolled, the zoom is activated for each movement of the wheel. For example the user does a huge scroll fast, this method could get called about 10 times in a second like shown below. So something that lets us know that user has not finished his scrolling/panning would be helpful in storing these intermediate values.
Please share your views.
thanks
Vinayan
I was thinking of implementing a functionality that lets users undo the zoom and pan operations. Sometimes we hit the zoom to whole cloud extent or do several pan/zoom it would be good if we could just go back to the extent where it was. My idea was to store the camera parameter for the last 10 views and move back and forth between them using "View Previous/View Next" buttons in some toolbar.
Browsing the source, I found the zoom is handled here..
Code: Select all
void ccGLWindow::setZoom(float value)
Code: Select all
void ccGLWindow::setCameraPos(const CCVector3d& P)
The issue that i noticed was that when mousewheel is scrolled, the zoom is activated for each movement of the wheel. For example the user does a huge scroll fast, this method could get called about 10 times in a second like shown below. So something that lets us know that user has not finished his scrolling/panning would be helpful in storing these intermediate values.
Please share your views.
thanks
Vinayan