matplot1 for hypermat 53/15153/6
Anais AUBERT [Wed, 3 Sep 2014 13:39:27 +0000 (15:39 +0200)]
Change-Id: I04e580982f647f0bf2c11f370c8b77a6eae3aee9

scilab/modules/graphics/Makefile.am
scilab/modules/graphics/Makefile.in
scilab/modules/graphics/graphics.vcxproj
scilab/modules/graphics/graphics.vcxproj.filters
scilab/modules/graphics/includes/graphics_gw.hxx
scilab/modules/graphics/includes/gw_graphics.h
scilab/modules/graphics/sci_gateway/c/sci_matplot1.c [deleted file]
scilab/modules/graphics/sci_gateway/cpp/graphics_gw.vcxproj
scilab/modules/graphics/sci_gateway/cpp/graphics_gw.vcxproj.filters
scilab/modules/graphics/sci_gateway/cpp/sci_matplot1.cpp [new file with mode: 0644]

index 909683d..913b8b5 100644 (file)
@@ -405,7 +405,6 @@ GRAPHICS_CXX_SOURCES = \
 GATEWAY_C_SOURCES = \
     sci_gateway/c/sci_swap_handles.c \
     sci_gateway/c/sci_grayplot.c \
-    sci_gateway/c/sci_matplot1.c \
     sci_gateway/c/sci_xfpolys.c \
     sci_gateway/c/sci_newaxes.c \
     sci_gateway/c/sci_xlfont.c \
@@ -469,6 +468,7 @@ GATEWAY_CXX_SOURCES = \
     sci_gateway/cpp/sci_xget.cpp \
     sci_gateway/cpp/sci_xset.cpp \
     sci_gateway/cpp/sci_matplot.cpp \
+    sci_gateway/cpp/sci_matplot1.cpp \
     sci_gateway/cpp/sci_winsid.cpp
 
 
index 140a07e..8d6d52c 100644 (file)
@@ -561,7 +561,6 @@ libscigraphics_disable_la_OBJECTS =  \
 libscigraphics_la_DEPENDENCIES = libscigraphics-algo.la
 am__objects_3 = sci_gateway/c/libscigraphics_la-sci_swap_handles.lo \
        sci_gateway/c/libscigraphics_la-sci_grayplot.lo \
-       sci_gateway/c/libscigraphics_la-sci_matplot1.lo \
        sci_gateway/c/libscigraphics_la-sci_xfpolys.lo \
        sci_gateway/c/libscigraphics_la-sci_newaxes.lo \
        sci_gateway/c/libscigraphics_la-sci_xlfont.lo \
@@ -623,6 +622,7 @@ am__objects_4 = sci_gateway/cpp/libscigraphics_la-graphics_gw.lo \
        sci_gateway/cpp/libscigraphics_la-sci_xget.lo \
        sci_gateway/cpp/libscigraphics_la-sci_xset.lo \
        sci_gateway/cpp/libscigraphics_la-sci_matplot.lo \
+       sci_gateway/cpp/libscigraphics_la-sci_matplot1.lo \
        sci_gateway/cpp/libscigraphics_la-sci_winsid.lo
 am_libscigraphics_la_OBJECTS = $(am__objects_3) $(am__objects_4)
 libscigraphics_la_OBJECTS = $(am_libscigraphics_la_OBJECTS)
@@ -1392,7 +1392,6 @@ GRAPHICS_CXX_SOURCES = \
 GATEWAY_C_SOURCES = \
     sci_gateway/c/sci_swap_handles.c \
     sci_gateway/c/sci_grayplot.c \
-    sci_gateway/c/sci_matplot1.c \
     sci_gateway/c/sci_xfpolys.c \
     sci_gateway/c/sci_newaxes.c \
     sci_gateway/c/sci_xlfont.c \
@@ -1456,6 +1455,7 @@ GATEWAY_CXX_SOURCES = \
     sci_gateway/cpp/sci_xget.cpp \
     sci_gateway/cpp/sci_xset.cpp \
     sci_gateway/cpp/sci_matplot.cpp \
