]> SALOME platform Git repositories - modules/visu.git/blob - src/PIPELINE/VISU_LookupTable.cxx
Salome HOME
IMP 0017328: min and max scalar map of results given at gauss points. A fix for the...
[modules/visu.git] / src / PIPELINE / VISU_LookupTable.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  VISU OBJECT : interactive object for VISU entities implementation
23 //  File   : VISU_LookupTable.cxx
24 //  Author : Vitaliy Smetannikov
25 //  Module : VISU
26 //
27 #include "VISU_LookupTable.hxx"
28
29 #include <vtkObjectFactory.h>
30 #include <vtkBitArray.h>
31 #include <math.h>
32
33 using namespace std;
34
35
36 //----------------------------------------------------------------------------
37 vtkStandardNewMacro(VISU_LookupTable);
38
39
40 //----------------------------------------------------------------------------
41 VISU_LookupTable
42 ::VISU_LookupTable(int sze, int ext):
43   vtkLookupTable(sze, ext), 
44   myScale(1.0), 
45   myBicolor(false) 
46 {}
47
48 //----------------------------------------------------------------------------
49 namespace
50 {
51   inline
52   void
53   CopyColor( unsigned char* theTaget, const unsigned char* theSource )
54   {
55     theTaget[0] = theSource[0];
56     theTaget[1] = theSource[1];
57     theTaget[2] = theSource[2];
58   }
59 }
60
61
62 //----------------------------------------------------------------------------
63 void
64 VISU_LookupTable
65 ::MarkValueByColor( vtkFloatingPointType theValue,
66                     unsigned char* theColor )
67
68   vtkIdType anIndex = this->GetIndex( theValue );
69   unsigned char *aTablePtr = this->GetPointer( anIndex );
70   CopyColor( aTablePtr, theColor );
71 }
72
73
74 //----------------------------------------------------------------------------
75 void
76 VISU_LookupTable
77 ::FillByColor( unsigned char* theColor )
78 {
79   vtkIdType aNbColors = this->GetNumberOfColors();
80   for(int i = 0; i < aNbColors; i++){
81     unsigned char *aTablePtr = this->GetPointer(i);
82     CopyColor( aTablePtr, theColor );
83   }
84 }
85
86
87 //----------------------------------------------------------------------------
88 void
89 VISU_LookupTable
90 ::MakeBiColor()
91 {
92   unsigned char aRedPtr[3] = {255, 0, 0};
93   unsigned char aBluePtr[3] = {0, 0, 255};
94   
95   vtkFloatingPointType aRange[2];
96   this->GetTableRange(aRange);
97   vtkIdType aNbColors = this->GetNumberOfColors();
98   
99   vtkFloatingPointType aDelta = (aRange[1]-aRange[0])/aNbColors;
100   vtkFloatingPointType aValue = aRange[0]+0.5*aDelta;
101   for(int i = 0; i < aNbColors; i++){
102     vtkIdType anIndex = this->GetIndex(aValue);
103     unsigned char* aTablePtr = this->GetPointer(anIndex);
104     if(aValue > 0.0){
105       CopyColor(aTablePtr,aRedPtr);
106     }else{
107       CopyColor(aTablePtr,aBluePtr);
108     }
109     aValue += aDelta;
110   }
111 }
112
113
114 //----------------------------------------------------------------------------
115 void 
116 VISU_LookupTable
117 ::SetMapScale(vtkFloatingPointType theScale)
118 {
119   if( myScale != theScale )
120   {
121     myScale = theScale;
122     Modified();
123   }
124 }
125
126 void VISU_LookupTable::SetBicolor( bool theBicolor )
127 {
128   if( myBicolor != theBicolor )
129   {
130     myBicolor = theBicolor;
131     Modified();
132   }
133 }
134
135
136 int 
137 VISU_LookupTable
138 ::ComputeLogRange(vtkFloatingPointType inRange[2], 
139                   vtkFloatingPointType outRange[2])
140 {
141   if(inRange[0] >= inRange[1])
142     return -1;
143   if(0.0 <= inRange[0] && 0.0 < inRange[1]){
144     if(inRange[0] != 0.0)
145       outRange[0] = log10((double)inRange[0]);
146     else
147       outRange[0] = log10((double)inRange[1]*1.0E-6);
148     outRange[1] = log10((double)inRange[1]);
149     return 0;
150   }else if(inRange[0] < 0.0 && inRange[1] <= 0.0){
151     outRange[0] = log10((double)-inRange[0]);
152     outRange[1] = log10((double)-inRange[1]);
153     return 1;
154   }else
155     return -1;
156 }
157
158 unsigned char* 
159 VISU_LookupTable
160 ::MapValue(vtkFloatingPointType v) 
161 {
162   if(GetScale() == VTK_SCALE_LOG10) {
163     vtkFloatingPointType aLowBound = log10(this->TableRange[0]);
164     v = pow(vtkFloatingPointType(10.0), aLowBound + (v - aLowBound)*myScale);
165     return vtkLookupTable::MapValue(v);
166   } else if (!myBicolor) {
167     v = this->TableRange[0] + (v - this->TableRange[0])*myScale;
168     return vtkLookupTable::MapValue(v);
169   } else {
170     unsigned char* table = this->Table->GetPointer(0);
171     int index = v > 0 ? 4*static_cast<int>(this->GetNumberOfColors()-1) : 0;
172     return &table[index];
173   }
174 }
175
176 // Apply log to value, with appropriate constraints.
177 inline 
178 vtkFloatingPointType 
179 VISU_ApplyLogScale(vtkFloatingPointType v, 
180                    vtkFloatingPointType range[2], 
181                    vtkFloatingPointType logRange[2])
182 {
183   // is the range set for negative numbers?
184   if (range[0] < 0)
185     {
186     if (v < 0)
187       {
188       v = log10(-static_cast<double>(v));
189       }
190     else if (range[0] > range[1])
191       {
192       v = logRange[0];
193       }
194     else
195       {
196       v = logRange[1];
197       }
198     }
199   else
200     {
201     if (v > 0)
202       {
203       v = log10(static_cast<double>(v));
204       }
205     else if (range[0] < range[1])
206       {
207       v = logRange[0];
208       }
209     else
210       {
211       v = logRange[1];
212       }
213     }
214   return v;
215 }                 
216
217 // Apply shift/scale to the scalar value v and do table lookup.
218 inline 
219 unsigned char *
220 VISU_LinearLookup(vtkFloatingPointType v,   
221                   unsigned char *table,
222                   vtkFloatingPointType maxIndex,
223                   vtkFloatingPointType shift, 
224                   vtkFloatingPointType scale,
225                   bool bicolor)
226 {
227   if( !bicolor )
228   {
229     vtkFloatingPointType findx = (v + shift)*scale;
230     if (findx < 0)
231       findx = 0;
232     if (findx > maxIndex)
233       findx = maxIndex;
234
235     return &table[4*static_cast<int>(findx)];
236     // round
237     //return &table[4*(int)(findx + 0.5f)];
238   }
239   else
240   {
241     int index = v > 0 ? 4*static_cast<int>(maxIndex) : 0;
242     return &table[index];
243   }
244 }
245
246 // accelerate the mapping by copying the data in 32-bit chunks instead
247 // of 8-bit chunks
248 template<class T>
249 void
250 VISU_LookupTableMapData(vtkLookupTable *self, 
251                         T *input, 
252                         unsigned char *output, 
253                         int length, 
254                         int inIncr, 
255                         int outFormat,
256                         vtkFloatingPointType theMapScale, 
257                         bool bicolor)
258 {
259   int i = length;
260   vtkFloatingPointType *range = self->GetTableRange();
261   vtkFloatingPointType maxIndex = self->GetNumberOfColors() - 1;
262   vtkFloatingPointType shift, scale;
263   unsigned char *table = self->GetPointer(0);
264   unsigned char *cptr;
265   vtkFloatingPointType alpha;
266
267   if ( (alpha=self->GetAlpha()) >= 1.0 ) //no blending required 
268     {
269     if (self->GetScale() == VTK_SCALE_LOG10)
270       {
271       vtkFloatingPointType val;
272       vtkFloatingPointType logRange[2];
273       VISU_LookupTable::ComputeLogRange(range, logRange);
274       shift = -logRange[0];
275       if (logRange[1] <= logRange[0])
276         {
277         scale = VTK_LARGE_FLOAT;
278         }
279       else
280         {
281         scale = (maxIndex + 1)/(logRange[1] - logRange[0]);
282         }
283       /* correct scale
284       scale = maxIndex/(logRange[1] - logRange[0]);
285       */
286       if (outFormat == VTK_RGBA)
287         {
288         while (--i >= 0) 
289           {
290           val = VISU_ApplyLogScale(*input, range, logRange);
291           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor); 
292           *output++ = *cptr++;
293           *output++ = *cptr++;
294           *output++ = *cptr++;
295           *output++ = *cptr++;     
296           input += inIncr;
297           }
298         }
299       else if (outFormat == VTK_RGB)
300         {
301         while (--i >= 0) 
302           {
303           val = VISU_ApplyLogScale(*input, range, logRange);
304           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor); 
305           *output++ = *cptr++;
306           *output++ = *cptr++;
307           *output++ = *cptr++;
308           input += inIncr;
309           }
310         }
311       else if (outFormat == VTK_LUMINANCE_ALPHA)
312         {
313         while (--i >= 0) 
314           {
315           val = VISU_ApplyLogScale(*input, range, logRange);
316           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor); 
317           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 + 
318                                                  cptr[2]*0.11 + 0.5);
319           *output++ = cptr[3];
320           input += inIncr;
321           }
322         }
323       else // outFormat == VTK_LUMINANCE
324         {
325         while (--i >= 0) 
326           {
327           val = VISU_ApplyLogScale(*input, range, logRange);
328           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor); 
329           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 + 
330                                                  cptr[2]*0.11 + 0.5);
331           input += inIncr;
332           }
333         }
334       }//if log scale
335
336     else //not log scale
337       {
338       shift = -range[0];
339       if (range[1] <= range[0])
340         {
341         scale = VTK_LARGE_FLOAT;
342         }
343       else
344         {
345         scale = (maxIndex + 1)/(range[1] - range[0]);
346         }
347       /* correct scale
348       scale = maxIndex/(range[1] - range[0]);
349       */
350
351       if (outFormat == VTK_RGBA)
352         {
353         while (--i >= 0) 
354           {
355           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor); 
356           *output++ = *cptr++;
357           *output++ = *cptr++;
358           *output++ = *cptr++;
359           *output++ = *cptr++;     
360           input += inIncr;
361           }
362         }
363       else if (outFormat == VTK_RGB)
364         {
365         while (--i >= 0) 
366           {
367           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor); 
368           *output++ = *cptr++;
369           *output++ = *cptr++;
370           *output++ = *cptr++;
371           input += inIncr;
372           }
373         }
374       else if (outFormat == VTK_LUMINANCE_ALPHA)
375         {
376         while (--i >= 0) 
377           {
378           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor); 
379           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 + 
380                                                  cptr[2]*0.11 + 0.5);
381           *output++ = cptr[3];
382           input += inIncr;
383           }
384         }
385       else // outFormat == VTK_LUMINANCE
386         {
387         while (--i >= 0) 
388           {
389           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor); 
390           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 + 
391                                                  cptr[2]*0.11 + 0.5);
392           input += inIncr;
393           }
394         }
395       }//if not log lookup
396     }//if blending not needed
397
398   else //blend with the specified alpha
399     {
400     if (self->GetScale() == VTK_SCALE_LOG10)
401       {
402       vtkFloatingPointType val;
403       vtkFloatingPointType logRange[2];
404       VISU_LookupTable::ComputeLogRange(range, logRange);
405       shift = -logRange[0];
406       if (logRange[1] <= logRange[0])
407         {
408         scale = VTK_LARGE_FLOAT;
409         }
410       else
411         {
412         scale = (maxIndex + 1)/(logRange[1] - logRange[0]);
413         }
414       /* correct scale
415       scale = maxIndex/(logRange[1] - logRange[0]);
416       */
417       if (outFormat == VTK_RGBA)
418         {
419         while (--i >= 0) 
420           {
421           val = VISU_ApplyLogScale(*input, range, logRange);
422           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor); 
423           *output++ = *cptr++;
424           *output++ = *cptr++;
425           *output++ = *cptr++;
426           *output++ = static_cast<unsigned char>((*cptr)*alpha); cptr++;
427           input += inIncr;
428           }
429         }
430       else if (outFormat == VTK_RGB)
431         {
432         while (--i >= 0) 
433           {
434           val = VISU_ApplyLogScale(*input, range, logRange);
435           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor); 
436           *output++ = *cptr++;
437           *output++ = *cptr++;
438           *output++ = *cptr++;
439           input += inIncr;
440           }
441         }
442       else if (outFormat == VTK_LUMINANCE_ALPHA)
443         {
444         while (--i >= 0) 
445           {
446           val = VISU_ApplyLogScale(*input, range, logRange);
447           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor); 
448           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 + 
449                                                  cptr[2]*0.11 + 0.5);
450           *output++ = static_cast<unsigned char>(alpha*cptr[3]);
451           input += inIncr;
452           }
453         }
454       else // outFormat == VTK_LUMINANCE
455         {
456         while (--i >= 0) 
457           {
458           val = VISU_ApplyLogScale(*input, range, logRange);
459           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor); 
460           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 + 
461                                                  cptr[2]*0.11 + 0.5);
462           input += inIncr;
463           }
464         }
465       }//log scale with blending
466
467     else //no log scale with blending
468       {
469       shift = -range[0];
470       if (range[1] <= range[0])
471         {
472         scale = VTK_LARGE_FLOAT;
473         }
474       else
475         {
476         scale = (maxIndex + 1)/(range[1] - range[0]);
477         }
478       /* correct scale
479       scale = maxIndex/(range[1] - range[0]);
480       */
481
482       if (outFormat == VTK_RGBA)
483         {
484         while (--i >= 0) 
485           {
486           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor); 
487           *output++ = *cptr++;
488           *output++ = *cptr++;
489           *output++ = *cptr++;
490           *output++ = static_cast<unsigned char>((*cptr)*alpha); cptr++;
491           input += inIncr;
492           }
493         }
494       else if (outFormat == VTK_RGB)
495         {
496         while (--i >= 0) 
497           {
498           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor); 
499           *output++ = *cptr++;
500           *output++ = *cptr++;
501           *output++ = *cptr++;
502           input += inIncr;
503           }
504         }
505       else if (outFormat == VTK_LUMINANCE_ALPHA)
506         {
507         while (--i >= 0) 
508           {
509           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor); 
510           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 + 
511                                                  cptr[2]*0.11 + 0.5);
512           *output++ = static_cast<unsigned char>(cptr[3]*alpha);
513           input += inIncr;
514           }
515         }
516       else // outFormat == VTK_LUMINANCE
517         {
518         while (--i >= 0) 
519           {
520           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor); 
521           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 + 
522                                                  cptr[2]*0.11 + 0.5);
523           input += inIncr;
524           }
525         }
526       }//no log scale
527     }//alpha blending
528 }
529
530 // Although this is a relatively expensive calculation,
531 // it is only done on the first render. Colors are cached
532 // for subsequent renders.
533 template<class T>
534 void
535 VISU_LookupTableMapMag(vtkLookupTable *self, 
536                        T *input, 
537                        unsigned char *output, 
538                        int length, 
539                        int inIncr, 
540                        int outFormat,
541                        vtkFloatingPointType theMapScale, 
542                        bool bicolor)
543 {
544   double tmp, sum;
545   double *mag;
546   int i, j;
547
548   mag = new double[length];
549   for (i = 0; i < length; ++i)
550     {
551     sum = 0;
552     for (j = 0; j < inIncr; ++j)
553       {
554       tmp = (double)(*input);  
555       sum += (tmp * tmp);
556       ++input;
557       }
558     mag[i] = sqrt(sum);
559     }
560
561   VISU_LookupTableMapData(self, mag, output, length, 1, outFormat, theMapScale, bicolor);
562
563   delete [] mag;
564 }
565
566
567 void VISU_LookupTable::MapScalarsThroughTable2(void *input, 
568                                                unsigned char *output,
569                                                int inputDataType, 
570                                                int numberOfValues,
571                                                int inputIncrement,
572                                                int outputFormat)
573 {
574   if (this->UseMagnitude && inputIncrement > 1)
575     {
576     switch (inputDataType)
577       {
578       case VTK_BIT:
579         vtkErrorMacro("Cannot comput magnitude of bit array.");
580         break;
581       case VTK_CHAR:
582         VISU_LookupTableMapMag(this,static_cast<char *>(input),output,
583                                numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
584         return; 
585       case VTK_UNSIGNED_CHAR:
586         VISU_LookupTableMapMag(this,static_cast<unsigned char *>(input),output,
587                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
588         return;
589       case VTK_SHORT:
590         VISU_LookupTableMapMag(this,static_cast<short *>(input),output,
591                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
592         return;
593       case VTK_UNSIGNED_SHORT:
594         VISU_LookupTableMapMag(this,static_cast<unsigned short *>(input),output,
595                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
596         return;
597       case VTK_INT:
598         VISU_LookupTableMapMag(this,static_cast<int *>(input),output,
599                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
600         return;
601       case VTK_UNSIGNED_INT:
602         VISU_LookupTableMapMag(this,static_cast<unsigned int *>(input),output,
603                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
604         return;
605       case VTK_LONG:
606         VISU_LookupTableMapMag(this,static_cast<long *>(input),output,
607                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
608         return;
609       case VTK_UNSIGNED_LONG:
610         VISU_LookupTableMapMag(this,static_cast<unsigned long *>(input),output,
611                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
612         return;
613       case VTK_FLOAT:
614         VISU_LookupTableMapMag(this,static_cast<float *>(input),output,
615                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
616         return;
617       case VTK_DOUBLE:
618         VISU_LookupTableMapMag(this,static_cast<double *>(input),output,
619                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
620         return;
621       default:
622         vtkErrorMacro(<< "MapImageThroughTable: Unknown input ScalarType");
623         return;
624       }
625     }
626
627   switch (inputDataType)
628     {
629     case VTK_BIT:
630       {
631       vtkIdType i, id;
632       vtkBitArray *bitArray = vtkBitArray::New();
633       bitArray->SetVoidArray(input,numberOfValues,1);
634       vtkUnsignedCharArray *newInput = vtkUnsignedCharArray::New();
635       newInput->SetNumberOfValues(numberOfValues);
636       for (id=i=0; i<numberOfValues; i++, id+=inputIncrement)
637         {
638         newInput->SetValue(i, bitArray->GetValue(id));
639         }
640       VISU_LookupTableMapData(this,
641                               static_cast<unsigned char*>(newInput->GetPointer(0)),
642                               output,numberOfValues,
643                               inputIncrement,outputFormat,myScale,myBicolor);
644       newInput->Delete();
645       bitArray->Delete();
646       }
647       break;
648       
649     case VTK_CHAR:
650       VISU_LookupTableMapData(this,static_cast<char *>(input),output,
651                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
652       break;
653       
654     case VTK_UNSIGNED_CHAR:
655       VISU_LookupTableMapData(this,static_cast<unsigned char *>(input),output,
656                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
657       break;
658       
659     case VTK_SHORT:
660       VISU_LookupTableMapData(this,static_cast<short *>(input),output,
661                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
662       break;
663       
664     case VTK_UNSIGNED_SHORT:
665       VISU_LookupTableMapData(this,static_cast<unsigned short *>(input),output,
666                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
667       break;
668       
669     case VTK_INT:
670       VISU_LookupTableMapData(this,static_cast<int *>(input),output,
671                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
672       break;
673       
674     case VTK_UNSIGNED_INT:
675       VISU_LookupTableMapData(this,static_cast<unsigned int *>(input),output,
676                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
677       break;
678       
679     case VTK_LONG:
680       VISU_LookupTableMapData(this,static_cast<long *>(input),output,
681                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
682       break;
683       
684     case VTK_UNSIGNED_LONG:
685       VISU_LookupTableMapData(this,static_cast<unsigned long *>(input),output,
686                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
687       break;
688       
689     case VTK_FLOAT:
690       VISU_LookupTableMapData(this,static_cast<float *>(input),output,
691                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
692       break;
693       
694     case VTK_DOUBLE:
695       VISU_LookupTableMapData(this,static_cast<double *>(input),output,
696                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
697       break;
698       
699     default:
700       vtkErrorMacro(<< "MapImageThroughTable: Unknown input ScalarType");
701       return;
702     }
703 }  
704