Interface margins and axes bounds properties.
[scilab.git] / scilab / modules / renderer / src / cpp / subwinDrawing / DrawableSubwin.cpp
1 /*------------------------------------------------------------------------*/
2 /* file: DrawableSubwin.cpp                                               */
3 /* Copyright INRIA 2007                                                   */
4 /* Authors : Jean-Baptiste Silvy                                          */
5 /* desc : Class containing the drawing routine for a subwin object        */
6 /*------------------------------------------------------------------------*/
7
8 #include "DrawableSubwin.h"
9 #include "DrawableSubwinBridge.h"
10
11 extern "C"
12 {
13 #include "GetProperty.h"
14 }
15
16 namespace sciGraphics
17 {
18
19 /*------------------------------------------------------------------------------------------*/
20 DrawableSubwin::DrawableSubwin(sciPointObj * pObj) : DrawableClippedObject(pObj)
21 {
22   m_pCamera = NULL ;
23 }
24 /*------------------------------------------------------------------------------------------*/
25 DrawableSubwin::~DrawableSubwin( void )
26 {
27   if ( m_pCamera != NULL )
28   {
29     delete m_pCamera ;
30   }
31   m_pCamera = NULL;
32 }
33 /*------------------------------------------------------------------------------------------*/
34 void DrawableSubwin::draw( void )
35 {
36   //initializeDrawing() ;
37   //if ( !checkVisibility() )
38   //{
39   //  endDrawing();
40   //  return;
41   //}
42   m_pCamera->setViewingArea(sciGetAxesBounds(m_pDrawed), sciGetMargins(m_pDrawed)) ;
43
44   double bounds[6] ;
45   sciGetRealDataBounds(m_pDrawed, bounds) ;
46   m_pCamera->setSubwinBox(bounds) ;
47   m_pCamera->renderPosition();
48   displayChildren() ;
49   //endDrawing();
50 }
51 /*------------------------------------------------------------------------------------------*/
52 void DrawableSubwin::show( void )
53 {
54   draw() ;
55 }
56 /*------------------------------------------------------------------------------------------*/
57 DrawableSubwinBridge * DrawableSubwin::getSubwinImp( void )
58 {
59   return dynamic_cast<DrawableSubwinBridge *>(m_pImp) ;
60 }
61 /*------------------------------------------------------------------------------------------*/
62
63 }