2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2001-2002 - INRIA - Mathieu Philipe
4 * Copyright (C) 2002-2004 - INRIA - Djalel Abdemouche
5 * Copyright (C) 2004-2006 - INRIA - Fabrice Leray
6 * Copyright (C) 2005 - INRIA - Jean-Baptiste Silvy
7 * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
8 * Copyright (C) 2010 - DIGITEO - Bruno JOFRET
9 * Copyright (C) 2010-2011 - DIGITEO - Manuel Juliachs
11 * Copyright (C) 2012 - 2016 - Scilab Enterprises
13 * This file is hereby licensed under the terms of the GNU GPL v2.0,
14 * pursuant to article 5.3.4 of the CeCILL v.2.1.
15 * This file was originally licensed under the terms of the CeCILL v2.1,
16 * and continues to be available under such terms.
17 * For more information, see the COPYING file which you should have received
18 * along with this program.
22 /*------------------------------------------------------------------------
24 * newGraph Library header
26 * This file contains all functions used to Init or Re-Init the window
27 * (Figure and/or Subwin) to the default graphics properties.
28 --------------------------------------------------------------------------*/
33 #include "os_string.h"
35 #include "InitObjects.h"
36 #include "SetProperty.h"
37 #include "GetProperty.h"
38 #include "DestroyObjects.h"
39 #include "CloneObjects.h"
40 #include "BuildObjects.h"
42 #include "HandleManagement.h"
43 #include "BasicAlgos.h"
45 #include "sci_malloc.h" /* MALLOC */
46 #include "localization.h"
48 #include "createGraphicObject.h"
49 #include "deleteGraphicObject.h"
50 #include "graphicObjectProperties.h"
51 #include "getGraphicObjectProperty.h"
52 #include "setGraphicObjectProperty.h"
54 #include "AxesModel.h"
55 #include "FigureModel.h"
57 #define LABEL_BUFFER_LENGTH 128
59 static char error_message[70]; /* DJ.A 08/01/04 */
61 unsigned short defcolors[] =
63 0, 0, 0, /* Black: DEFAULTBLACK */
65 0, 255, 0, /* Green */
66 0, 255, 255, /* Cyan */
68 255, 0, 255, /* Magenta */
69 255, 255, 0, /* Yellow */
70 255, 255, 255, /* White: DEFAULTWHITE */
71 0, 0, 144, /* Blue4 */
72 0, 0, 176, /* Blue3 */
73 0, 0, 208, /* Blue2 */
74 135, 206, 255, /* LtBlue */
75 0, 144, 0, /* Green4 */
76 0, 176, 0, /* Green3 */
77 0, 208, 0, /* Green2 */
78 0, 144, 144, /* Cyan4 */
79 0, 176, 176, /* Cyan3 */
80 0, 208, 208, /* Cyan2 */
84 144, 0, 144, /* Magenta4 */
85 176, 0, 176, /* Magenta3 */
86 208, 0, 208, /* Magenta2 */
87 128, 48, 0, /* Brown4 */
88 160, 64, 0, /* Brown3 */
89 192, 96, 0, /* Brown2 */
90 255, 128, 128, /* Pink4 */
91 255, 160, 160, /* Pink3 */
92 255, 192, 192, /* Pink2 */
93 255, 224, 224, /* Pink */
94 255, 215, 0 /* Gold */
97 void InitFigureModel(int iFiguremdlUID)
103 int defaultBackground = -2;
104 int m = NUMCOLORS_SCI;
106 double *pdblColorMap = (double*)MALLOC(m * 3 * sizeof(double));
108 int piFigurePosition[2] = { 200, 200 };
109 int piFigureSize[2] = { 620, 590 };
110 int piAxesSize[2] = { 610, 460 };
112 // FIXME : inline this function here ...
114 sciInitGraphicMode(iFiguremdlUID);
116 setGraphicObjectProperty(iFiguremdlUID, __GO_NAME__, _("Graphic window number %d"), jni_string, 1);
119 setGraphicObjectProperty(iFiguremdlUID, __GO_ID__, &iZero, jni_int, 1);
121 // isselected ?? (No more used)
122 // rotstyle = unary (0)
123 setGraphicObjectProperty(iFiguremdlUID, __GO_ROTATION_TYPE__, &iZero, jni_int, 1);
126 setGraphicObjectProperty(iFiguremdlUID, __GO_VISIBLE__, &bTrue, jni_bool, 1);
127 // immediateDrawingMode
128 setGraphicObjectProperty(iFiguremdlUID, __GO_IMMEDIATE_DRAWING__, &bTrue, jni_bool, 1);
130 setGraphicObjectProperty(iFiguremdlUID, __GO_BACKGROUND__, &defaultBackground, jni_int, 1);
132 setGraphicObjectProperty(iFiguremdlUID, __GO_POSITION__, piFigurePosition, jni_int_vector, 2);
134 setGraphicObjectProperty(iFiguremdlUID, __GO_SIZE__, piFigureSize, jni_int_vector, 2);
137 setGraphicObjectProperty(iFiguremdlUID, __GO_AUTORESIZE__, &bTrue, jni_bool, 1);
139 setGraphicObjectProperty(iFiguremdlUID, __GO_AXES_SIZE__, piAxesSize, jni_int_vector, 2);
143 * NULL has been replaced by the empty string as the third argument in order to
144 * avoid a crash due to giws 1.2.4
146 //setGraphicObjectProperty(iFiguremdlUID, __GO_USER_DATA__, "", jni_string, 0);
148 //setGraphicObjectProperty(iFiguremdlUID, __GO_USER_DATA_SIZE__, &iZero, jni_int, 1);
150 setGraphicObjectProperty(iFiguremdlUID, __GO_INFO_MESSAGE__, "", jni_string, 1);
152 setGraphicObjectProperty(iFiguremdlUID, __GO_EVENTHANDLER__, "", jni_string, 1);
153 // Event Handler Enable
154 setGraphicObjectProperty(iFiguremdlUID, __GO_EVENTHANDLER_ENABLE__, &bFalse, jni_bool, 1);
156 setGraphicObjectProperty(iFiguremdlUID, __GO_TAG__, "", jni_string, 1);
158 if (pdblColorMap == NULL)
160 sprintf(error_message, _("%s: No more memory.\n"), "InitFigureModel");
164 for (i = 0; i < m; i++)
166 pdblColorMap[i] = (double)(defcolors[3 * i] / 255.0);
167 pdblColorMap[i + m] = (double)(defcolors[3 * i + 1] / 255.0);
168 pdblColorMap[i + 2 * m] = (double)(defcolors[3 * i + 2] / 255.0);
171 setGraphicObjectProperty(iFiguremdlUID, __GO_COLORMAP__, pdblColorMap, jni_double_vector, 3 * m);
177 setGraphicObjectProperty(iFiguremdlUID, __GO_PARENT__, &parent, jni_int, 1);
181 buildFigureMenuBar(iFiguremdlUID);
185 int C2F(graphicsmodels) (void)
188 double clipRegion[4];
189 int clipRegionSet = 0;
193 int iFiguremdlUID = 0;
200 // Create default figure by Asking MVC a new one.
201 iFiguremdlUID = createGraphicObject(__GO_FIGUREMODEL__);
202 setFigureModel(iFiguremdlUID);
203 InitFigureModel(iFiguremdlUID);
205 sciInitGraphicMode(iFiguremdlUID);
211 // Create default Axes by Asking MVC a new one.
212 iAxesmdlUID = createGraphicObject(__GO_AXESMODEL__);
213 setAxesModel(iAxesmdlUID);
215 /* Sets the parent-child relationship between the default Figure and Axes */
216 setGraphicObjectRelationship(iFiguremdlUID, iAxesmdlUID);
218 /* Axes Model properties */
220 result = InitAxesModel();
224 strcpy(error_message, _("Default axes cannot be created.\n"));
228 /* Margins and clip region */
235 setGraphicObjectProperty(iAxesmdlUID, __GO_MARGINS__, margins, jni_double_vector, 4);
242 setGraphicObjectProperty(iAxesmdlUID, __GO_CLIP_BOX__, clipRegion, jni_double_vector, 4);
245 setGraphicObjectProperty(iAxesmdlUID, __GO_CLIP_BOX_SET__, &clipRegionSet, jni_bool, 1);
248 * Specifies that no high-level drawing function has been called yet.
251 setGraphicObjectProperty(iAxesmdlUID, __GO_FIRST_PLOT__, &firstPlot, jni_bool, 1);
254 ppaxesmdl->FirstPlot = TRUE;
261 * This function has been adapted to the MVC framework, using the
262 * MVC's property set/get calls.
270 int axisLocation = 0;
274 int gridPosition = 0;
278 int defaultNumberTicks = 0;
280 int autoSubticks = 0;
282 int hiddenAxisColor = 0;
286 int *piVisible = &visible;
289 int arcDrawingMethod = 0;
290 int labelsFontStyle = 6;
291 int labelsFontColor = -1;
293 double labelsFontSize = 1;
294 double axesBounds[4];
295 double dataBounds[6];
296 double rotationAngles[2];
297 double tab[] = { 0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. }; /* graduations init. tmptab */
298 /* z-axis initial ticks locations */
299 double tabZTicksLocations[] = { -1.0, -0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0 };
300 char labelBuffer[LABEL_BUFFER_LENGTH];
301 char **stringVector = NULL;
306 double lineWidth = 1.0;
317 /* 0: point, 1: tabulated */
318 int markSizeUnit = 1;
322 int iFiguremdlUID = getFigureModel();
323 int iAxesmdlUID = getAxesModel();
325 sciInitGraphicMode(iAxesmdlUID);
327 setGraphicObjectProperty(iAxesmdlUID, __GO_BACKGROUND__, &background, jni_int, 1);
328 setGraphicObjectProperty(iAxesmdlUID, __GO_LINE_COLOR__, &foreground, jni_int, 1);
330 setGraphicObjectProperty(iAxesmdlUID, __GO_FONT_SIZE__, &labelsFontSize, jni_double, 1);
331 setGraphicObjectProperty(iAxesmdlUID, __GO_FONT_COLOR__, &labelsFontColor, jni_int, 1);
332 setGraphicObjectProperty(iAxesmdlUID, __GO_FONT_STYLE__, &labelsFontStyle, jni_int, 1);
334 setGraphicObjectProperty(iAxesmdlUID, __GO_LINE_THICKNESS__, &lineWidth, jni_double, 1);
335 setGraphicObjectProperty(iAxesmdlUID, __GO_LINE_STYLE__, &lineStyle, jni_int, 1);
337 setGraphicObjectProperty(iAxesmdlUID, __GO_MARK_MODE__, &markMode, jni_bool, 1);
338 setGraphicObjectProperty(iAxesmdlUID, __GO_LINE_MODE__, &lineMode, jni_bool, 1);
339 setGraphicObjectProperty(iAxesmdlUID, __GO_FILL_MODE__, &fillMode, jni_bool, 1);
341 setGraphicObjectProperty(iAxesmdlUID, __GO_MARK_STYLE__, &markStyle, jni_int, 1);
342 setGraphicObjectProperty(iAxesmdlUID, __GO_MARK_SIZE__, &markSize, jni_int, 1);
343 setGraphicObjectProperty(iAxesmdlUID, __GO_MARK_SIZE_UNIT__, &markSizeUnit, jni_int, 1);
345 setGraphicObjectProperty(iAxesmdlUID, __GO_MARK_BACKGROUND__, &background, jni_int, 1);
346 setGraphicObjectProperty(iAxesmdlUID, __GO_MARK_FOREGROUND__, &foreground, jni_int, 1);
349 setGraphicObjectProperty(iAxesmdlUID, __GO_CUBE_SCALING__, &cubeScaling, jni_bool, 1);
351 /* Log flags set to linear for the 3 axes */
354 setGraphicObjectProperty(iAxesmdlUID, __GO_X_AXIS_LOG_FLAG__, &logFlag, jni_bool, 1);
355 setGraphicObjectProperty(iAxesmdlUID, __GO_Y_AXIS_LOG_FLAG__, &logFlag, jni_bool, 1);
356 setGraphicObjectProperty(iAxesmdlUID, __GO_Z_AXIS_LOG_FLAG__, &logFlag, jni_bool, 1);
359 setGraphicObjectProperty(iAxesmdlUID, __GO_TICKS_COLOR__, &ticksColor, jni_int, 1);
362 setGraphicObjectProperty(iAxesmdlUID, __GO_X_AXIS_SUBTICKS__, &nbSubticks, jni_int, 1);
363 setGraphicObjectProperty(iAxesmdlUID, __GO_Y_AXIS_SUBTICKS__, &nbSubticks, jni_int, 1);
364 setGraphicObjectProperty(iAxesmdlUID, __GO_Z_AXIS_SUBTICKS__, &nbSubticks, jni_int, 1);
366 /* 0 corresponds to bottom position */
368 setGraphicObjectProperty(iAxesmdlUID, __GO_X_AXIS_LOCATION__, &axisLocation, jni_int, 1);
370 /* 4 corresponds to left position */
372 setGraphicObjectProperty(iAxesmdlUID, __GO_Y_AXIS_LOCATION__, &axisLocation, jni_int, 1);
374 /* 0 corresponds to OFF */
376 setGraphicObjectProperty(iAxesmdlUID, __GO_BOX_TYPE__, &boxType, jni_int, 1);
379 setGraphicObjectProperty(iAxesmdlUID, __GO_FILLED__, &filled, jni_bool, 1);
382 setGraphicObjectProperty(iAxesmdlUID, __GO_X_AXIS_GRID_COLOR__, &gridColor, jni_int, 1);
383 setGraphicObjectProperty(iAxesmdlUID, __GO_Y_AXIS_GRID_COLOR__, &gridColor, jni_int, 1);
384 setGraphicObjectProperty(iAxesmdlUID, __GO_Z_AXIS_GRID_COLOR__, &gridColor, jni_int, 1);
387 setGraphicObjectProperty(iAxesmdlUID, __GO_LINE_COLOR__, &lineColor, jni_int, 1);
388 setGraphicObjectProperty(iAxesmdlUID, __GO_BACKGROUND__, &background, jni_int, 1);
392 setGraphicObjectProperty(iAxesmdlUID, __GO_GRID_POSITION__, &gridPosition, jni_int, 1);
394 rotationAngles[0] = 0.0;
395 rotationAngles[1] = 270.0;
397 setGraphicObjectProperty(iAxesmdlUID, __GO_ROTATION_ANGLES__, rotationAngles, jni_double_vector, 2);
401 setGraphicObjectProperty(iAxesmdlUID, __GO_VIEW__, &view, jni_int, 1);
403 /* Must be set after VIEW, since setting VIEW to 2D overwrites the 3D rotation angles */
404 rotationAngles[0] = 45.0;
405 rotationAngles[1] = 215.0;
407 setGraphicObjectProperty(iAxesmdlUID, __GO_ROTATION_ANGLES_3D__, rotationAngles, jni_double_vector, 2);
410 setGraphicObjectProperty(iAxesmdlUID, __GO_X_AXIS_VISIBLE__, &axisVisible, jni_bool, 1);
411 setGraphicObjectProperty(iAxesmdlUID, __GO_Y_AXIS_VISIBLE__, &axisVisible, jni_bool, 1);
412 setGraphicObjectProperty(iAxesmdlUID, __GO_Z_AXIS_VISIBLE__, &axisVisible, jni_bool, 1);
415 setGraphicObjectProperty(iAxesmdlUID, __GO_X_AXIS_REVERSE__, &axisReverse, jni_bool, 1);
416 setGraphicObjectProperty(iAxesmdlUID, __GO_Y_AXIS_REVERSE__, &axisReverse, jni_bool, 1);
417 setGraphicObjectProperty(iAxesmdlUID, __GO_Z_AXIS_REVERSE__, &axisReverse, jni_bool, 1);
419 /* Corresponds to the MVC AUTO_SUBTICKS property (!flagNax is equivalent to AUTO_SUBTICKS) */
421 ppaxesmdl->flagNax = FALSE;
425 setGraphicObjectProperty(iAxesmdlUID, __GO_AUTO_SUBTICKS__, &autoSubticks, jni_bool, 1);
427 /* To be corrected when the equivalent of flagnax is implemented within the MVC */
429 setGraphicObjectProperty(iAxesmdlUID, __GO_X_AXIS_SUBTICKS__, &nbSubticks, jni_int, 1);
430 setGraphicObjectProperty(iAxesmdlUID, __GO_Y_AXIS_SUBTICKS__, &nbSubticks, jni_int, 1);
431 setGraphicObjectProperty(iAxesmdlUID, __GO_Z_AXIS_SUBTICKS__, &nbSubticks, jni_int, 1);
434 * The code creating default ticks labels and positions should be put
435 * into the Model. Ticks positions and locations should be computed using the default data bounds
436 * instead of using pre-defined values.
437 * Note that the pre-MVC ticks labels creation code is implemented in the C++ Renderer module
438 * and should be moved to the Java Model's relevant parts (TicksProperty).
442 * Automatic ticks computation must be activated for the 3 axes before setting ticks values to
443 * ensure that the ticks values set are the automatic ticks' ones.
446 setGraphicObjectProperty(iAxesmdlUID, __GO_X_AXIS_AUTO_TICKS__, &autoTicks, jni_bool, 1);
447 setGraphicObjectProperty(iAxesmdlUID, __GO_Y_AXIS_AUTO_TICKS__, &autoTicks, jni_bool, 1);
448 setGraphicObjectProperty(iAxesmdlUID, __GO_Z_AXIS_AUTO_TICKS__, &autoTicks, jni_bool, 1);
450 defaultNumberTicks = 11;
452 setGraphicObjectProperty(iAxesmdlUID, __GO_X_AXIS_TICKS_LOCATIONS__, tab, jni_double_vector, defaultNumberTicks);
453 setGraphicObjectProperty(iAxesmdlUID, __GO_Y_AXIS_TICKS_LOCATIONS__, tab, jni_double_vector, defaultNumberTicks);
455 stringVector = createStringArray(defaultNumberTicks);
457 if (stringVector == NULL)
463 * A proper format should be used (ChoixFormatE function)
465 for (i = 0; i < defaultNumberTicks; i++)
467 sprintf(labelBuffer, "%.1f", tab[i]);
468 stringVector[i] = os_strdup(labelBuffer);
470 if (stringVector[i] == NULL)
472 destroyStringArray(stringVector, i);
477 setGraphicObjectProperty(iAxesmdlUID, __GO_X_AXIS_TICKS_LABELS__, stringVector, jni_string_vector, defaultNumberTicks);
478 setGraphicObjectProperty(iAxesmdlUID, __GO_Y_AXIS_TICKS_LABELS__, stringVector, jni_string_vector, defaultNumberTicks);
481 * The same number of ticks is used now for the x,y and z axes.
482 * Previously, the z-axis contained only 3 ticks (-1, 0, 1). However, the renderer module was
483 * overriding this default number (3) by creating an 11-tick z-axis when required (3D view).
484 * Ticks locations and labels are however different for the z-axis (from -1 to +1 instead of 0 to 1).
486 setGraphicObjectProperty(iAxesmdlUID, __GO_Z_AXIS_TICKS_LOCATIONS__, tabZTicksLocations, jni_double_vector, defaultNumberTicks);
488 /* ChoixFormatE should be used */
489 for (i = 0; i < defaultNumberTicks; i++)
491 FREE(stringVector[i]);
493 sprintf(labelBuffer, "%.1f", tabZTicksLocations[i]);
494 stringVector[i] = os_strdup(labelBuffer);
496 if (stringVector[i] == NULL)
498 destroyStringArray(stringVector, defaultNumberTicks);
503 setGraphicObjectProperty(iAxesmdlUID, __GO_Z_AXIS_TICKS_LABELS__, stringVector, jni_string_vector, defaultNumberTicks);
505 destroyStringArray(stringVector, defaultNumberTicks);
508 * Indicates the direction of projection (0 for the axis corresponding to the direction,
510 * To be implemented within the MVC if determined to be useful.
513 ppaxesmdl->project[0] = 1;
514 ppaxesmdl->project[1] = 1;
515 ppaxesmdl->project[2] = 0;
519 setGraphicObjectProperty(iAxesmdlUID, __GO_HIDDEN_AXIS_COLOR__, &hiddenAxisColor, jni_int, 1);
522 setGraphicObjectProperty(iAxesmdlUID, __GO_HIDDEN_COLOR__, &hiddenColor, jni_int, 1);
525 setGraphicObjectProperty(iAxesmdlUID, __GO_ISOVIEW__, &isoview, jni_bool, 1);
527 /* Axes bounds set to fill the whole drawing area */
532 setGraphicObjectProperty(iAxesmdlUID, __GO_AXES_BOUNDS__, axesBounds, jni_double_vector, 4);
541 dataBounds[4] = -1.0;
544 setGraphicObjectProperty(iAxesmdlUID, __GO_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
547 getGraphicObjectProperty(iFiguremdlUID, __GO_VISIBLE__, jni_bool, (void**)&piVisible);
548 setGraphicObjectProperty(iAxesmdlUID, __GO_VISIBLE__, &visible, jni_bool, 1);
550 /* 0: clipping off */
552 setGraphicObjectProperty(iAxesmdlUID, __GO_CLIP_STATE__, &clipState, jni_int, 1);
554 /* "real data bounds" and "data bounds" are initially the same */
555 setGraphicObjectProperty(iAxesmdlUID, __GO_REAL_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
558 setGraphicObjectProperty(iAxesmdlUID, __GO_X_TIGHT_LIMITS__, &tightLimits, jni_bool, 1);
559 setGraphicObjectProperty(iAxesmdlUID, __GO_Y_TIGHT_LIMITS__, &tightLimits, jni_bool, 1);
560 setGraphicObjectProperty(iAxesmdlUID, __GO_Z_TIGHT_LIMITS__, &tightLimits, jni_bool, 1);
562 /* Sets the default arc drawing method to lines (1), which is faster */
563 arcDrawingMethod = 1;
564 setGraphicObjectProperty(iAxesmdlUID, __GO_ARC_DRAWING_METHOD__, &arcDrawingMethod, jni_int, 1);
566 /* Creates the Axes model's labels and sets the model as their parent */
567 iLabelUID = initLabel(iAxesmdlUID);
568 setGraphicObjectProperty(iAxesmdlUID, __GO_TITLE__, &iLabelUID, jni_int, 1);
570 iLabelUID = initLabel(iAxesmdlUID);
571 setGraphicObjectProperty(iAxesmdlUID, __GO_X_AXIS_LABEL__, &iLabelUID, jni_int, 1);
573 iLabelUID = initLabel(iAxesmdlUID);
574 setGraphicObjectProperty(iAxesmdlUID, __GO_Y_AXIS_LABEL__, &iLabelUID, jni_int, 1);
576 iLabelUID = initLabel(iAxesmdlUID);
577 setGraphicObjectProperty(iAxesmdlUID, __GO_Z_AXIS_LABEL__, &iLabelUID, jni_int, 1);
583 * This function has been adapted to the MVC framework.
584 * Its code ought to be moved to the Java Model implementation,
585 * either within the relevant constructor or an initialization method.
588 /**sciInitGraphicMode
589 * Inits the graphic mode of this object with the default value
591 int sciInitGraphicMode(int iObjUID)
594 int *piType = &iType;
596 getGraphicObjectProperty(iObjUID, __GO_TYPE__, jni_int, (void **)&piType);
599 * The GO_FIGURE block is never reached as InitFigureModel
600 * is not called at all (was previously called by
601 * the graphicsmodels function).
603 if (iType == __GO_FIGURE__)
605 /* 3: copy pixel drawing mode */
608 if (isFigureModel(iObjUID))
611 * These 3 properties are not used by the Figure object proper, but
612 * rather serve to initialize its children Axes' ones.
614 setGraphicObjectProperty(iObjUID, __GO_PIXEL_DRAWING_MODE__, &xormode, jni_int, 1);
617 else if (iType == __GO_AXES__)
620 * Same values as the ones from the Figure model. These values were copied from the parent
621 * Figure but are for now set using the values below.
624 /* autoClear is the logical not of addPlot (autoClear == 0 corresponds to addPlot == TRUE) */
632 if (isAxesModel(iObjUID))
634 setGraphicObjectProperty(iObjUID, __GO_AUTO_CLEAR__, &autoClear, jni_bool, 1);
635 setGraphicObjectProperty(iObjUID, __GO_AUTO_SCALE__, &autoScale, jni_bool, 1);
636 setGraphicObjectProperty(iObjUID, __GO_ZOOM_ENABLED__, &zoom, jni_bool, 1);
639 * Internal state: was possibly used to avoid accessing the parent Figure's pixel drawing mode
640 * or may be entirely useless, as pixel drawing mode is associated to the whole Figure.
641 * As it has no corresponding MVC property, this call will not set anything.
643 setGraphicObjectProperty(iObjUID, __GO_PIXEL_DRAWING_MODE__, &xormode, jni_int, 1);
646 * This block is never reached at all since since the Axes model
647 * is now cloned within the MVC via a C call.
653 int iAxesmdlUID = getAxesModel();
655 getGraphicObjectProperty(iAxesmdlUID, __GO_AUTO_CLEAR__, jni_bool, (void **)&piTmp);
657 getGraphicObjectProperty(iAxesmdlUID, __GO_AUTO_SCALE__, jni_bool, (void **)&piTmp);
659 getGraphicObjectProperty(iAxesmdlUID, __GO_ZOOM_ENABLED__, jni_bool, (void **)&piTmp);
662 setGraphicObjectProperty(iObjUID, __GO_AUTO_CLEAR__, &autoClear, jni_bool, 1);
663 setGraphicObjectProperty(iObjUID, __GO_AUTO_SCALE__, &autoScale, jni_bool, 1);
664 setGraphicObjectProperty(iObjUID, __GO_ZOOM_ENABLED__, &zoom, jni_bool, 1);
667 * Internal state: used to avoid accessing the parent's pixel drawing mode
668 * obsolete ? Not implemented yet within the MVC
671 getGraphicObjectProperty(iAxesmdlUID, __GO_PIXEL_DRAWING_MODE__, jni_bool, (void **)&piTmp);
674 setGraphicObjectProperty(iObjUID, __GO_PIXEL_DRAWING_MODE__, &xormode, jni_int, 1);
691 case SCI_LABEL: /* F.Leray 28.05.04 */
694 sciprint(_("This object has not any graphic mode\n"));
702 /*---------------------------------------------------------------------------------*/
703 /* allocate and set a new label to default values */
704 int initLabel(int iParentObjUID)
708 int autoPosition = 1;
710 iNewLabel = createGraphicObject(__GO_LABEL__);
712 /* Hide Label as they are non explicit children */
713 setGraphicObjectProperty(iNewLabel, __GO_HIDDEN__, &iHidden, jni_bool, 1);
714 setGraphicObjectProperty(iNewLabel, __GO_AUTO_POSITION__, &autoPosition, jni_bool, 1);
715 setGraphicObjectProperty(iNewLabel, __GO_AUTO_ROTATION__, &autoPosition, jni_bool, 1);
717 /* Sets the label's parent */
718 setGraphicObjectRelationship(iParentObjUID, iNewLabel);
720 cloneGraphicContext(iParentObjUID, iNewLabel);
721 cloneFontContext(iParentObjUID, iNewLabel);
725 /*---------------------------------------------------------------------------------*/