]> Creatis software - creaVtk.git/commitdiff
#3470 merge vtk8itk5wx3-mingw64
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 10 Sep 2021 13:12:29 +0000 (15:12 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 10 Sep 2021 13:12:29 +0000 (15:12 +0200)
1  2 
bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.cxx
lib/creaVtk/vtkTensorsVisu.cpp
lib/creaVtk/vtkVectorsVisu.cpp

index cfa8d83d0f47cf3efeedd5c6e261e5d3e281c31f,59f3b902d368dd5b73d009b4449320c4f7bf57f6..9ca404f9a399f94c44a2837ffa56e9e8c8585aab
@@@ -36,9 -36,12 +36,12 @@@ BBTK_BLACK_BOX_IMPLEMENTATION(ReadMHDPl
  
  vtkImageData* ReadMHDPlane::CreateDefaultImage()
  {
+       vtkImageData *newImage = NULL;
+ /*
+       newImage = vtkImageData::New();
        int i;
        int sizeX, sizeY, sizeZ;
-       sizeX = 200;
+       sizeX = 1;
        sizeY = sizeX;
        sizeZ = 1;
        vtkImageData *newImage = vtkImageData::New();
        newImage->AllocateScalars();
        newImage->Update();
  #else
-       newImage->AllocateScalars(VTK_UNSIGNED_CHAR,1);
+ //    newImage->AllocateScalars(VTK_UNSIGNED_CHAR,1);
+       newImage->AllocateScalars(VTK_SHORT,1);
  #endif
-       memset ( (void*)newImage->GetScalarPointer(), 0, sizeX*sizeY*1 );
-       for (i=0; i<sizeX; i++)
-       {
-               newImage->SetScalarComponentFromDouble(i,i,0, 0, 255 );
-               newImage->SetScalarComponentFromDouble(i,sizeY-1-i,0, 0, 255 );
-       } // for i
+ //    memset ( (void*)newImage->GetScalarPointer(), 0, sizeX*sizeY*sizeZ*sizeof(unsigned char) );
+       memset ( (void*)newImage->GetScalarPointer(), 0, sizeX*sizeY*sizeof(short) );
+ //    for (i=0; i<sizeX; i++)
+ //    {
+ //            newImage->SetScalarComponentFromDouble(i,i                      ,0, 0, 255 );
+ //            newImage->SetScalarComponentFromDouble(i,sizeY-1-i      ,0, 0, 255 );
+ //    } // for i
+       newImage->Modified();
+ */
        return newImage;
  } 
  
  vtkImageData* ReadMHDPlane::ChangeOrientation(vtkImageData* imgOrg)
  {
-       int     width = bbGetInputWidth();
-       int     ext[6];
-       int     sizeXOrg, sizeYOrg,sizeZOrg;
-       int     sizeXDst, sizeYDst,sizeZDst;
- //EED 2017-01-01 Migration VTK7
- #if VTK_MAJOR_VERSION <= 5
-       imgOrg->GetWholeExtent(ext);
- #else
-       imgOrg->GetExtent(ext);
- #endif
-       int     sizeLine;
-       
-       sizeXOrg        = ext[1]-ext[0]+1;
-       sizeYOrg        = ext[3]-ext[2]+1;
-       sizeZOrg        = ext[5]-ext[4]+1;
+       vtkImageData *imgDst  = NULL;
  
-       if (bbGetInputDirectionPlane()=="XY")
-       {
-               sizeXDst        = ext[1]-ext[0]+1;
-               sizeYDst        = ext[3]-ext[2]+1;
-               sizeZDst        = width;
-       } // XY 
-       if (bbGetInputDirectionPlane()=="YZ") 
-       {
-               sizeXDst        = width;
-               sizeYDst        = ext[1]-ext[0]+1;
-               sizeZDst        = ext[3]-ext[2]+1;
-               sizeLine        = sizeYDst;
-       } // YZ
-       if (bbGetInputDirectionPlane()=="ZX")
+       if (imgOrg!=NULL)
        {
-               sizeXDst        = ext[1]-ext[0]+1;
-               sizeYDst        = width;
-               sizeZDst        = ext[3]-ext[2]+1;
-               sizeLine        = sizeXDst;
-       } // ZX
-       vtkImageData *imgDst  = vtkImageData::New();
-       imgDst->Initialize();
-       imgDst->SetSpacing( imgOrg->GetSpacing() );
-       imgDst->SetDimensions( sizeXDst,sizeYDst,sizeZDst );
-       imgDst->SetExtent(0,sizeXDst-1,0,sizeYDst-1,0,sizeZDst-1 );
-       
- //EED 2017-01-01 Migration VTK7
- #if VTK_MAJOR_VERSION <= 5
-       imgDst->SetWholeExtent(0,sizeXDst-1,0,sizeYDst-1,0,sizeZDst-1 );
-       imgDst->SetScalarType( imgOrg->GetScalarType() );
-       imgDst->SetNumberOfScalarComponents(1);
-       imgDst->AllocateScalars();
-       imgDst->Update();
- #else
-       imgDst->AllocateScalars(imgOrg->GetScalarType(),1);
- #endif
-       char *ptrDst,*ptrOrg;
-       int sizeBytes = imgOrg->GetScalarSize();                
-       int sizeLineBytes = sizeLine*imgOrg->GetScalarSize();           
-       int xx,yy,zz;
-       long int sizeXDstBytes          = sizeXDst*sizeBytes;
-       long int sizeXYDstBytes         = sizeXDst*sizeYDst*sizeBytes;
-       long int sizeXYDstBytes2        = sizeXDst*sizeYDst*sizeBytes*2;
-       long int sizeXYZDstBytes        = sizeXDst*sizeYDst*sizeZDst*sizeBytes;
-       long int sizeXYZDstBytes1       = sizeXDst*sizeYDst*(sizeZDst-1)*sizeBytes;
-       ptrOrg = (char*)( imgOrg->GetScalarPointer() );
-       if (bbGetInputDirectionPlane()=="XY")
-       {
-               memcpy ( imgDst->GetScalarPointer(), ptrOrg , sizeXDst*sizeYDst*sizeZDst*(imgOrg->GetScalarSize()) );
-       } // if XY
+               int     width;
+               int     ext[6];
+               int     sizeXOrg, sizeYOrg,sizeZOrg;
+               int     sizeXDst, sizeYDst,sizeZDst;
+       //EED 2017-01-01 Migration VTK7
+       #if VTK_MAJOR_VERSION <= 5
+               imgOrg->GetWholeExtent(ext);
+       #else
+               imgOrg->GetExtent(ext);
+       #endif
+               int     sizeLine;
+               
+               sizeXOrg        = ext[1]-ext[0]+1;
+               sizeYOrg        = ext[3]-ext[2]+1;
+               sizeZOrg        = ext[5]-ext[4]+1;
+       width=sizeZOrg;
+               if (bbGetInputDirectionPlane()=="XY")
+               {
+                       sizeXDst        = ext[1]-ext[0]+1;
+                       sizeYDst        = ext[3]-ext[2]+1;
+                       sizeZDst        = width;
+               } // XY 
+               if (bbGetInputDirectionPlane()=="YZ") 
+               {
+                       sizeXDst        = width;
+                       sizeYDst        = ext[1]-ext[0]+1;
+                       sizeZDst        = ext[3]-ext[2]+1;
+                       sizeLine        = sizeYDst;
+               } // YZ
+               if (bbGetInputDirectionPlane()=="ZX")
+               {
+                       sizeXDst        = ext[1]-ext[0]+1;
+                       sizeYDst        = width;
+                       sizeZDst        = ext[3]-ext[2]+1;
+                       sizeLine        = sizeXDst;
+               } // ZX
+               imgDst  = vtkImageData::New();
+               imgDst->Initialize();
+               imgDst->SetSpacing( imgOrg->GetSpacing() );
+               imgDst->SetDimensions( sizeXDst,sizeYDst,sizeZDst );
+               imgDst->SetExtent(0,sizeXDst-1,0,sizeYDst-1,0,sizeZDst-1 );
+               
+       //EED 2017-01-01 Migration VTK7
+       #if VTK_MAJOR_VERSION <= 5
+               imgDst->SetWholeExtent(0,sizeXDst-1,0,sizeYDst-1,0,sizeZDst-1 );
+               imgDst->SetScalarType( imgOrg->GetScalarType() );
+               imgDst->SetNumberOfScalarComponents(1);
+               imgDst->AllocateScalars();
+               imgDst->Update();
+       #else
+               imgDst->AllocateScalars(imgOrg->GetScalarType(),1);
+       #endif
+               char *ptrDst,*ptrOrg;
+               int sizeBytes = imgOrg->GetScalarSize();                
+               int sizeLineBytes = sizeLine*imgOrg->GetScalarSize();           
+               int xx,yy,zz;
+               long int sizeXDstBytes          = sizeXDst*sizeBytes;
+               long int sizeXYDstBytes         = sizeXDst*sizeYDst*sizeBytes;
+               long int sizeXYDstBytes2        = sizeXDst*sizeYDst*sizeBytes*2;
+               long int sizeXYZDstBytes        = sizeXDst*sizeYDst*sizeZDst*sizeBytes;
+               long int sizeXYZDstBytes1       = sizeXDst*sizeYDst*(sizeZDst-1)*sizeBytes;
+               ptrOrg = (char*)( imgOrg->GetScalarPointer() );
+               if (bbGetInputDirectionPlane()=="XY")
+               {
+                       memcpy ( imgDst->GetScalarPointer(), ptrOrg , sizeXDst*sizeYDst*sizeZDst*(imgOrg->GetScalarSize()) );
+               } // if XY
  
-       if (bbGetInputDirectionPlane()=="ZX")
-       {
-               ptrDst = (char*)( imgDst->GetScalarPointer(0,0,sizeYOrg-00-1) );
-               for( zz=0 ; zz<sizeZOrg ; zz++)
+               if (bbGetInputDirectionPlane()=="ZX")
                {
//                    ptrDst=(char*)( imgDst->GetScalarPointer(0,zz,sizeYOrg-00-1) );
-                       for( yy=0 ; yy<sizeYOrg ; yy++)
                      ptrDst = (char*)( imgDst->GetScalarPointer(0,0,sizeYOrg-00-1) );
+                       for( zz=0 ; zz<sizeZOrg ; zz++)
                        {
//                            ptrOrg=(char*)( imgOrg->GetScalarPointer(0,yy,zz) );
- //                            ptrDst=(char*)( imgDst->GetScalarPointer(0,zz,sizeYOrg-yy-1) );
-                               memcpy ( ptrDst, ptrOrg , sizeLineBytes );
-                               ptrOrg = ptrOrg + sizeLineBytes;
-                               ptrDst = ptrDst - sizeXYDstBytes;
-                       } // for yy 
-                       ptrDst = ptrDst + sizeXDstBytes;
-                       ptrDst = ptrDst + sizeXYZDstBytes;
-               } // for zz 
-       } // ZX
-       if (bbGetInputDirectionPlane()=="YZ")
-       {
-               ptrDst = (char*)( imgDst->GetScalarPointer(0,0,sizeYOrg-0-1) );
-               for( zz=0 ; zz<sizeZOrg ; zz++)
      //                      ptrDst=(char*)( imgDst->GetScalarPointer(0,zz,sizeYOrg-00-1) );
+                               for( yy=0 ; yy<sizeYOrg ; yy++)
+                               {
+       //                              ptrOrg=(char*)( imgOrg->GetScalarPointer(0,yy,zz) );
+       //                              ptrDst=(char*)( imgDst->GetScalarPointer(0,zz,sizeYOrg-yy-1) );
+                                       memcpy ( ptrDst, ptrOrg , sizeLineBytes );
+                                       ptrOrg = ptrOrg + sizeLineBytes;
+                                       ptrDst = ptrDst - sizeXYDstBytes;
+                               } // for yy 
+                               ptrDst = ptrDst + sizeXDstBytes;
+                               ptrDst = ptrDst + sizeXYZDstBytes;
+                       } // for zz 
+               } // ZX
+               if (bbGetInputDirectionPlane()=="YZ")
                {
-                       ptrDst=(char*)( imgDst->GetScalarPointer(zz,0,sizeYOrg-0-1) );
-                       for( yy=0 ; yy<sizeYOrg ; yy++)
+                       ptrDst = (char*)( imgDst->GetScalarPointer(0,0,sizeYOrg-0-1) );
+                       for( zz=0 ; zz<sizeZOrg ; zz++)
                        {
//                            ptrDst=(char*)( imgDst->GetScalarPointer(zz,0,sizeYOrg-yy-1) );
-                               for( xx=0 ; xx<sizeXOrg ; xx++)
                              ptrDst=(char*)( imgDst->GetScalarPointer(zz,0,sizeYOrg-0-1) );
+                               for( yy=0 ; yy<sizeYOrg ; yy++)
                                {
- //                                    ptrOrg=(char*)( imgOrg->GetScalarPointer(xx,yy,zz) );
- //                                    ptrDst=(char*)( imgDst->GetScalarPointer(zz,xx,sizeYOrg-yy-1) );
-                                       memcpy ( ptrDst, ptrOrg , sizeBytes );
-                                       ptrOrg+= sizeBytes;
-                                       ptrDst+= sizeXDstBytes;
-                               } /// for xx
-                               ptrDst = ptrDst - sizeXYDstBytes2;
-                       } // for yy 
-                       ptrDst = ptrDst + sizeXYZDstBytes;
- //                    ptrDst++;
-               } // for zz 
-       } // ZX
+       //                              ptrDst=(char*)( imgDst->GetScalarPointer(zz,0,sizeYOrg-yy-1) );
+                                       for( xx=0 ; xx<sizeXOrg ; xx++)
+                                       {
+       //                                      ptrOrg=(char*)( imgOrg->GetScalarPointer(xx,yy,zz) );
+       //                                      ptrDst=(char*)( imgDst->GetScalarPointer(zz,xx,sizeYOrg-yy-1) );
+                                               memcpy ( ptrDst, ptrOrg , sizeBytes );
+                                               ptrOrg+= sizeBytes;
+                                               ptrDst+= sizeXDstBytes;
+                                       } /// for xx
+                                       ptrDst = ptrDst - sizeXYDstBytes2;
+                               } // for yy 
+                               ptrDst = ptrDst + sizeXYZDstBytes;
+       //                      ptrDst++;
+                       } // for zz 
+               } // ZX
+       } // if imgOrg
        return imgDst;
  }
  