+    sci_gateway/cpp/sci_matplot1.cpp \
     sci_gateway/cpp/sci_winsid.cpp
 
 libscigraphics_la_CPPFLAGS = \
@@ -2856,9 +2856,6 @@ sci_gateway/c/libscigraphics_la-sci_swap_handles.lo:  \
 sci_gateway/c/libscigraphics_la-sci_grayplot.lo:  \
        sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
-sci_gateway/c/libscigraphics_la-sci_matplot1.lo:  \
-       sci_gateway/c/$(am__dirstamp) \
-       sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/c/libscigraphics_la-sci_xfpolys.lo:  \
        sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
@@ -3048,6 +3045,9 @@ sci_gateway/cpp/libscigraphics_la-sci_xset.lo:  \
 sci_gateway/cpp/libscigraphics_la-sci_matplot.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libscigraphics_la-sci_matplot1.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/cpp/libscigraphics_la-sci_winsid.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
@@ -3092,7 +3092,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_grayplot.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_is_handle_valid.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_light.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_matplot1.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_move.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_name2rgb.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_newaxes.Plo@am__quote@
@@ -3135,6 +3134,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-graphics_gw.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-sci_get.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-sci_matplot.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-sci_matplot1.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-sci_winsid.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-sci_xget.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-sci_xset.Plo@am__quote@
@@ -6140,13 +6140,6 @@ sci_gateway/c/libscigraphics_la-sci_grayplot.lo: sci_gateway/c/sci_grayplot.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscigraphics_la-sci_grayplot.lo `test -f 'sci_gateway/c/sci_grayplot.c' || echo '$(srcdir)/'`sci_gateway/c/sci_grayplot.c
 
-sci_gateway/c/libscigraphics_la-sci_matplot1.lo: sci_gateway/c/sci_matplot1.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscigraphics_la-sci_matplot1.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_matplot1.Tpo -c -o sci_gateway/c/libscigraphics_la-sci_matplot1.lo `test -f 'sci_gateway/c/sci_matplot1.c' || echo '$(srcdir)/'`sci_gateway/c/sci_matplot1.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_matplot1.Tpo sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_matplot1.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_matplot1.c' object='sci_gateway/c/libscigraphics_la-sci_matplot1.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscigraphics_la-sci_matplot1.lo `test -f 'sci_gateway/c/sci_matplot1.c' || echo '$(srcdir)/'`sci_gateway/c/sci_matplot1.c
-
 sci_gateway/c/libscigraphics_la-sci_xfpolys.lo: sci_gateway/c/sci_xfpolys.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscigraphics_la-sci_xfpolys.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_xfpolys.Tpo -c -o sci_gateway/c/libscigraphics_la-sci_xfpolys.lo `test -f 'sci_gateway/c/sci_xfpolys.c' || echo '$(srcdir)/'`sci_gateway/c/sci_xfpolys.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_xfpolys.Tpo sci_gateway/c/$(DEPDIR)/libscigraphics_la-sci_xfpolys.Plo
