2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2007 - INRIA - Jean-Baptiste Silvy
4 * Copyright (C) 2010 - Paul Griffiths
5 * Copyright (C) 2012 - DIGITEO - Manuel Juliachs
6 * desc : Interface functions between between GetProperty functions and the C++/Java part of module
8 * This file must be used under the terms of the CeCILL.
9 * This source file is licensed as described in the file COPYING, which
10 * you should have received as part of this distribution. The terms
11 * are also available at
12 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
18 #include "getScilabJavaVM.h"
19 #include "GetJavaProperty.h"
22 #include "CallRenderer.hxx"
24 using namespace org_scilab_modules_renderer;
26 /*---------------------------------------------------------------------------------*/
27 void sciGetJava2dViewPixelCoordinates(char * pSubwinUID, const double userCoords[3], int pixCoords[2])
32 coords[0] = userCoords[0];
33 coords[1] = userCoords[1];
34 coords[2] = userCoords[2];
36 tmp = CallRenderer::getPixelFrom2dViewCoordinates(getScilabJavaVM(), pSubwinUID, coords, 3);
38 pixCoords[0] = (int) tmp[0];
39 pixCoords[1] = (int) tmp[1];
42 /*---------------------------------------------------------------------------------*/
43 void sciGetJava2dViewCoordinates(char *pSubwinUID, const double userCoords3D[3], double userCoords2D[2])
48 coords[0] = userCoords3D[0];
49 coords[1] = userCoords3D[1];
50 coords[2] = userCoords3D[2];
52 tmp = CallRenderer::get2dViewCoordinates(getScilabJavaVM(), pSubwinUID, coords, 3);
54 userCoords2D[0] = tmp[0];
55 userCoords2D[1] = tmp[1];
58 /*---------------------------------------------------------------------------------*/
59 void sciGetJava2dViewCoordFromPixel(char * pSubwinUID, const int pixCoords[2], double userCoords2D[2])
64 coords[0] = (double) pixCoords[0];
65 coords[1] = (double) pixCoords[1];
67 tmp = CallRenderer::get2dViewFromPixelCoordinates(getScilabJavaVM(), pSubwinUID, coords, 2);
69 userCoords2D[0] = tmp[0];
70 userCoords2D[1] = tmp[1];
73 /*---------------------------------------------------------------------------------*/
74 void sciGetJavaViewingArea(char * pSubwinUID, int *xPos, int *yPos, int *width, int *height)
78 tmp = CallRenderer::getViewingArea(getScilabJavaVM(), pSubwinUID);
82 *width = (int) tmp[2];
83 *height = (int) tmp[3];
86 /*---------------------------------------------------------------------------------*/