]> Creatis software - crea.git/commitdiff
#3395 complit creaVtk_MACROS
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Thu, 13 Jun 2024 06:28:41 +0000 (08:28 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Thu, 13 Jun 2024 06:28:41 +0000 (08:28 +0200)
src/creaVtk_MACROS.h

index 57fb09aa710caa89ba5421621a37e0e85b622b21..26c2ff47a50b33b0a30e3131087018f795dafae9 100644 (file)
@@ -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);   }
 
 }