dd9b1b760b8165673174d4c6408d7755d458b808
[scilab.git] / scilab / modules / graphics / src / c / getHandleProperty / get_data_bounds_property.c
1 /*------------------------------------------------------------------------*/
2 /* file: get_data_bounds_property.c                                       */
3 /* Copyright INRIA 2006                                                   */
4 /* Authors : Fabrice Leray, Allan Cornet, Jean-Baptiste Silvy             */
5 /* desc : function to retrieve in Scilab the data_bounds field of         */
6 /*        a handle                                                        */
7 /*------------------------------------------------------------------------*/
8
9 #include "getHandleProperty.h"
10 #include "GetProperty.h"
11 #include "returnProperty.h"
12 #include "sciprint.h"
13
14 /*------------------------------------------------------------------------*/
15 int get_data_bounds_property( sciPointObj * pobj )
16 {
17
18   if ( sciGetEntityType(pobj) == SCI_SUBWIN )
19   {
20     /**DJ.Abdemouche 2003**/
21     if ( sciGetIs3d( pobj ) )
22     {
23       return sciReturnMatrix( pSUBWIN_FEATURE (pobj)->SRect, 2, 3 ) ;
24     }
25     else
26     {
27       return sciReturnMatrix( pSUBWIN_FEATURE (pobj)->SRect, 2, 2 ) ;
28     }
29   }
30   else if ( sciGetEntityType (pobj) == SCI_SURFACE )
31   {
32     /* used for what ? F.Leray 20.04.05 */
33     return sciReturnMatrix( pSURFACE_FEATURE (pobj)->ebox, 3, 2 ) ;
34   }
35   else
36   {
37     sciprint("data_bounds property does not exist for this handle.\n");
38     return -1;
39   }
40
41 }
42 /*------------------------------------------------------------------------*/