]> Creatis software - bbtk.git/blobdiff - packages/vtk/src/bbvtkSurfaceTexture.cxx
#3273 BBTK Bug New Normal - Bug MaskPoint Box
[bbtk.git] / packages / vtk / src / bbvtkSurfaceTexture.cxx
index 76b0b6d953f49286a4ac0530ef2917d1352640bc..0016c6eeb502c29ce1a2985119e8a679e8087418 100644 (file)
@@ -34,14 +34,13 @@ void SurfaceTexture::Process()
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
   
 
-       int i;
-       double spc[3];
-       double range[2];
-       int ext[6];
+       int     i;
+       double  spc[3];
+       double  range[2];
+       int     ext[6];
        bbGetInputImage()->GetSpacing(spc);
        bbGetInputImage()->GetScalarRange(range);
 
-
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        bbGetInputImage()->GetWholeExtent(ext);
@@ -144,12 +143,13 @@ void SurfaceTexture::Process()
                  colorLookupTable->SetTableValue(10,1  ,0.5,0.5,1);
                  colorLookupTable->SetTableValue(11,0.5,0.5,1  ,1);
 
-               } // type 2
+               } // type 3
 
 
+               
 
+       }  // firsttime
 
-       }
 
        bbGetInputMesh()->GetPointData()->SetScalars(colors);
 
@@ -158,6 +158,14 @@ void SurfaceTexture::Process()
                colorLookupTableWL->SetLevel( bbGetInputColorLevel() );
                colorLookupTableWL->SetWindow( bbGetInputColorWindow() );
        }       
+
+
+       if (bbGetInputExternalLookupTable()!=NULL) 
+       {
+               generalLookupTable = bbGetInputExternalLookupTable();
+       } else {
+               generalLookupTable = colorLookupTable;
+       }
                
     int missingpoints = bbGetInputMesh()->GetNumberOfPoints() - colors->GetDataSize()/colors->GetNumberOfComponents();
        for(i = 0; i < missingpoints; i++)
@@ -193,7 +201,7 @@ void SurfaceTexture::Process()
                } else {
                        gl=0;
                }
-               colorLookupTable->GetColor(gl, dcolor);
+               generalLookupTable->GetColor(gl, dcolor);
                colors->SetTuple3(i,255*dcolor[0],255*dcolor[1],255*dcolor[2]);         
        } // for i
        bbGetInputMesh()->Modified();   
@@ -217,7 +225,7 @@ void SurfaceTexture::bbUserSetDefaultValues()
        firsttime                               = true;
        colors                                  = NULL;
        colorLookupTable                = NULL;
-       colorLookupTableWL      = NULL;
+       colorLookupTableWL              = NULL;
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)