::VISU_LookupTable(int sze, int ext):
vtkLookupTable(sze, ext),
myScale(1.0),
- myBicolor(false)
+ myBicolor(false),
+ myHasMarkedValues(false)
{}
//----------------------------------------------------------------------------
vtkIdType anIndex = this->GetIndex( theValue );
unsigned char *aTablePtr = this->GetPointer( anIndex );
CopyColor( aTablePtr, theColor );
+ myHasMarkedValues = true;
}
}
}
+void
+VISU_LookupTable
+::ForceBuild()
+{
+ Superclass::ForceBuild();
+ myHasMarkedValues = false;
+}
+
// Apply log to value, with appropriate constraints.
inline
vtkFloatingPointType
vtkTypeMacro(VISU_LookupTable,vtkLookupTable);
static VISU_LookupTable *New();
+ virtual void ForceBuild();
+
virtual void MapScalarsThroughTable2(void *input, unsigned char *output,
int inputDataType, int numberOfValues,
int inputIncrement, int outputIncrement);
void MarkValueByColor( vtkFloatingPointType theValue,
unsigned char* theColor );
+ bool HasMarkedValues() const { return myHasMarkedValues; }
+
void FillByColor( unsigned char* theColor );
void MakeBiColor();
vtkFloatingPointType myScale;
bool myBicolor;
+ bool myHasMarkedValues;
};
#endif // VISU_LookupTable_H
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
VISU_LookupTable * aLookupTable = GetSpecificPL()->GetBarTable();
- if ( IsScalarFilterUsed() ) {
+ bool anIsScalarFilterUsed = IsScalarFilterUsed();
+ if ( anIsScalarFilterUsed || aLookupTable->HasMarkedValues() )
aLookupTable->ForceBuild();
+
+ if ( anIsScalarFilterUsed ) {
static unsigned char MARK_COLOR[] = { 255, 255, 255 };
aLookupTable->MarkValueByColor( GetScalarFilterMin(), MARK_COLOR );
aLookupTable->MarkValueByColor( GetScalarFilterMax(), MARK_COLOR );