@@@ -202,8 -214,8 +214,8 @@@ void ReadMHDPlane::Read64lseek(std::str
        long int        headersize=0;
        vtkImageData *newImage=NULL;
        char mystring[250];
-       char strTmp[30];
-       char strTmp2[30];
+       char strTmp[250];
+       char strTmp2[250];
        FILE *ffIn      = fopen( fileNameIn.c_str() , "r");
        long long dataSize;
        if (ffIn!=NULL)
                long long       pos;
                long long lsize                 = dimX*dimY*width *dataSize;
  #if defined(_WIN32)
 -                 _sopen_s( &fd, filename.c_str(), _O_RDONLY, _SH_DENYNO, 0 );
 +            _sopen_s( &fd, filename.c_str(), _O_RDONLY, _SH_DENYNO, 0 );
  #else
 -              fd = open ( filename.c_str() ,  O_RDONLY|O_LARGEFILE );
 +        //EED2021-09-03
 +        #if defined(MACOSX)
 +            fd = open ( filename.c_str() ,  O_RDONLY );
 +        #else
 +            fd = open ( filename.c_str() ,  O_RDONLY|O_LARGEFILE );
 +        #endif
  #endif // defined(_WIN32)
                if (fd < 0)
                {
  #if defined(_WIN32)
                        if (_lseeki64( fd, pos, SEEK_SET ) < 0)
  #else
 -                      if (lseek64(fd, pos, SEEK_SET) < 0) 
 +            //EED2021-09-03
 +            #if defined(MACOSX)
 +                if (lseek(fd, pos, SEEK_SET) < 0)
 +            #else
 +                if (lseek64(fd, pos, SEEK_SET) < 0)
 +            #endif
  #endif // defined(_WIN32)
                        {
                                printf("EED ReadMHDPlane::Read64lseek \n");
@@@ -384,12 -386,7 +396,12 @@@ void ReadMHDPlane::copy_YZ_plane(int fd
  #if defined(_WIN32)
                        if (_lseeki64( fd, pos , SEEK_SET ) < 0)
  #else
 -                      if (lseek64(fd, pos , SEEK_SET) < 0) 
 +            //EED2021-09-03
 +            #if defined(MACOSX)
 +                if (lseek(fd, pos , SEEK_SET) < 0)
 +            #else
 +                if (lseek64(fd, pos , SEEK_SET) < 0)
 +            #endif
  #endif // defined(_WIN32)
                        {
                                printf("EED ReadMHDPlane::Read64lseek \n");
@@@ -421,12 -418,7 +433,12 @@@ void ReadMHDPlane::copy_ZX_plane(int fd
  #if defined(_WIN32)
                if (_lseeki64( fd, pos + j*sizeBytesPlane , SEEK_SET ) < 0)
  #else
 -              if (lseek64(fd, pos + j*sizeBytesPlane , SEEK_SET) < 0) 
 +            //EED2021-09-03
 +            #if defined(MACOSX)
 +                if (lseek(fd, pos + j*sizeBytesPlane , SEEK_SET) < 0)
 +            #else
 +                if (lseek64(fd, pos + j*sizeBytesPlane , SEEK_SET) < 0)
 +            #endif
  #endif // defined(_WIN32)
                {
                        printf("EED ReadMHDPlane::Read64lseek \n");
index f96e10429d4733c66a380ffa9c0ecc15efe78c8e,c07942231a06686cf4cbe7c78a7dba1fb3bdece2..182f1d734cefcb6145d9b87b5849cceab0e3c117
@@@ -37,7 -37,9 +37,9 @@@ vtkTensorsVisu::vtkTensorsVisu() : vtkV
        ss                                      = vtkSphereSource::New();
        superquadratic          = vtkSuperquadricSource::New();
        cs                                      = vtkCubeSource::New(); 
-       tg                                      = vtkTensorGlyph::New();
+       tg                                      = NULL;
        pdn                             = vtkPolyDataNormals::New();
        pd                                      = vtkPolyData::New();
        pod                             = vtkPointData::New();
@@@ -56,6 -58,8 +58,8 @@@ void vtkTensorsVisu::Process(
    {
        if(GetTypeForm()==2)                                                            // source superquadratic
        {
+               if (tg==NULL) { tg = vtkTensorGlyph::New(); }
                superquadratic->SetThetaResolution(20);
                superquadratic->SetPhiResolution(20);
  #if VTK_MAJOR_VERSION <= 5
        //_pdm->SetColorModeToDefault();
        // _pdm->SetColorModeToDirectScalars();  // NOT compile
        _pdm->SetScalarModeToUsePointFieldData();
 -      _pdm->ImmediateModeRenderingOn();
 +
 +//EED2021-09-03 Deprecated. Removed in vtk 8.1
 +//    _pdm->ImmediateModeRenderingOn();
  
        _LutEED->SetVectorModeToComponent();
        //_LutEED->SetVectorModeToRGBColors();
index 7fe98611e3342bc5c0bcdcc63c4142f17d0e77e0,248420aa929128151ccc75ed66031266fe8fecdb..51392f7300698a6dac591902cc216c62060a409c
  
  //Borrame
  #include "vtkPointData.h"
+ #include "vtkArrayData.h"
+ #include "vtkDataObject.h"
+ #include <vtkPointData.h>
  
+ #include <vtkAppendPolyData.h>
  
  //------------------------------------------------------------------------------
  vtkVectorsVisu::vtkVectorsVisu()
    :vtkVectorsTensorsVisuBase()
  {
-       _vtkarrowsource         = vtkArrowSource::New();
-       _vtkglyph                       = vtkGlyph3D::New();
-       _vtklinesource          = vtkLineSource::New();
+                                       _vtkarrowsource                 = vtkArrowSource::New();
+                                       _vtkglyph                               = NULL;
+                                       _vtklineGlyphPolyData   = NULL;
+                                       _trans                                  = vtkTransform  ::New();
  
+                       double  sizeCross                               = 0.05; 
+       
        double point1[3];
        double point2[3];
-       point1[0]=1;
-       point1[1]=0;
-       point1[2]=0;
-       point2[0]=-1;
-       point2[1]=0;
-       point2[2]=0;
-       _vtklinesource->SetPoint1( point1 );
-       _vtklinesource->SetPoint2( point2 );
+       point1[0] = 1;
+       point1[1] = 0;
+       point1[2] = 0;
+       point2[0] = -1;
+       point2[1] = 0;
+       point2[2] = 0;
+       vtkLineSource   *vtklinesource1                 = vtkLineSource ::New();
+       vtklinesource1->SetPoint1( point1 );
+       vtklinesource1->SetPoint2( point2 );
+       vtklinesource1->Update();
+       point1[0] = 0;
+       point1[1] = sizeCross;
+       point1[2] = 0;
+       point2[0] = 0;
+       point2[1] = -sizeCross;
+       point2[2] = 0;
+       vtkLineSource   *vtklinesource2                 = vtkLineSource ::New();
+       vtklinesource2->SetPoint1( point1 );
+       vtklinesource2->SetPoint2( point2 );
+       vtklinesource2->Update();
+       point1[0] = 0;
+       point1[1] = 0;
+       point1[2] = sizeCross;
+       point2[0] = 0;
+       point2[1] = 0;
+       point2[2] = -sizeCross;
+       vtkLineSource   *vtklinesource3                 = vtkLineSource ::New();
+       vtklinesource3->SetPoint1( point1 );
+       vtklinesource3->SetPoint2( point2 );
+       vtklinesource3->Update();
+       
+       
+       vtkAppendPolyData *appendPolyData = vtkAppendPolyData::New();
+       appendPolyData->AddInputData( vtklinesource1->GetOutput() );
+       appendPolyData->AddInputData( vtklinesource2->GetOutput() );
+       appendPolyData->AddInputData( vtklinesource3->GetOutput() );
+       appendPolyData->Update();
+       _vtklineGlyphPolyData = appendPolyData->GetOutput();
  }
  
  //------------------------------------------------------------------------------
@@@ -62,79 -102,172 +102,199 @@@ vtkVectorsVisu::~vtkVectorsVisu(
  //------------------------------------------------------------------------------
  void vtkVectorsVisu::Process()
  {
+       if (_vtkglyph==NULL) 
+       {
+               if (GetOrientation()==-1) 
+               {
+                       _vtkglyph = vtkGlyph3D::New(); 
+               } // _orientation                       
+               if ((GetOrientation()>=0) && (GetOrientation()<=2))
+               {
+                       _vtkglyph = vtkGlyph3D::New(); 
+ //                            _vtkglyph = vtkGlyph2D::New(); 
+               } // _orientation                       
+       } // _vtkglyph NULL
       if(_active==true)
       {
- #if VTK_MAJOR_VERSION <= 5
-          _vtkglyph->SetInput( GetDataObject() );  
- #else
-          _vtkglyph->SetInputData( GetDataObject() );  
- #endif
-                       if(GetTypeForm()==1)                                                            // source Arrow
+               if (GetDataObject()!=NULL) 
+               {
+       #if VTK_MAJOR_VERSION <= 5
+                    _vtkglyph->SetInput( GetDataObject() );  
+       #else
+                    _vtkglyph->SetInputData( GetDataObject() );  
+       #endif
+                               if(GetTypeForm()==1)                                                            // source Arrow
+                               {
+       #if VTK_MAJOR_VERSION <= 5
+                               _vtkglyph->SetSource( _vtkarrowsource->GetOutput() );
+       #else
+                                       _vtkarrowsource->Update();
+                               _vtkglyph->SetSourceData( _vtkarrowsource->GetOutput() );
+       #endif
+                               } else {                                                                                                // source Line
+       #if VTK_MAJOR_VERSION <= 5
+                                       _vtkglyph->SetSource( _vtklineGlyphPolyData );          
+       #else
+                                       _vtkglyph->SetSourceData( _vtklineGlyphPolyData );      
+       #endif
+                               }
+                    _vtkglyph->SetScaleModeToScaleByVector();
+                       if (_externalLut==NULL)
                        {
- #if VTK_MAJOR_VERSION <= 5
-                       _vtkglyph->SetSource( _vtkarrowsource->GetOutput() );
- #else
-                               _vtkarrowsource->Update();
-                       _vtkglyph->SetSourceData( _vtkarrowsource->GetOutput() );
- #endif
-                       } else {                                                                                                // source Line
- #if VTK_MAJOR_VERSION <= 5
-                               _vtkglyph->SetSource( _vtklinesource->GetOutput() );    
- #else
-                               _vtklinesource->Update();
-                               _vtkglyph->SetSourceData( _vtklinesource->GetOutput() );        
- #endif
-                       }
-          _vtkglyph->SetScaleModeToScaleByVector();
-          _vtkglyph->SetColorModeToColorByVector();
-          _vtkglyph->SetScaleFactor( GetScaleFactor() );
-               _vtkglyph->Update();
+                       _vtkglyph->SetColorModeToColorByVector();   
+                       } else {
+                               _vtkglyph->SetColorModeToColorByScalar();   
+                       } // if _externalLut
  
- #if VTK_MAJOR_VERSION <= 5
-          _pdm->SetInput( _vtkglyph->GetOutput());
- #else
-          _pdm->SetInputData( _vtkglyph->GetOutput());
- #endif
+                    _vtkglyph->SetScaleFactor( GetScaleFactor() );
+                       _vtkglyph->Update();
  
- vtkPointData  *data   = _vtkglyph->GetOutput()->GetPointData();
- //printf("EED -------------------------------------------\n");
- //_vtkglyph->GetOutput()->Print(std::cout);
- //printf("EED -------------------------------------------\n");
- //data->Print(std::cout);
- int i,sizeDa = data->GetNumberOfArrays();
- for (i=0;i<sizeDa;i++)
- {
-       data->GetArray(i)->Print(std::cout);
- }
+       #if VTK_MAJOR_VERSION <= 5
+                    _pdm->SetInput( _vtkglyph->GetOutput());
+       #else
+                    _pdm->SetInputData( _vtkglyph->GetOutput());
+       #endif
+       vtkPointData    *data   = _vtkglyph->GetOutput()->GetPointData();
+       //printf("EED -------------------------------------------\n");
+       //_vtkglyph->GetOutput()->Print(std::cout);
+       //printf("EED -------------------------------------------\n");
+       //data->Print(std::cout);
+       //int i,sizeDa = data->GetNumberOfArrays();
+       //for (i=0;i<sizeDa;i++)
+       //{
+       //      data->GetArray(i)->Print(std::cout);
+       //}
+                       if (_externalLut==NULL)
+                       {
+                               _pdm->ScalarVisibilityOn();
+                               _pdm->SetColorModeToMapScalars();
+                       //      _pdm->SetColorModeToDefault();
+                               // _pdm->SetColorModeToDirectScalars();  // NOT compile
+                               _pdm->SetScalarModeToUsePointFieldData();
+                       //      _pdm->ImmediateModeRenderingOn();   // obsolete
+                               _LutEED->SetVectorModeToComponent();
+                               //_LutEED->SetVectorModeToRGBColors();
+                               //_LutEED->SetVectorModeToMagnitud();
+                       //         _pdm->SetScalarModeToUsePointFieldData();
+                    _pdm->SetLookupTable( _LutEED );
+                    _pdm->SelectColorArray( "GlyphVector" );
+                       } else {
+                               data->SetActiveScalars("angle");
+                               _pdm->ScalarVisibilityOn(); 
+                               double scalarRange[2];
+                               scalarRange[0]=0;
+                               scalarRange[1]=40;
+       printf("EED warnnning  .....  vtkVectorsVisu::Process   clean scalar Range ......\n");
+       printf("EED warnnning  .....  vtkVectorsVisu::Process   clean scalar Range ......\n");
+       printf("EED warnnning  .....  vtkVectorsVisu::Process   clean scalar Range ......\n");
+       printf("EED warnnning  .....  vtkVectorsVisu::Process   clean scalar Range ......\n");
+       printf("EED warnnning  .....  vtkVectorsVisu::Process   clean scalar Range ......\n");
+                               _pdm->SetScalarRange(scalarRange);
+                               _pdm->SetColorModeToMapScalars();
+       //                      _pdm->SetColorModeToDefault();
+       //                       _pdm->SetColorModeToDirectScalars();  // NOT compile
+       //                      _pdm->SetScalarModeToUsePointFieldData();
+ //                            _pdm->ImmediateModeRenderingOn();   // obsolete
+                            _pdm->SetLookupTable( _externalLut );
+                            _pdm->SelectColorArray( "angle" );
+                       }  // if _externalLut
+       printf("EED warnnning  .....  vtkVectorsVisu::Process   Clean angle ......\n");
+       printf("EED warnnning  .....  vtkVectorsVisu::Process   Clean angle ......\n");
+       printf("EED warnnning  .....  vtkVectorsVisu::Process   Clean angle ......\n");
+       printf("EED warnnning  .....  vtkVectorsVisu::Process   Clean angle ......\n");
+       printf("EED warnnning  .....  vtkVectorsVisu::Process   Clean angle ......\n");
+       /*
+       _vtkglyph->Update();
+       vtkPointData *pointdata=_vtkglyph->GetOutput()->GetPointData();
+       int i,size=pointdata->GetNumberOfArrays();
+       for (i=0;i<size;i++)
+       {
+               vtkDataArray *array=pointdata->GetArray(i);
+               printf(" vtkVectorsVisu::Process array name %d:<%s>  size:%d\n", i, array->GetName(), array->GetSize() );
+       }
+       */
+       //       vSliceMapperVec->SetLookupTable( vGreenToRedLut );
+       //       vSliceMapperVec->SetColorModeToMapScalars();
+       #if VTK_MAJOR_VERSION <= 5
+                       // ..
+       #else
+                    _pdm->Update();
+       #endif
+                       // Orientation -1 3D     OK
+        
+                       // Orientation 0 2D yz 
+                       if (GetOrientation()==0) 
+                       {
+                               _trans->Identity();
+                               _trans->Translate(900,0,0);
+                               _actor->SetUserTransform(_trans);
+                       }
+                       // Orientation 1 2D xz  
+                       if (GetOrientation()==1) 
+                       {
+                               _trans->Identity();
+                               _trans->Translate(0,-900,0);
+                               _actor->SetUserTransform(_trans);
+                       }
+                       // Orientation 2 2D xy  
+                       if (GetOrientation()==2) 
+                       {
+                               _trans->Identity();
+                               _trans->Translate(0,0,-900);
+                               _actor->SetUserTransform(_trans);
+                       }
+                   _actor->SetMapper( _pdm );
+                   _actor->GetProperty()->SetOpacity( GetOpacity() );
+               } else {
+                       printf("EED Warnning! vtkVectorsVisu::Process   GetDataObject()  is EMPTY\n");
+               }// if GetDataObject()!=NULL
  
-     }// if _active
 +      _pdm->ScalarVisibilityOn();
 +      _pdm->SetColorModeToMapScalars();
 +      //_pdm->SetColorModeToDefault();
 +      // _pdm->SetColorModeToDirectScalars();  // NOT compile
 +      _pdm->SetScalarModeToUsePointFieldData();
 +
 +//EED2021-09-03 Deprecated. Removed in vtk 8.1
 +//    _pdm->ImmediateModeRenderingOn();
 +
 +      _LutEED->SetVectorModeToComponent();
 +      //_LutEED->SetVectorModeToRGBColors();
 +      //_LutEED->SetVectorModeToMagnitud();
 +
 +//         _pdm->SetScalarModeToUsePointFieldData();
 +         _pdm->SetLookupTable( _LutEED );
 +         _pdm->SelectColorArray( "GlyphVector" );
 +
 +//       vSliceMapperVec->SetLookupTable( vGreenToRedLut );
 +//       vSliceMapperVec->SetColorModeToMapScalars();
 +
 +#if VTK_MAJOR_VERSION <= 5
 +              // ..
 +#else
 +         _pdm->Update();
 +#endif
 +         _actor->SetMapper( _pdm );
 +         _actor->GetProperty()->SetOpacity( GetOpacity() );
+     } else {
+               _vtkglyph->SetInputData( NULL );  
+               _vtkglyph->Update();
+       }// if _active
  
      VisibilityActor(); 
  }