1 /*
2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2008 - INRIA - Jean-Baptiste Silvy
4 * Copyright (C) 2010 - DIGITEO - Manuel Juliachs
5 * Copyright (C) 2011 - DIGITEO - Vincent Couvert
6 *
7 * Copyright (C) 2012 - 2016 - Scilab Enterprises
8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
11 * This file was originally licensed under the terms of the CeCILL v2.1,
12 * and continues to be available under such terms.
13 * For more information, see the COPYING file which you should have received
14 * along with this program.
15 *
16 */
17
18 /*------------------------------------------------------------------------*/
19 /* file: get_drawing_method_property.c */
20 /* desc : function to retrieve in Scilab the drawing_method field of */
21 /* a handle */
22 /*------------------------------------------------------------------------*/
23
24 #include "getHandleProperty.h"
25 #include "GetProperty.h"
26 #include "returnProperty.h"
27 #include "Scierror.h"
28 #include "localization.h"
29
30 #include "getGraphicObjectProperty.h"
31 #include "graphicObjectProperties.h"
32
33 /*------------------------------------------------------------------------*/
get_arc_drawing_method_property(void * _pvCtx,int iObjUID)34 void* get_arc_drawing_method_property(void* _pvCtx, int iObjUID)
35 {
36 int iArcDrawingMethod = 0;
37 int* piArcDrawingMethod = &iArcDrawingMethod;
38
39 getGraphicObjectProperty(iObjUID, __GO_ARC_DRAWING_METHOD__, jni_int, (void **)&piArcDrawingMethod);
40
41 if (piArcDrawingMethod == NULL)
42 {
43 Scierror(999, _("'%s' property does not exist for this handle.\n"), "arc_drawing_method");
44 return NULL;
45 }
46
47 /* 0: nurbs, 1: lines */
48 if (iArcDrawingMethod == 0)
49 {
50 return sciReturnString("nurbs");
51 }
52 else if (iArcDrawingMethod == 1)
53 {
54 return sciReturnString("lines");
55 }
56 else
57 {
58 Scierror(999, _("Wrong value for '%s' property.\n"), "arc_drawing_method");
59 return NULL;
60 }
61 }
62 /*------------------------------------------------------------------------*/
63