From b19baa280506910bc1f20817d3d3cad2f575154e Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Thu, 13 Jun 2024 08:28:41 +0200 Subject: [PATCH] #3395 complit creaVtk_MACROS --- src/creaVtk_MACROS.h | 49 +++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/src/creaVtk_MACROS.h b/src/creaVtk_MACROS.h index 57fb09a..26c2ff4 100644 --- a/src/creaVtk_MACROS.h +++ b/src/creaVtk_MACROS.h @@ -57,35 +57,38 @@ namespace crea #define GETVALUE_VTK_CREA(VALUE,POINTER,SCALARTYPE) \ - if (SCALARTYPE==VTK_DOUBLE) { VALUE=(double)*((double*)POINTER); } \ - else if (SCALARTYPE==VTK_FLOAT) { VALUE=(double)*((float*)POINTER); } \ - else if (SCALARTYPE==VTK_CHAR) { VALUE=(double)*((char*)POINTER); } \ - else if (SCALARTYPE==VTK_UNSIGNED_CHAR) { VALUE=(double)*((unsigned char*)POINTER); } \ - else if (SCALARTYPE==VTK_INT) { VALUE=(double)*((int*)POINTER); } \ - else if (SCALARTYPE==VTK_UNSIGNED_INT) { VALUE=(double)*((unsigned int*)POINTER); } \ - else if (SCALARTYPE==VTK_LONG) { VALUE=(double)*((long*)POINTER); } \ - else if (SCALARTYPE==VTK_UNSIGNED_LONG) { VALUE=(double)*((unsigned long*)POINTER); } \ - else if (SCALARTYPE==VTK_SHORT) { VALUE=(double)*((short*)POINTER); } \ - else if (SCALARTYPE==VTK_UNSIGNED_SHORT){ VALUE=(double)*((unsigned short*)POINTER);} \ - else { printf("EED GETVALUE_MANUALPAINT error\n"); } + if (SCALARTYPE==VTK_DOUBLE) { VALUE=(double)*((double*)POINTER); } \ + else if (SCALARTYPE==VTK_FLOAT) { VALUE=(double)*((float*)POINTER); } \ + else if (SCALARTYPE==VTK_CHAR) { VALUE=(double)*((char*)POINTER); } \ + else if (SCALARTYPE==VTK_SIGNED_CHAR) { VALUE=(double)*((char*)POINTER); } \ + else if (SCALARTYPE==VTK_UNSIGNED_CHAR) { VALUE=(double)*((unsigned char*)POINTER); } \ + else if (SCALARTYPE==VTK_INT) { VALUE=(double)*((int*)POINTER); } \ + else if (SCALARTYPE==VTK_UNSIGNED_INT) { VALUE=(double)*((unsigned int*)POINTER); } \ + else if (SCALARTYPE==VTK_LONG) { VALUE=(double)*((long*)POINTER); } \ + else if (SCALARTYPE==VTK_UNSIGNED_LONG) { VALUE=(double)*((unsigned long*)POINTER); } \ + else if (SCALARTYPE==VTK_SHORT) { VALUE=(double)*((short*)POINTER); } \ + else if (SCALARTYPE==VTK_UNSIGNED_SHORT){ VALUE=(double)*((unsigned short*)POINTER); } \ + else { printf("EED Error! creaVtk_MACROS.h GETVALUE_VTK_CREA SCALARTYPE=%d \n",SCALARTYPE); } #define GETVALUE2_VTK_CREA(VALUE,POINTER,SCALARTYPE,INDEX) \ - if (SCALARTYPE==VTK_DOUBLE) { VALUE=(double)((double*)POINTER)[INDEX]; } \ - else if (SCALARTYPE==VTK_FLOAT) { VALUE=(double)((float*)POINTER)[INDEX]; } \ - else if (SCALARTYPE==VTK_CHAR) { VALUE=(double)((char*)POINTER)[INDEX]; } \ - else if (SCALARTYPE==VTK_UNSIGNED_CHAR) { VALUE=(double)((unsigned char*)POINTER)[INDEX]; } \ - else if (SCALARTYPE==VTK_INT) { VALUE=(double)((int*)POINTER)[INDEX]; } \ - else if (SCALARTYPE==VTK_UNSIGNED_INT) { VALUE=(double)((unsigned int*)POINTER)[INDEX]; } \ - else if (SCALARTYPE==VTK_LONG) { VALUE=(double)((long*)POINTER)[INDEX]; } \ - else if (SCALARTYPE==VTK_UNSIGNED_LONG) { VALUE=(double)((unsigned long*)POINTER)[INDEX]; } \ - else if (SCALARTYPE==VTK_SHORT) { VALUE=(double)((short*)POINTER)[INDEX]; } \ - else if (SCALARTYPE==VTK_UNSIGNED_SHORT){ VALUE=(double)((unsigned short*)POINTER)[INDEX]; } \ - else { printf("EED GETVALUE2_MANUALPAINT error\n"); } + if (SCALARTYPE==VTK_DOUBLE) { VALUE=(double)((double*)POINTER)[INDEX]; } \ + else if (SCALARTYPE==VTK_FLOAT) { VALUE=(double)((float*)POINTER)[INDEX]; } \ + else if (SCALARTYPE==VTK_CHAR) { VALUE=(double)((char*)POINTER)[INDEX]; } \ + else if (SCALARTYPE==VTK_SIGNED_CHAR) { VALUE=(double)((char*)POINTER)[INDEX]; } \ + else if (SCALARTYPE==VTK_UNSIGNED_CHAR) { VALUE=(double)((unsigned char*)POINTER)[INDEX]; } \ + else if (SCALARTYPE==VTK_INT) { VALUE=(double)((int*)POINTER)[INDEX]; } \ + else if (SCALARTYPE==VTK_UNSIGNED_INT) { VALUE=(double)((unsigned int*)POINTER)[INDEX]; } \ + else if (SCALARTYPE==VTK_LONG) { VALUE=(double)((long*)POINTER)[INDEX]; } \ + else if (SCALARTYPE==VTK_UNSIGNED_LONG) { VALUE=(double)((unsigned long*)POINTER)[INDEX]; } \ + else if (SCALARTYPE==VTK_SHORT) { VALUE=(double)((short*)POINTER)[INDEX]; } \ + else if (SCALARTYPE==VTK_UNSIGNED_SHORT){ VALUE=(double)((unsigned short*)POINTER)[INDEX]; } \ + else { printf("EED Error! creaVtk_MACROS.h GETVALUE2_VTK_CREA SCALARTYPE=%d \n",SCALARTYPE);} #define SETVALUE2_VTK_CREA(VALUE,POINTER,SCALARTYPE,INDEX) \ if (SCALARTYPE==VTK_DOUBLE) { ((double*)POINTER)[INDEX] = (double)VALUE; } \ else if (SCALARTYPE==VTK_FLOAT) { ((float*)POINTER)[INDEX] = (float)VALUE; } \ else if (SCALARTYPE==VTK_CHAR) { ((char*)POINTER)[INDEX] = (char)VALUE; } \ + else if (SCALARTYPE==VTK_SIGNED_CHAR) { ((char*)POINTER)[INDEX] = (char)VALUE; } \ else if (SCALARTYPE==VTK_UNSIGNED_CHAR) { ((unsigned char*)POINTER)[INDEX] = (unsigned char)VALUE; } \ else if (SCALARTYPE==VTK_INT) { ((int*)POINTER)[INDEX] = (int)VALUE; } \ else if (SCALARTYPE==VTK_UNSIGNED_INT) { ((unsigned int*)POINTER)[INDEX] = (unsigned int)VALUE; } \ @@ -93,7 +96,7 @@ namespace crea else if (SCALARTYPE==VTK_UNSIGNED_LONG) { ((unsigned long*)POINTER)[INDEX] = (unsigned long)VALUE; } \ else if (SCALARTYPE==VTK_SHORT) { ((short*)POINTER)[INDEX] = (short)VALUE; } \ else if (SCALARTYPE==VTK_UNSIGNED_SHORT){ ((unsigned short*)POINTER)[INDEX] = (unsigned short)VALUE;} \ - else { printf("EED SETVALUE2_MANUALPAINT error\n"); } + else { printf("EED Error! creaVtk_MACROS.h SETVALUE2_VTK_CREA SCALARTYPE=%d \n",SCALARTYPE); } } -- 2.47.1