static int getAxe(int iFigureUID, scicos_block * block) { int iAxe; int i; int nclk = block->nipar - 6; sco_data *sco = getScoData(block); // assert the sco is not NULL if (sco == NULL) { return 0; } // fast path for an existing object if (sco->scope.cachedAxeUID) { return sco->scope.cachedAxeUID; } iAxe = findChildWithKindAt(iFigureUID, __GO_AXES__, 0); /* * Allocate if necessary */ if (iAxe == 0) { cloneAxesModel(iFigureUID); iAxe = findChildWithKindAt(iFigureUID, __GO_AXES__, 0); } /* * Setup on first access */ if (iAxe != 0) { // allocate the segs through the getter for (i = 0; i < nclk; i++) { getSegs(iAxe, block, i); } } else { return 0; } /* * then cache with a local storage */ sco->scope.cachedAxeUID = iAxe; return sco->scope.cachedAxeUID; }
static char *getAxe(char const* pFigureUID, scicos_block * block, int input) { char *pAxe; int i; sco_data *sco = (sco_data *) * (block->work); // assert the sco is not NULL if (sco == NULL) { return NULL; } // fast path for an existing object if (sco->scope.cachedAxeUID != NULL && sco->scope.cachedAxeUID[input] != NULL) { return sco->scope.cachedAxeUID[input]; } pAxe = findChildWithKindAt(pFigureUID, __GO_AXES__, input); /* * Allocate if necessary */ if (pAxe == NULL) { cloneAxesModel(pFigureUID); pAxe = findChildWithKindAt(pFigureUID, __GO_AXES__, input); } /* * Setup on first access */ if (pAxe != NULL) { // allocate the polylines through the getter for (i = 0; i < block->insz[input]; i++) { getPolyline(pAxe, block, input, i); } setAxesSettings(pAxe, block, input); } /* * then cache with local storage */ if (pAxe != NULL && sco->scope.cachedAxeUID != NULL && sco->scope.cachedAxeUID[input] == NULL) { sco->scope.cachedAxeUID[input] = strdup(pAxe); releaseGraphicObjectProperty(__GO_PARENT__, pAxe, jni_string, 1); } return sco->scope.cachedAxeUID[input]; }
static char *getPlot3d(char *pAxeUID, scicos_block * block) { char *pPlot3d; sco_data *sco = (sco_data *) * (block->work); // assert the sco is not NULL if (sco == NULL) { return NULL; } // fast path for an existing object if (sco->scope.cachedPlot3dUID != NULL) { return sco->scope.cachedPlot3dUID; } pPlot3d = findChildWithKindAt(pAxeUID, __GO_PLOT3D__, 0); /* * Allocate if necessary */ if (pPlot3d == NULL) { pPlot3d = createGraphicObject(__GO_PLOT3D__); if (pPlot3d != NULL) { createDataObject(pPlot3d, __GO_PLOT3D__); setGraphicObjectRelationship(pAxeUID, pPlot3d); } } /* * Setup on first access */ if (pPlot3d != NULL) { setBounds(block, pAxeUID, pPlot3d); setPlot3dSettings(pPlot3d); setDefaultValues(block, pPlot3d); { int iClipState = 1; //on setGraphicObjectProperty(pPlot3d, __GO_CLIP_STATE__, &iClipState, jni_int, 1); } } /* * then cache with a local storage */ if (pPlot3d != NULL && sco->scope.cachedPlot3dUID == NULL) { sco->scope.cachedPlot3dUID = strdup(pPlot3d); releaseGraphicObjectProperty(__GO_PARENT__, pPlot3d, jni_string, 1); } return sco->scope.cachedPlot3dUID; }
static char *getAxe(char const* pFigureUID, scicos_block * block) { char *pAxe; sco_data *sco = (sco_data *) * (block->work); // assert the sco is not NULL if (sco == NULL) { return NULL; } // fast path for an existing object if (sco->scope.cachedAxeUID != NULL) { return sco->scope.cachedAxeUID; } pAxe = findChildWithKindAt(pFigureUID, __GO_AXES__, 0); /* * Allocate if necessary */ if (pAxe == NULL) { cloneAxesModel(pFigureUID); pAxe = findChildWithKindAt(pFigureUID, __GO_AXES__, 0); } /* * Setup on first access */ if (pAxe != NULL) { getGrayplot(pAxe, block); } /* * then cache with local storage */ if (pAxe != NULL && sco->scope.cachedAxeUID == NULL) { sco->scope.cachedAxeUID = strdup(pAxe); releaseGraphicObjectProperty(__GO_PARENT__, pAxe, jni_string, 1); } return sco->scope.cachedAxeUID; }
static int getAxe(int iFigureUID, scicos_block * block) { int iAxe; sco_data *sco = (sco_data *) * (block->work); // assert the sco is not NULL if (sco == NULL) { return 0; } // fast path for an existing object if (sco->scope.cachedAxeUID) { return sco->scope.cachedAxeUID; } iAxe = findChildWithKindAt(iFigureUID, __GO_AXES__, 0); /* * Allocate if necessary */ if (iAxe == 0) { cloneAxesModel(iFigureUID); iAxe = findChildWithKindAt(iFigureUID, __GO_AXES__, 0); } /* * Setup on first access */ if (iAxe != 0) { getGrayplot(iAxe, block); } else { return 0; } /* * then cache with local storage */ sco->scope.cachedAxeUID = iAxe; return sco->scope.cachedAxeUID; }
static int getAxe(int iFigureUID, scicos_block * block) { int iAxe; int i__1 = 1; sco_data *sco = (sco_data *) * (block->work); // assert the sco is not NULL if (sco == NULL) { return 0; } // fast path for an existing object if (sco->scope.cachedAxeUID) { return sco->scope.cachedAxeUID; } iAxe = findChildWithKindAt(iFigureUID, __GO_AXES__, 0); /* * Allocate if necessary */ if (iAxe == 0) { cloneAxesModel(iFigureUID); iAxe = findChildWithKindAt(iFigureUID, __GO_AXES__, 0); } if (iAxe != 0) { setGraphicObjectProperty(iAxe, __GO_BOX_TYPE__, &i__1, jni_int, 1); getPlot3d(iAxe, block); } else { return 0; } /* * then cache with local storage */ sco->scope.cachedAxeUID = iAxe; return sco->scope.cachedAxeUID; }
static int getGrayplot(int iAxeUID, scicos_block * block) { int iGrayplot; int i__0 = 0; sco_data *sco = (sco_data *) * (block->work); // assert the sco is not NULL if (sco == NULL) { return 0; } // fast path for an existing object if (sco->scope.cachedGrayplotUID) { return sco->scope.cachedGrayplotUID; } iGrayplot = findChildWithKindAt(iAxeUID, __GO_GRAYPLOT__, 0); /* * Allocate if necessary */ if (iGrayplot == 0) { iGrayplot = createGraphicObject(__GO_GRAYPLOT__); if (iGrayplot != 0) { createDataObject(iGrayplot, __GO_GRAYPLOT__); setGraphicObjectRelationship(iAxeUID, iGrayplot); } else { return 0; } } /* * Setup on first access */ setGraphicObjectProperty(iGrayplot, __GO_DATA_MAPPING__, &i__0, jni_int, 1); setBounds(block, iAxeUID, iGrayplot); setDefaultValues(block, iGrayplot); { int iClipState = 1; //on setGraphicObjectProperty(iGrayplot, __GO_CLIP_STATE__, &iClipState, jni_int, 1); } /* * then cache with a local storage */ sco->scope.cachedGrayplotUID = iGrayplot; return sco->scope.cachedGrayplotUID; }
static int getPlot3d(int iAxeUID, scicos_block * block) { int iPlot3d; sco_data *sco = (sco_data *) * (block->work); // assert the sco is not NULL if (sco == NULL) { return 0; } // fast path for an existing object if (sco->scope.cachedPlot3dUID) { return sco->scope.cachedPlot3dUID; } iPlot3d = findChildWithKindAt(iAxeUID, __GO_PLOT3D__, 0); /* * Allocate if necessary */ if (iPlot3d == 0) { iPlot3d = createGraphicObject(__GO_PLOT3D__); if (iPlot3d != 0) { createDataObject(iPlot3d, __GO_PLOT3D__); setGraphicObjectRelationship(iAxeUID, iPlot3d); } else { return 0; } } /* * Setup on first access */ setBounds(block, iAxeUID, iPlot3d); setPlot3dSettings(iPlot3d); setDefaultValues(block, iPlot3d); { int iClipState = 1; //on setGraphicObjectProperty(iPlot3d, __GO_CLIP_STATE__, &iClipState, jni_int, 1); } /* * then cache with a local storage */ sco->scope.cachedPlot3dUID = iPlot3d; return sco->scope.cachedPlot3dUID; }
static int getSegs(int iAxeUID, scicos_block * block, int input) { int iSegs; BOOL b__true = TRUE; double d__1 = 1.0; double d__0 = 0.0; int color; sco_data *sco = getScoData(block); // assert the sco is not NULL if (sco == NULL || sco->scope.cachedSegsUIDs == NULL) { return 0; } // fast path for an existing object if (sco->scope.cachedSegsUIDs[input]) { return sco->scope.cachedSegsUIDs[input]; } iSegs = findChildWithKindAt(iAxeUID, __GO_SEGS__, input); /* * Allocate if necessary */ if (iSegs == 0) { iSegs = createGraphicObject(__GO_SEGS__); if (iSegs != 0) { createDataObject(iSegs, __GO_SEGS__); setGraphicObjectRelationship(iAxeUID, iSegs); } else { return 0; } } /* * Setup on first access */ setGraphicObjectProperty(iSegs, __GO_NUMBER_ARROWS__, &sco->internal.maxNumberOfPoints[input], jni_int, 1); // Setup properties setGraphicObjectProperty(iSegs, __GO_LINE_THICKNESS__, &d__1, jni_double, 1); setGraphicObjectProperty(iSegs, __GO_ARROW_SIZE__, &d__0, jni_double, 1); color = block->ipar[2 + input]; if (color > 0) { setGraphicObjectProperty(iSegs, __GO_LINE_MODE__, &b__true, jni_bool, 1); setGraphicObjectProperty(iSegs, __GO_SEGS_COLORS__, &color, jni_int_vector, 1); } else { int iMarkSize = 4; color = -color; setGraphicObjectProperty(iSegs, __GO_MARK_MODE__, &b__true, jni_bool, 1); setGraphicObjectProperty(iSegs, __GO_MARK_STYLE__, &color, jni_int, 1); setGraphicObjectProperty(iSegs, __GO_MARK_SIZE__, &iMarkSize, jni_int, 1); } { int iClipState = 1; //on setGraphicObjectProperty(iSegs, __GO_CLIP_STATE__, &iClipState, jni_int, 1); } /* * then cache with a local storage */ sco->scope.cachedSegsUIDs[input] = iSegs; return sco->scope.cachedSegsUIDs[input]; }
static char *getPolyline(char *pAxeUID, scicos_block * block, int row) { char *pPolyline; static double d__0 = 0.0; static BOOL b__true = TRUE; int color; int markSize; double lineThickness; sco_data *sco = (sco_data *) * (block->work); // assert the sco is not NULL if (sco == NULL) { return NULL; } // fast path for an existing object if (sco->scope.cachedPolylinesUIDs != NULL && sco->scope.cachedPolylinesUIDs[row] != NULL) { return sco->scope.cachedPolylinesUIDs[row]; } pPolyline = findChildWithKindAt(pAxeUID, __GO_POLYLINE__, row); /* * Allocate if necessary */ if (pPolyline == NULL) { pPolyline = createGraphicObject(__GO_POLYLINE__); if (pPolyline != NULL) { createDataObject(pPolyline, __GO_POLYLINE__); setGraphicObjectRelationship(pAxeUID, pPolyline); } } /* * Setup on first access */ if (pPolyline != NULL) { /* * Default setup of the nGons property */ { int nGons = 1; setGraphicObjectProperty(pPolyline, __GO_DATA_MODEL_NUM_GONS__, &nGons, jni_int, 1); } color = block->ipar[3 + row]; markSize = block->ipar[3 + block->ipar[1] + row]; lineThickness = (double)markSize; if (color > 0) { setGraphicObjectProperty(pPolyline, __GO_LINE_MODE__, &b__true, jni_bool, 1); setGraphicObjectProperty(pPolyline, __GO_LINE_COLOR__, &color, jni_int, 1); setGraphicObjectProperty(pPolyline, __GO_LINE_THICKNESS__, &lineThickness, jni_double, 1); } else { color = -color; setGraphicObjectProperty(pPolyline, __GO_MARK_MODE__, &b__true, jni_bool, 1); setGraphicObjectProperty(pPolyline, __GO_MARK_STYLE__, &color, jni_int, 1); setGraphicObjectProperty(pPolyline, __GO_MARK_SIZE__, &markSize, jni_int, 1); } { int iClipState = 1; //on setGraphicObjectProperty(pPolyline, __GO_CLIP_STATE__, &iClipState, jni_int, 1); } } /* * then cache with a local storage */ if (pPolyline != NULL && sco->scope.cachedPolylinesUIDs != NULL && sco->scope.cachedPolylinesUIDs[row] == NULL) { sco->scope.cachedPolylinesUIDs[row] = strdup(pPolyline); releaseGraphicObjectProperty(__GO_PARENT__, pPolyline, jni_string, 1); } return sco->scope.cachedPolylinesUIDs[row]; }
static char *getPolyline(char *pAxeUID, scicos_block * block, int input, int row) { char *pPolyline; double d__0 = 0.0; BOOL b__true = TRUE; int color; sco_data *sco = (sco_data *) * (block->work); // assert the sco is not NULL if (sco == NULL) { return NULL; } // fast path for an existing object if (sco->scope.cachedPolylinesUIDs != NULL && sco->scope.cachedPolylinesUIDs[input] != NULL && sco->scope.cachedPolylinesUIDs[input][row] != NULL) { return sco->scope.cachedPolylinesUIDs[input][row]; } pPolyline = findChildWithKindAt(pAxeUID, __GO_POLYLINE__, row); /* * Allocate if necessary */ if (pPolyline == NULL) { pPolyline = createGraphicObject(__GO_POLYLINE__); if (pPolyline != NULL) { createDataObject(pPolyline, __GO_POLYLINE__); setGraphicObjectRelationship(pAxeUID, pPolyline); } } /* * Setup on first access */ if (pPolyline != NULL) { /* * Default setup (will crash if removed) */ { int polylineSize[2] = { 1, block->ipar[2] }; setGraphicObjectProperty(pPolyline, __GO_DATA_MODEL_NUM_ELEMENTS_ARRAY__, polylineSize, jni_int_vector, 2); } setGraphicObjectProperty(pPolyline, __GO_DATA_MODEL_X__, &d__0, jni_double_vector, 1); setGraphicObjectProperty(pPolyline, __GO_DATA_MODEL_Y__, &d__0, jni_double_vector, 1); // ipar=[win;size(in,'*');N;wpos(:);wdim(:);in(:);clrs(:);heritance] // 1 1 1 2 2 nin nin 1 color = block->ipar[7 + block->nin + input + row]; if (color > 0) { LOG("%s: %s at %d at %d to %d\n", "cmscope", "set lines mode", input, row, color); setGraphicObjectProperty(pPolyline, __GO_LINE_MODE__, &b__true, jni_bool, 1); setGraphicObjectProperty(pPolyline, __GO_LINE_COLOR__, &color, jni_int, 1); } else { color = -color; LOG("%s: %s at %d at %d to %d\n", "cmscope", "set mark mode", input, row, -color); setGraphicObjectProperty(pPolyline, __GO_MARK_MODE__, &b__true, jni_bool, 1); setGraphicObjectProperty(pPolyline, __GO_MARK_STYLE__, &color, jni_int, 1); } { int iClipState = 1; //on setGraphicObjectProperty(pPolyline, __GO_CLIP_STATE__, &iClipState, jni_int, 1); } } /* * then cache with local storage */ if (sco->scope.cachedPolylinesUIDs != NULL && sco->scope.cachedPolylinesUIDs[input] != NULL) { sco->scope.cachedPolylinesUIDs[input][row] = strdup(pPolyline); releaseGraphicObjectProperty(__GO_PARENT__, pPolyline, jni_string, 1); } return sco->scope.cachedPolylinesUIDs[input][row]; }