本文整理汇总了C++中setGraphicObjectProperty函数的典型用法代码示例。如果您正苦于以下问题:C++ setGraphicObjectProperty函数的具体用法?C++ setGraphicObjectProperty怎么用?C++ setGraphicObjectProperty使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setGraphicObjectProperty函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSegsBuffers
static BOOL setSegsBuffers(scicos_block * block, int maxNumberOfPoints)
{
int iFigureUID;
int iAxeUID;
int iSegsUID;
int i;
int nclk = block->nipar - 6;
BOOL result = TRUE;
int color;
iFigureUID = getFigure(block);
iAxeUID = getAxe(iFigureUID, block);
for (i = 0; i < nclk; i++)
{
iSegsUID = getSegs(iAxeUID, block, i);
result = setGraphicObjectProperty(iSegsUID, __GO_NUMBER_ARROWS__, &maxNumberOfPoints, jni_int, 1);
/*
* Update color due to bug #9902
* http://bugzilla.scilab.org/show_bug.cgi?id=9902
*/
color = block->ipar[2 + i];
if (color > 0)
{
setGraphicObjectProperty(iSegsUID, __GO_SEGS_COLORS__, &color, jni_int_vector, 1);
}
}
return result;
}
示例2: setLabel
BOOL setLabel(int iAxeUID, int _iName, char* pstLabel)
{
int iLabelUID = 0;
int* piLabelUID = &iLabelUID;
int dimensions[2];
BOOL result = TRUE;
getGraphicObjectProperty(iAxeUID, _iName, jni_int, (void **)&piLabelUID);
if (iLabelUID != 0)
{
dimensions[0] = 1;
dimensions[1] = 1;
result = setGraphicObjectProperty(iLabelUID, __GO_TEXT_ARRAY_DIMENSIONS__, &dimensions, jni_int_vector, 2);
}
if (iLabelUID != 0 && result == TRUE)
{
result = setGraphicObjectProperty(iLabelUID, __GO_TEXT_STRINGS__, &pstLabel, jni_string_vector, 1);
}
return (BOOL) (result && iLabelUID != 0);
}
示例3: C2F
/*
For matplot1
*/
int C2F(implot1)(unsigned char *z, int *n1, int *n2, double *xrect, int plottype)
{
int iSubwinUID = 0;
int iGrayplotUID = 0;
BOOL isRedrawn = FALSE;
double y = 0; /* void for ConstructGrayplot */
int clipState = 0;
int firstPlot = 0;
isRedrawn = checkRedrawing();
/*---- Boundaries of the frame ----*/
iSubwinUID = getCurrentSubWin();
/* Force "cligrf" clipping (1) */
clipState = 1;
setGraphicObjectProperty(iSubwinUID, __GO_CLIP_STATE__, &clipState, jni_int, 1);
iGrayplotUID = ConstructImplot(iSubwinUID, xrect, z, *n1 + 1, *n2 + 1, plottype);
if (iGrayplotUID == 0)
{
// allocation error
Scierror(999, _("%s: No more memory.\n"), "grayplot");
return -1;
}
setCurrentObject(iGrayplotUID);
setGraphicObjectProperty(iSubwinUID, __GO_FIRST_PLOT__, &firstPlot, jni_bool, 1);
return (0);
}
示例4: setBounds
static BOOL setBounds(scicos_block * block, char *pAxeUID, char *pGrayplotUID)
{
BOOL result;
int gridSize[4];
double dataBounds[6];
int m, n;
m = GetInPortSize(block, 1, 1);
n = GetInPortSize(block, 1, 2);
gridSize[0] = m;
gridSize[1] = 1;
gridSize[2] = n;
gridSize[3] = 1;
dataBounds[0] = 0; // xMin
dataBounds[1] = (double)m; // xMax
dataBounds[2] = 0; // yMin
dataBounds[3] = (double)n; // yMax
dataBounds[4] = -1.0; // zMin
dataBounds[5] = 1.0; // zMax
result = setGraphicObjectProperty(pGrayplotUID, __GO_DATA_MODEL_GRID_SIZE__, gridSize, jni_int_vector, 4);
result &= setGraphicObjectProperty(pAxeUID, __GO_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
return result;
}
示例5: setDefaultValues
static BOOL setDefaultValues(scicos_block * block, char *pGrayplotUID)
{
int m, n, len;
int i;
double *values;
BOOL result;
m = GetInPortSize(block, 1, 1);
n = GetInPortSize(block, 1, 2);
len = Max(m, n);
values = (double *)CALLOC(n * m, sizeof(double));
if (values == NULL)
{
return FALSE;
}
result = setGraphicObjectProperty(pGrayplotUID, __GO_DATA_MODEL_Z__, values, jni_double_vector, m * n);
for (i = 1; i <= len; i++)
{
values[i] = (double)i;
}
result &= setGraphicObjectProperty(pGrayplotUID, __GO_DATA_MODEL_X__, values, jni_double_vector, m);
result &= setGraphicObjectProperty(pGrayplotUID, __GO_DATA_MODEL_Y__, values, jni_double_vector, n);
FREE(values);
return result;
}
示例6: getFigure
static char const* getFigure(scicos_block * block)
{
signed int figNum;
char const* pFigureUID = NULL;
char *pAxe = NULL;
int i__1 = 1;
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.cachedFigureUID != NULL)
{
return sco->scope.cachedFigureUID;
}
figNum = block->ipar[0];
// with a negative id, use the block number indexed from a constant.
if (figNum < 0)
{
figNum = 20000 + get_block_number();
}
pFigureUID = getFigureFromIndex(figNum);
// create on demand
if (pFigureUID == NULL)
{
pFigureUID = createNewFigureWithAxes();
setGraphicObjectProperty(pFigureUID, __GO_ID__, &figNum, jni_int, 1);
// the stored uid is a reference to the figure map, not to the current figure
pFigureUID = getFigureFromIndex(figNum);
sco->scope.cachedFigureUID = pFigureUID;
setGraphicObjectProperty(pFigureUID, __GO_COLORMAP__, &block->rpar[2], jni_double_vector, block->ipar[2]);
// allocate the axes through the getter
pAxe = getAxe(pFigureUID, block);
/*
* Setup according to block settings
*/
setLabel(pAxe, __GO_X_AXIS_LABEL__, "x");
setLabel(pAxe, __GO_Y_AXIS_LABEL__, "y");
setGraphicObjectProperty(pAxe, __GO_X_AXIS_VISIBLE__, &i__1, jni_bool, 1);
setGraphicObjectProperty(pAxe, __GO_Y_AXIS_VISIBLE__, &i__1, jni_bool, 1);
}
if (pFigureUID != NULL && sco->scope.cachedFigureUID == NULL)
{
sco->scope.cachedFigureUID = pFigureUID;
}
return pFigureUID;
}
示例7: pushData
static BOOL pushData(scicos_block * block, int input, int row)
{
char const* pFigureUID;
char *pAxeUID;
char *pPolylineUID;
double *data;
sco_data *sco;
BOOL result = TRUE;
pFigureUID = getFigure(block);
pAxeUID = getAxe(pFigureUID, block, input);
pPolylineUID = getPolyline(pAxeUID, block, input, row);
sco = getScoData(block);
if (sco == NULL)
return FALSE;
// select the right input and row
data = sco->internal.data[input][row];
result &= setGraphicObjectProperty(pPolylineUID, __GO_DATA_MODEL_X__, sco->internal.time[input], jni_double_vector, sco->internal.maxNumberOfPoints[input]);
result &= setGraphicObjectProperty(pPolylineUID, __GO_DATA_MODEL_Y__, data, jni_double_vector, sco->internal.maxNumberOfPoints[input]);
return result;
}
示例8: sciSetText
/**sciSetText
* Sets the Text in TEXT, TITLE or LEGEND
* @param char * pobjUID: the pointer to the entity
* @param char *text[] : the text which has to be put
* @param int nbRow : the number of row of the text matrix
* @param int nbCol : the number of col of the text matrix
* @return 0 if OK, -1 if not
*/
int sciSetText (char * pobjUID, char ** text, int nbRow, int nbCol)
{
int dimensions[2];
BOOL status = FALSE;
/* Check if we should load LaTex / MathML Java libraries */
loadTextRenderingAPI(text, nbRow, nbCol);
dimensions[0] = nbRow;
dimensions[1] = nbCol;
status = setGraphicObjectProperty(pobjUID, __GO_TEXT_ARRAY_DIMENSIONS__, dimensions, jni_int_vector, 2);
if (status != TRUE)
{
printSetGetErrorMessage("text");
return -1;
}
status = setGraphicObjectProperty(pobjUID, __GO_TEXT_STRINGS__, text, jni_string_vector, dimensions[0] * dimensions[1]);
if (status == TRUE)
{
return 0;
}
else
{
printSetGetErrorMessage("text");
return -1;
}
}
示例9: setPolylinesBounds
static BOOL setPolylinesBounds(scicos_block * block, int iAxeUID)
{
BOOL result;
double dataBounds[6];
double rotationAngle[2];
dataBounds[0] = block->rpar[0]; // xMin
dataBounds[1] = block->rpar[1]; // xMax
dataBounds[2] = block->rpar[2]; // yMin
dataBounds[3] = block->rpar[3]; // yMax
dataBounds[4] = block->rpar[4]; // zMin
dataBounds[5] = block->rpar[5]; // zMax
rotationAngle[0] = block->rpar[6]; // alpha
rotationAngle[1] = block->rpar[7]; // theta
result = setGraphicObjectProperty(iAxeUID, __GO_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
if (result == FALSE)
{
return result;
}
result = setGraphicObjectProperty(iAxeUID, __GO_ROTATION_ANGLES__, rotationAngle, jni_double_vector, 2);
return result;
}
示例10: clearLayoutOptions
int clearLayoutOptions(int iObjUID)
{
//reset all constraints data in model
int pi[2] = {0, 0};
BOOL status = FALSE;
status = setGraphicObjectProperty(iObjUID, __GO_GRID_OPT_GRID__, pi, jni_int_vector, 2);
if (status != TRUE)
{
Scierror(999, _("'%s' property does not exist for this handle.\n"), "layout_options");
return SET_PROPERTY_ERROR;
}
status = setGraphicObjectProperty(iObjUID, __GO_GRID_OPT_PADDING__, pi, jni_int_vector, 2);
if (status != TRUE)
{
Scierror(999, _("'%s' property does not exist for this handle.\n"), "layout_options");
return SET_PROPERTY_ERROR;
}
status = setGraphicObjectProperty(iObjUID, __GO_BORDER_OPT_PADDING__, pi, jni_int_vector, 2);
if (status != TRUE)
{
Scierror(999, _("'%s' property does not exist for this handle.\n"), "layout_options");
return SET_PROPERTY_ERROR;
}
return SET_PROPERTY_SUCCEED;
}
示例11: setPolylinesBounds
static BOOL setPolylinesBounds(scicos_block * block)
{
char const* pFigureUID;
char *pAxeUID;
BOOL result;
double dataBounds[6];
double rotationAngle[2];
dataBounds[0] = block->rpar[0]; // xMin
dataBounds[1] = block->rpar[1]; // xMax
dataBounds[2] = block->rpar[2]; // yMin
dataBounds[3] = block->rpar[3]; // yMax
dataBounds[4] = block->rpar[4]; // zMin
dataBounds[5] = block->rpar[5]; // zMax
rotationAngle[0] = block->rpar[6]; // alpha
rotationAngle[1] = block->rpar[7]; // theta
pFigureUID = getFigure(block);
pAxeUID = getAxe(pFigureUID, block);
result = setGraphicObjectProperty(pAxeUID, __GO_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
result &= setGraphicObjectProperty(pAxeUID, __GO_ROTATION_ANGLES__, rotationAngle, jni_double_vector, 2);
return result;
}
示例12: setDefaultValues
static BOOL setDefaultValues(scicos_block * block, char *pPlot3dUID)
{
int m, n, len;
int i;
double *values;
BOOL result;
m = GetInPortSize(block, 1, 1);
n = GetInPortSize(block, 1, 2);
/*
* Share the same memory for 0 allocation (z) and incremented index (x and y)
*/
values = (double *)CALLOC(m * n, sizeof(double));
if (values == NULL)
{
return FALSE;
}
result = setGraphicObjectProperty(pPlot3dUID, __GO_DATA_MODEL_Z__, values, jni_double_vector, m * n);
len = Max(m, n);
for (i = 1; i <= len; i++)
{
values[i] = (double) i;
}
result &= setGraphicObjectProperty(pPlot3dUID, __GO_DATA_MODEL_X__, values, jni_double_vector, m);
result &= setGraphicObjectProperty(pPlot3dUID, __GO_DATA_MODEL_Y__, values, jni_double_vector, n);
FREE(values);
return result;
}
示例13: set_text_box_mode_property
/*------------------------------------------------------------------------*/
int set_text_box_mode_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol)
{
BOOL status[2];
int autoSize = 0;
int textBoxMode = 0;
int status1 = 0;
int status2 = 0;
if (valueType != sci_strings)
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "text_box_mode");
return SET_PROPERTY_ERROR;
}
if (stricmp((char*)_pvData, "off") == 0)
{
autoSize = 1;
textBoxMode = 0;
}
else if (stricmp((char*)_pvData, "centered") == 0)
{
autoSize = 1;
textBoxMode = 1;
}
else if (stricmp((char*)_pvData, "filled") == 0)
{
autoSize = 0;
textBoxMode = 2;
}
else
{
Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "text_box_mode", "off, centered, filled");
return SET_PROPERTY_ERROR;
}
status[0] = setGraphicObjectProperty(iObjUID, __GO_TEXT_BOX_MODE__, &textBoxMode, jni_int, 1);
status[1] = setGraphicObjectProperty(iObjUID, __GO_AUTO_DIMENSIONING__, &autoSize, jni_bool, 1);
if (status[0] == TRUE)
{
status1 = SET_PROPERTY_SUCCEED;
}
else
{
Scierror(999, _("'%s' property does not exist for this handle.\n"), "text_box_mode");
status1 = SET_PROPERTY_ERROR;
}
if (status[1] == TRUE)
{
status2 = SET_PROPERTY_SUCCEED;
}
else
{
status2 = SET_PROPERTY_ERROR;
}
return sciSetFinalStatus((SetPropertyStatus)status1, (SetPropertyStatus)status2);
}
示例14: getGrayplot
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;
}
示例15: setBounds
static BOOL setBounds(scicos_block * block, int iAxeUID, int iPlot3dUID)
{
BOOL result;
int gridSize[4];
double dataBounds[6];
double rotationAngle[2];
int m, n;
int colormapLen;
m = GetInPortSize(block, 1, 1);
n = GetInPortSize(block, 1, 2);
gridSize[0] = 1;
gridSize[1] = m;
gridSize[2] = 1;
gridSize[3] = n;
colormapLen = block->ipar[3];
if (colormapLen == 1)
{
dataBounds[0] = (double) 0; // xMin
dataBounds[1] = (double) m; // xMax
dataBounds[2] = (double) 0; // yMin
dataBounds[3] = (double) n; // yMax
}
else
{
dataBounds[0] = block->rpar[colormapLen + 0]; // xMin
dataBounds[1] = block->rpar[colormapLen + 1]; // xMax
dataBounds[2] = block->rpar[colormapLen + 2]; // yMin
dataBounds[3] = block->rpar[colormapLen + 3]; // yMax
}
dataBounds[4] = (double)block->ipar[0]; // zMin
dataBounds[5] = (double)block->ipar[1]; // zMax
rotationAngle[0] = 50; // alpha
rotationAngle[1] = 280; // theta
result = setGraphicObjectProperty(iPlot3dUID, __GO_DATA_MODEL_GRID_SIZE__, gridSize, jni_int_vector, 4);
if (result == FALSE)
{
return result;
}
result = setGraphicObjectProperty(iAxeUID, __GO_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
if (result == FALSE)
{
return result;
}
result = setGraphicObjectProperty(iAxeUID, __GO_ROTATION_ANGLES__, rotationAngle, jni_double_vector, 2);
return result;
}