X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=blobdiff_plain;f=scilab%2Fmodules%2Fgraphic_objects%2Fsrc%2Fcpp%2FPolylineDecomposer.cpp;h=f9f71a670e901ccd964dea2c333b946531d6c9eb;hp=1b05e63f7dba8d4aabb6daeecaa254acaa09a5dc;hb=8eac3fa0e33cae106feb6fd53909e32f9d694717;hpb=53bf22e94e9c4c1663cf9f3fb8784ac86d24a08d diff --git a/scilab/modules/graphic_objects/src/cpp/PolylineDecomposer.cpp b/scilab/modules/graphic_objects/src/cpp/PolylineDecomposer.cpp index 1b05e63..f9f71a6 100644 --- a/scilab/modules/graphic_objects/src/cpp/PolylineDecomposer.cpp +++ b/scilab/modules/graphic_objects/src/cpp/PolylineDecomposer.cpp @@ -708,8 +708,6 @@ void PolylineDecomposer::fillColors(char* id, float* buffer, int bufferLength, i } getGraphicObjectProperty(id, __GO_DATA_MODEL_NUM_ELEMENTS__, jni_int, (void**) &piNPoints); - getGraphicObjectProperty(id, __GO_INTERP_COLOR_VECTOR__, jni_int_vector, (void**) &interpColorVector); - getGraphicObjectProperty(id, __GO_PARENT__, jni_string, (void**) &parent); /* Temporary: to avoid getting a null parent_figure property when the object is built */ @@ -735,9 +733,6 @@ void PolylineDecomposer::fillColors(char* id, float* buffer, int bufferLength, i return; } - getGraphicObjectProperty(parentFigure, __GO_COLORMAP__, jni_double_vector, (void**) &colormap); - getGraphicObjectProperty(parentFigure, __GO_COLORMAP_SIZE__, jni_int, (void**) &piColormapSize); - /* * The interpolated color vector is a 3- or 4-element vector. * However, if nPoints is greater than 4, we choose to output @@ -748,6 +743,10 @@ void PolylineDecomposer::fillColors(char* id, float* buffer, int bufferLength, i return; } + getGraphicObjectProperty(id, __GO_INTERP_COLOR_VECTOR__, jni_int_vector, (void**) &interpColorVector); + getGraphicObjectProperty(parentFigure, __GO_COLORMAP__, jni_double_vector, (void**) &colormap); + getGraphicObjectProperty(parentFigure, __GO_COLORMAP_SIZE__, jni_int, (void**) &piColormapSize); + if (nPoints > 4) { nPoints = 4; @@ -764,6 +763,9 @@ void PolylineDecomposer::fillColors(char* id, float* buffer, int bufferLength, i bufferOffset += elementsSize; } + + releaseGraphicObjectProperty(__GO_COLORMAP__, colormap, jni_double_vector, colormapSize); + releaseGraphicObjectProperty(__GO_INTERP_COLOR_VECTOR__, interpColorVector, jni_int_vector, 0); } void PolylineDecomposer::fillTextureCoordinates(char* id, float* buffer, int bufferLength) @@ -799,8 +801,6 @@ void PolylineDecomposer::fillTextureCoordinates(char* id, float* buffer, int buf } getGraphicObjectProperty(id, __GO_DATA_MODEL_NUM_ELEMENTS__, jni_int, (void**) &piNPoints); - getGraphicObjectProperty(id, __GO_INTERP_COLOR_VECTOR__, jni_int_vector, (void**) &interpColorVector); - getGraphicObjectProperty(id, __GO_PARENT__, jni_string, (void**) &parent); /* Temporary: to avoid getting a null parent_figure property when the object is built */ @@ -826,9 +826,6 @@ void PolylineDecomposer::fillTextureCoordinates(char* id, float* buffer, int buf return; } - getGraphicObjectProperty(parentFigure, __GO_COLORMAP__, jni_double_vector, (void**) &colormap); - getGraphicObjectProperty(parentFigure, __GO_COLORMAP_SIZE__, jni_int, (void**) &piColormapSize); - /* * The interpolated color vector is a 3- or 4-element vector. * However, if nPoints is greater than 4, we choose to output @@ -839,6 +836,10 @@ void PolylineDecomposer::fillTextureCoordinates(char* id, float* buffer, int buf return; } + getGraphicObjectProperty(id, __GO_INTERP_COLOR_VECTOR__, jni_int_vector, (void**) &interpColorVector); + getGraphicObjectProperty(parentFigure, __GO_COLORMAP__, jni_double_vector, (void**) &colormap); + getGraphicObjectProperty(parentFigure, __GO_COLORMAP_SIZE__, jni_int, (void**) &piColormapSize); + if (nPoints > 4) { nPoints = 4; @@ -855,6 +856,9 @@ void PolylineDecomposer::fillTextureCoordinates(char* id, float* buffer, int buf bufferOffset += 4; } + + releaseGraphicObjectProperty(__GO_COLORMAP__, colormap, jni_double_vector, colormapSize); + releaseGraphicObjectProperty(__GO_INTERP_COLOR_VECTOR__, interpColorVector, jni_int_vector, 0); } /*