@@ -6619,6 +6612,13 @@ sci_gateway/cpp/libscigraphics_la-sci_matplot.lo: sci_gateway/cpp/sci_matplot.cp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscigraphics_la-sci_matplot.lo `test -f 'sci_gateway/cpp/sci_matplot.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_matplot.cpp
 
+sci_gateway/cpp/libscigraphics_la-sci_matplot1.lo: sci_gateway/cpp/sci_matplot1.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscigraphics_la-sci_matplot1.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-sci_matplot1.Tpo -c -o sci_gateway/cpp/libscigraphics_la-sci_matplot1.lo `test -f 'sci_gateway/cpp/sci_matplot1.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_matplot1.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-sci_matplot1.Tpo sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-sci_matplot1.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_matplot1.cpp' object='sci_gateway/cpp/libscigraphics_la-sci_matplot1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscigraphics_la-sci_matplot1.lo `test -f 'sci_gateway/cpp/sci_matplot1.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_matplot1.cpp
+
 sci_gateway/cpp/libscigraphics_la-sci_winsid.lo: sci_gateway/cpp/sci_winsid.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscigraphics_la-sci_winsid.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-sci_winsid.Tpo -c -o sci_gateway/cpp/libscigraphics_la-sci_winsid.lo `test -f 'sci_gateway/cpp/sci_winsid.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_winsid.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-sci_winsid.Tpo sci_gateway/cpp/$(DEPDIR)/libscigraphics_la-sci_winsid.Plo
index a25885a..898babe 100644 (file)
@@ -488,7 +488,6 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="sci_gateway\c\sci_grayplot.c" />
     <ClCompile Include="sci_gateway\c\sci_is_handle_valid.c" />
     <ClCompile Include="sci_gateway\c\sci_Legend.c" />
-    <ClCompile Include="sci_gateway\c\sci_matplot1.c" />
     <ClCompile Include="sci_gateway\c\sci_move.c" />
     <ClCompile Include="sci_gateway\c\sci_newaxes.c" />
     <ClCompile Include="sci_gateway\c\sci_param3d.c" />
index d6b4be8..1f84ba5 100644 (file)
     <ClCompile Include="sci_gateway\c\sci_Legend.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sci_gateway\c\sci_matplot1.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sci_gateway\c\sci_move.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <None Include="locales\graphics.pot" />
     <None Include="locales\graphics.pot" />
     <None Include="locales\graphics.pot" />
+    <None Include="locales\graphics.pot" />
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="graphic.rc">
index c8e4a77..87f156f 100644 (file)
@@ -40,4 +40,5 @@ CPP_GATEWAY_PROTOTYPE_EXPORT(sci_xget, GRAPHICS_GW_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_xset, GRAPHICS_GW_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_winsid, GRAPHICS_GW_IMPEXP);
 CPP_OPT_GATEWAY_PROTOTYPE_EXPORT(sci_matplot, GRAPHICS_GW_IMPEXP);
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_matplot1, GRAPHICS_GW_IMPEXP);
 #endif /* !__GUI_GW_HXX__ */
index e8a414f..a92ec4b 100644 (file)
@@ -78,7 +78,7 @@ GRAPHICS_IMPEXP int sci_param3d(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_newaxes(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_move(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_matlot1(char *fname, void *pvApiCtx);
-GRAPHICS_IMPEXP int sci_matplot1(char *fname, void *pvApiCtx);
+//GRAPHICS_IMPEXP int sci_matplot1(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_matlot(char *fname, void *pvApiCtx);
 //GRAPHICS_IMPEXP int sci_matplot(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_Legend(char *fname, void *pvApiCtx);
diff --git a/scilab/modules/graphics/sci_gateway/c/sci_matplot1.c b/scilab/modules/graphics/sci_gateway/c/sci_matplot1.c
deleted file mode 100644 (file)
index b774937..0000000
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Fabrice Leray
- * Copyright (C) 2006 - INRIA - Jean-Baptiste Silvy
- * Copyright (C) 2012 - DIGITEO - Manuel Juliachs
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
- *
- */
-
-/*------------------------------------------------------------------------*/
-/* file: sci_matplot1.c                                                   */
-/* desc : interface for matplot1 routine                                  */
-/*------------------------------------------------------------------------*/
-#include "api_scilab.h"
-#include "Scierror.h"
-#include "localization.h"
-#include "gw_graphics.h"
-#include "BuildObjects.h"
-#include "sciCall.h"
-#include "Matplot.h"
-
-/*--------------------------------------------------------------------------*/
-int sci_matplot1(char * fname, void *pvApiCtx)
-{
-    SciErr sciErr;
-    int m1 = 0, n1 = 0, m2 = 0, n2 = 0;
-    int* piAddr1 = NULL;
-    int* piAddr2 = NULL;
-    int type;
-    int plottype = -1;
-    int precision;
-
-    double* l1 = NULL;
-    double* l2 = NULL;
-
-    if (nbInputArgument(pvApiCtx) <= 0)
-    {
-        sci_demo(fname, pvApiCtx);
-        return 0;
-    }
-
-    CheckInputArgument(pvApiCtx, 2, 2);
-    //get variable address
-    sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);
-    if (sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 1;
-    }
-
-    sciErr = getVarType(pvApiCtx, piAddr1, &type);
-    if (sciErr.iErr)
-    {
-        Scierror(999, _("%s: Cannot get the data type.\n"), fname, 1);
-        printError(&sciErr, 0);
-        return 1;
-    }
-
-    switch (type)
-    {
-        case sci_matrix :
-            sciErr = getMatrixOfDouble(pvApiCtx, piAddr1, &m1, &n1, (double **)&l1);
-            if (sciErr.iErr)
-            {
-                Scierror(202, _("%s: Wrong type for argument #%d: A real expected.\n"), fname, 1);
-                printError(&sciErr, 0);
-                return 1;
-            }
-
-            if (m1 * n1 == 0)
-            {
-                AssignOutputVariable(pvApiCtx, 1) = 0;
-                ReturnArguments(pvApiCtx);
-                return 0;
-            }
-
-            plottype = buildMatplotType(MATPLOT_Double, MATPLOT_FORTRAN, MATPLOT_INDEX);
-            break;
-        case sci_ints :
-            sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddr1, &precision);
-            if (sciErr.iErr)
-            {
-                Scierror(999, _("%s: Cannot get the integer type for argument #%d.\n"), fname, 1);
-                printError(&sciErr, 0);
-                return 1;
-            }
-
-            switch (precision)
-            {
-                case SCI_INT8 :
-                    sciErr = getMatrixOfInteger8(pvApiCtx, piAddr1, &m1, &n1, (char **)(&l1));
-                    if (sciErr.iErr)
-                    {
-                        Scierror(202, _("%s: Cannot get the data for argument #%d.\n"), fname, 1);
-                        printError(&sciErr, 0);
-                        return 1;
-                    }
-                    plottype = buildMatplotType(MATPLOT_Char, MATPLOT_FORTRAN, MATPLOT_RGB_332);
-                    break;
-                case SCI_UINT8 :
-                    sciErr = getMatrixOfUnsignedInteger8(pvApiCtx, piAddr1, &m1, &n1, (unsigned char **)(&l1));
-                    if (sciErr.iErr)
-                    {
-                        Scierror(202, _("%s: Cannot get the data for argument #%d.\n"), fname, 1);
-                        printError(&sciErr, 0);
-                        return 1;
-                    }
-                    plottype = buildMatplotType(MATPLOT_UChar, MATPLOT_FORTRAN, MATPLOT_GRAY);
-                    break;
-                case SCI_INT16 :
-                    sciErr = getMatrixOfInteger16(pvApiCtx, piAddr1, &m1, &n1, (short **)(&l1));
-                    if (sciErr.iErr)
-                    {
-                        Scierror(202, _("%s: Cannot get the data for argument #%d.\n"), fname, 1);
-                        printError(&sciErr, 0);
-                        return 1;
-                    }
-                    plottype = buildMatplotType(MATPLOT_Short, MATPLOT_FORTRAN, MATPLOT_RGB_444);
-                    break;
-                case SCI_UINT16 :
-                    sciErr = getMatrixOfUnsignedInteger16(pvApiCtx, piAddr1, &m1, &n1, (unsigned short **)(&l1));
-                    if (sciErr.iErr)
-                    {
-                        Scierror(202, _("%s: Cannot get the data for argument #%d.\n"), fname, 1);
-                        printError(&sciErr, 0);
-                        return 1;
-                    }
-                    plottype = buildMatplotType(MATPLOT_UShort, MATPLOT_FORTRAN, MATPLOT_RGBA_4444);
-                    break;
-                case SCI_INT32 :
-                    sciErr = getMatrixOfInteger32(pvApiCtx, piAddr1, &m1, &n1, (int **)(&l1));
-                    if (sciErr.iErr)
-                    {
-                        Scierror(202, _("%s: Cannot get the data for argument #%d.\n"), fname, 1);
-                        printError(&sciErr, 0);
-                        return 1;
-                    }
-                    plottype = buildMatplotType(MATPLOT_Int, MATPLOT_FORTRAN, MATPLOT_RGB);
-                    break;
-                case SCI_UINT32 :
-                    sciErr = getMatrixOfUnsignedInteger32(pvApiCtx, piAddr1, &m1, &n1, (unsigned int **)(&l1));
-                    if (sciErr.iErr)
-                    {
-                        Scierror(202, _("%s: Cannot get the data for argument #%d.\n"), fname, 1);
-                        printError(&sciErr, 0);
-                        return 1;
-                    }
-                    plottype = buildMatplotType(MATPLOT_UInt, MATPLOT_FORTRAN, MATPLOT_RGBA);
-                    break;
-                default :
-                    Scierror(202, _("%s: Wrong type for input argument #%d: A real or integer expected.\n"), fname, 1);
-                    return 1;
-            }
-            break;
-        case sci_mlist :
-            if (isHypermatType(pvApiCtx, piAddr1))
-            {
-                int htype = 0;
-                int ndims = 0;
-                int * dims = NULL;
-
-                sciErr = getHypermatType(pvApiCtx, piAddr1, &htype);
-                if (sciErr.iErr)
-                {
-                    Scierror(202, _("%s: Cannot get the hypermatrix data type for argument #%d.\n"), fname, 1);
-                    return 1;
-                }
-
-                if (htype == sci_ints)
-                {
-                    sciErr = getHypermatOfIntegerPrecision(pvApiCtx, piAddr1, &precision);
-                    if (sciErr.iErr)
-                    {
-                        Scierror(202, _("%s: Cannot get the hypermatrix data type for argument #%d.\n"), fname, 1);
-                        return 1;
-                    }
-
-                    if (precision != SCI_UINT8 && precision != SCI_INT8)
-                    {
-                        Scierror(202, _("%s: Wrong type for input argument #%d: A real or integer expected.\n"), fname, 1);
-                        return 1;
-                    }
-
-                    if (precision == SCI_UINT8)
-                    {
-                        sciErr = getHypermatOfUnsignedInteger8(pvApiCtx, piAddr1, &dims, &ndims, (unsigned char **)&l1);
-                    }
-                    else
-                    {
-                        sciErr = getHypermatOfInteger8(pvApiCtx, piAddr1, &dims, &ndims, (char **)&l1);
-                    }
-
-                    if (sciErr.iErr || ndims != 3 || (dims[2] != 1 && dims[2] != 3 && dims[2] != 4))
-                    {
-                        Scierror(202, _("%s: Wrong type for input argument #%d: A real or integer expected.\n"), fname, 1);
-                        return 1;
-                    }
-
-                    m1 = dims[0];
-                    n1 = dims[1];
-                    if (dims[2] == 1)
-                    {
-                        if (precision == SCI_INT8)
-                        {
-                            plottype = buildMatplotType(MATPLOT_HM1_Char, MATPLOT_FORTRAN, MATPLOT_GRAY);
-                        }
-                        else
-                        {
-                            plottype = buildMatplotType(MATPLOT_HM1_UChar, MATPLOT_FORTRAN, MATPLOT_GRAY);
-                        }
-                    }
-                    else if (dims[2] == 3)
-                    {
-                        if (precision == SCI_INT8)
-                        {
-                            plottype = buildMatplotType(MATPLOT_HM3_Char, MATPLOT_FORTRAN, MATPLOT_RGB);
-                        }
-                        else
-                        {
-                            plottype = buildMatplotType(MATPLOT_HM3_UChar, MATPLOT_FORTRAN, MATPLOT_RGB);
-                        }
-                    }
-                    else
-                    {
-                        if (precision == SCI_INT8)
-                        {
-                            plottype = buildMatplotType(MATPLOT_HM4_Char, MATPLOT_FORTRAN, MATPLOT_RGBA);
-                        }
-                        else
-                        {
-                            plottype = buildMatplotType(MATPLOT_HM4_UChar, MATPLOT_FORTRAN, MATPLOT_RGBA);
-                        }
-                    }
-                }
-                else if (htype == sci_matrix)
-                {
-                    sciErr = getHypermatOfDouble(pvApiCtx, piAddr1, &dims, &ndims, (double **)&l1);
-                    if (sciErr.iErr || ndims != 3 || (dims[2] != 1 && dims[2] != 3 && dims[2] != 4))
-                    {
-                        Scierror(202, _("%s: Wrong type for argument #%d: A real or integer expected.\n"), fname, 1);
-                        return 1;
-                    }
-
-                    m1 = dims[0];
-                    n1 = dims[1];
-                    if (dims[2] == 1)
-                    {
-                        plottype = buildMatplotType(MATPLOT_HM1_Double, MATPLOT_FORTRAN, MATPLOT_GRAY);
-                    }
-                    else if (dims[2] == 3)
-                    {
-                        plottype = buildMatplotType(MATPLOT_HM3_Double, MATPLOT_FORTRAN, MATPLOT_RGB);
-                    }
-                    else
-                    {
-                        plottype = buildMatplotType(MATPLOT_HM4_Double, MATPLOT_FORTRAN, MATPLOT_RGBA);
-                    }
-                }
-                else
-                {
-                    Scierror(202, _("%s: Wrong type for input argument #%d: A real or integer expected.\n"), "data", 1);
-                    return 1;
-                }
-            }
-            break;
-        default :
-            Scierror(202, _("%s: Wrong type for input argument #%d: A real or integer expected.\n"), fname, 1);
-            return 1;
-    }
-
-    //get variable address
-    sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
-    if (sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 1;
-    }
-
-    // Retrieve a matrix of double at position 2.
-    sciErr = getMatrixOfDouble(pvApiCtx, piAddr2, &m2, &n2, &l2);
-    if (sciErr.iErr)
-    {
-        Scierror(202, _("%s: Wrong type for input argument #%d: A real expected.\n"), fname, 2);
-        printError(&sciErr, 0);
-        return 1;
-    }
-
-    //CheckLength
-    if (m2 * n2 != 4)
-    {
-        Scierror(999, _("%s: Wrong size for input argument #%d: %d expected.\n"), fname, 2, m2 * n2);
-        return 1;
-    }
-
-    if (m1 * n1 == 0)
-    {
-        AssignOutputVariable(pvApiCtx, 1) = 0;
-        ReturnArguments(pvApiCtx);
-        return 0;
-    }
-
-    getOrCreateDefaultSubwin();
-
-    /* NG beg */
-    Objmatplot1 ((l1), &m1, &n1, (l2), plottype);
-
-    AssignOutputVariable(pvApiCtx, 1) = 0;
-    ReturnArguments(pvApiCtx);
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
index 1f9a632..6351e66 100644 (file)
@@ -26,6 +26,7 @@
     <ClCompile Include="graphics_gw.cpp" />
     <ClCompile Include="sci_get.cpp" />
     <ClCompile Include="sci_matplot.cpp" />
+    <ClCompile Include="sci_matplot1.cpp" />
     <ClCompile Include="sci_winsid.cpp" />
     <ClCompile Include="sci_xget.cpp" />
     <ClCompile Include="sci_xset.cpp" />
index 31dd257..4907c56 100644 (file)
@@ -38,5 +38,8 @@
     <ClCompile Include="sci_matplot.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="sci_matplot1.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/scilab/modules/graphics/sci_gateway/cpp/sci_matplot1.cpp b/scilab/modules/graphics/sci_gateway/cpp/sci_matplot1.cpp
new file mode 100644 (file)
index 0000000..778618c
--- /dev/null
@@ -0,0 +1,241 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Fabrice Leray
+ * Copyright (C) 2006 - INRIA - Jean-Baptiste Silvy
+ * Copyright (C) 2012 - DIGITEO - Manuel Juliachs
+ * Copyright (C) 2014 - Scilab Enterprises - Anais AUBERT
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+/*------------------------------------------------------------------------*/
+/* file: sci_matplot1.c                                                   */
+/* desc : interface for matplot1 routine                                  */
+/*------------------------------------------------------------------------*/
+
+#include "graphics_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "string.hxx"
+#include "graphichandle.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include <string.h>
+#include "gw_graphics.h"
+#include "GetCommandArg.h"
+#include "DefaultCommandArg.h"
+#include "BuildObjects.h"
+#include "sciCall.h"
+#include "api_scilab.h"
+#include "localization.h"
+#include "Scierror.h"
+#include "Matplot.h"
+}
+
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_matplot1(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    int m1 = 0, n1 = 0, m2 = 0, n2 = 0;
+    int* piAddr1 = NULL;
+    int* piAddr2 = NULL;
+    int type;
+    int plottype = -1;
+    int precision;
+    int *dims = NULL;
+
+    double* l1 = NULL;
+    double* l2 = NULL;
+
+
+    if (in.size() < 1)
+    {
+        return Overload::call(L"%_Matplot1", in, _iRetCount, out, new ast::ExecVisitor());
+
+    }
+    else if (in.size() != 2)
+    {
+        Scierror(999, _("%s: Wrong number of input argument(s): %d expected.\n"), "Matplot1", 2);
+        return types::Function::Error;
+    }
+
+    if (in[0]->isDouble())
+    {
+        types::Double *pDbl = in[0]->getAs<types::Double>();
+        l1 = pDbl->get();
+        if (pDbl->getDims() > 2)
+        {
+            dims = pDbl->getDimsArray();
+            if (pDbl->getDims() > 3 || (dims[2] != 1 && dims[2] != 3 && dims[2] != 4))
+            {
+                Scierror(999, _("%s: Wrong type for input argument #%d: A real or integer expected.\n"), "Matplot1", 1);
+                return types::Function::Error;
+            }
+
+            m1 = dims[0];
+            n1 = dims[1];
+            if (dims[2] == 1)
+            {
+                plottype = buildMatplotType(MATPLOT_HM1_Double, MATPLOT_FORTRAN, MATPLOT_GRAY);
+            }
+            else if (dims[2] == 3)
+            {
+                plottype = buildMatplotType(MATPLOT_HM3_Double, MATPLOT_FORTRAN, MATPLOT_RGB);
+            }
+            else
+            {
+                plottype = buildMatplotType(MATPLOT_HM4_Double, MATPLOT_FORTRAN, MATPLOT_RGBA);
+            }
+        }
+        else
+        {
+            m1 = pDbl->getRows();
+            n1 = pDbl->getCols();
+            plottype = buildMatplotType(MATPLOT_Double, MATPLOT_FORTRAN, MATPLOT_INDEX);
+        }
+    }
+    else if (in[0]->isInt8())
+    {
+        types::Int8 *pDbl = in[0]->getAs<types::Int8>();
+        l1 = (double *)pDbl->get();
+        if (pDbl->getDims() > 2)
+        {
+
+            dims = pDbl->getDimsArray();
+            if (pDbl->getDims() > 3 || (dims[2] != 1 && dims[2] != 3 && dims[2] != 4))
+            {
+                Scierror(999, _("%s: Wrong type for input argument #%d: A real or integer expected.\n"), "Matplot1", 1);
+                return types::Function::Error;
+            }
+
+            m1 = dims[0];
+            n1 = dims[1];
+            if (dims[2] == 1)
+            {
+                plottype = buildMatplotType(MATPLOT_HM1_Char, MATPLOT_FORTRAN, MATPLOT_GRAY);
+            }
+            else if (dims[2] == 3)
+            {
+                plottype = buildMatplotType(MATPLOT_HM1_Char, MATPLOT_FORTRAN, MATPLOT_RGB);
+            }
+            else
+            {
+                plottype = buildMatplotType(MATPLOT_HM1_Char, MATPLOT_FORTRAN, MATPLOT_RGBA);
+            }
+        }
+        else
+        {
+            m1 = pDbl->getRows();
+            n1 = pDbl->getCols();
+            plottype = buildMatplotType(MATPLOT_Char, MATPLOT_FORTRAN, MATPLOT_INDEX);
+        }
+    }
+    else if (in[0]->isUInt8())
+    {
+        types::UInt8 *pDbl = in[0]->getAs<types::UInt8>();
+        l1 = (double *)pDbl->get();
+        if (pDbl->getDims() > 2)
+        {
+
+            dims = pDbl->getDimsArray();
+            if (pDbl->getDims() > 3 || (dims[2] != 1 && dims[2] != 3 && dims[2] != 4))
+            {
+                Scierror(999, _("%s: Wrong type for input argument #%d: A real or integer expected.\n"), "Matplot1", 1);
+                return types::Function::Error;
+            }
+
+            m1 = dims[0];
+            n1 = dims[1];
+            if (dims[2] == 1)
+            {
+                plottype = buildMatplotType(MATPLOT_HM1_UChar, MATPLOT_FORTRAN, MATPLOT_GRAY);
+            }
+            else if (dims[2] == 3)
+            {
+                plottype = buildMatplotType(MATPLOT_HM1_UChar, MATPLOT_FORTRAN, MATPLOT_RGB);
+            }
+            else
+            {
+                plottype = buildMatplotType(MATPLOT_HM1_UChar, MATPLOT_FORTRAN, MATPLOT_RGBA);
+            }
+        }
+        else
+        {
+            m1 = pDbl->getRows();
+            n1 = pDbl->getCols();
+            plottype = buildMatplotType(MATPLOT_UChar, MATPLOT_FORTRAN, MATPLOT_INDEX);
+        }
+    }
+    else if (in[0]->isInt16())
+    {
+        types::Int16 *pDbl = in[0]->getAs<types::Int16>();
+        l1 = (double *)pDbl->get();
+        m1 = pDbl->getRows();
+        n1 = pDbl->getCols();
+        plottype = buildMatplotType(MATPLOT_Short, MATPLOT_FORTRAN, MATPLOT_INDEX);
+    }
+    else if (in[0]->isUInt16())
+    {
+        types::UInt16 *pDbl = in[0]->getAs<types::UInt16>();
+        l1 = (double *)pDbl->get();
+        m1 = pDbl->getRows();
+        n1 = pDbl->getCols();
+        plottype = buildMatplotType(MATPLOT_UShort, MATPLOT_FORTRAN, MATPLOT_INDEX);
+    }
+    else if ((in[0]->isInt32()) || (in[0]->isInt64()))
+    {
+        types::Int32 *pDbl = in[0]->getAs<types::Int32>();
+        l1 = (double *)pDbl->get();
+        m1 = pDbl->getRows();
+        n1 = pDbl->getCols();
+        plottype = buildMatplotType(MATPLOT_Int, MATPLOT_FORTRAN, MATPLOT_INDEX);
+    }
+    else if ((in[0]->isUInt32()) || (in[0]->isUInt64()))
+    {
+        types::UInt32 *pDbl = in[0]->getAs<types::UInt32>();
+        l1 = (double *)pDbl->get();
+        m1 = pDbl->getRows();
+        n1 = pDbl->getCols();
+        plottype = buildMatplotType(MATPLOT_UInt, MATPLOT_FORTRAN, MATPLOT_INDEX);
+    }
+
+    if (!(in[1]->isDouble()))
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d: A real expected.\n"), "Matplot1", 2);
+        return types::Function::Error;
+
+    }
+    types::Double *pDbl1 = in[1]->getAs<types::Double>();
+    if (pDbl1->getDims() > 2)
+    {
+        Scierror(999, _("%s: Wrong size for input argument #%d: Row vector expected.\n"), "Matplot1", 2);
+        return types::Function::Error;
+    }
+
+    l2 = pDbl1->get();
+    m2 = pDbl1->getRows();
+    n2 = pDbl1->getCols();
+
+    //CheckLength
+    if (m2 * n2 != 4)
+    {
+        Scierror(999, _("%s: Wrong size for input argument #%d: %d expected.\n"), "Matplot1", 2, m2 * n2);
+        return types::Function::Error;
+    }
+
+    getOrCreateDefaultSubwin();
+
+    /* NG beg */
+    Objmatplot1 ((l1), &m1, &n1, (l2), plottype);
+
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/