[OpendTect_Developers] Clearing confusion between Scene area & View area

Satyaki Maitra satyaki at opendtect.org
Mon Dec 12 06:40:26 CET 2011


Hi All

Sometimes I find people confusing between a View area & Scene area in a 
uiGraphicsView. We have two different functions to access them ( 
uiGraphicsViewBase::getViewArea() & uiGraphicsViewBase::getSceneRect() 
). To explain it better I will take the example of uiFlatViewer.

You must have noticed the thumbnail ( on the left-top part of a 
uiFlatViewer ). It represents the part of the total area you are 
actually viewing. It can be used nicely to show the difference between 
them. In an unzoomed condition both the Scene area and the View area are 
same. But when you zoom in a uiFlatViewer the uiGraphicsScene is 
expanded the times of the zoom factor. But the View area represents the 
part of the Scene which we can see in display. So while the Scene might 
have got bigger the dimensions of the View still remain the same. It 
only changes when the dimensions of the widget itself changes (e.g when 
you resize the window). Thus the function 
uiGraphicsViewBase::getViewArea() will return uiRect(300,400,700,1200). 
Whereas the function uiGraphicsViewBase::getSceneRect() will return 
uiRect(0,0,1000,1500).


Happy Coding
Satyaki

-- 
- Satyaki Maitra
- OpendTect Developer
-
- dGB Earth Sciences
- 304, Gateway Plaza, Hiranandani Gardens,
- Powai, Mumbai 400 076, India
- Phone: +91 22 25704984 , Fax: +91 22 25704977
- Mobile: +91 9930856158
- mailto:satyaki.maitra at opendtect.org
- http://www.opendtect.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: flatview.jpg
Type: image/jpeg
Size: 130242 bytes
Desc: not available
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20111212/33102394/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ViewArea.jpg
Type: image/jpeg
Size: 30052 bytes
Desc: not available
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20111212/33102394/attachment-0001.jpg>


More information about the Developers mailing list