::SetVisibility(int theMode)
{
Superclass::SetVisibility(theMode);
- myScalarBarCtrl->SetBarVisibility(theMode && myBarVisibility);
+ myScalarBarCtrl->SetVisibility(theMode);
}
//----------------------------------------------------------------------------
::SetBarVisibility(bool theMode)
{
myBarVisibility = theMode;
- myScalarBarCtrl->SetBarVisibility(theMode);
+ myScalarBarCtrl->SetCtrlVisibility((int)theMode);
}
bool
//==================================================================
VISU_ScalarBarCtrl::VISU_ScalarBarCtrl()
{
- myBarVisibility=true;
myDistance=0.02;
myL=0.8;
myB=0.15;
myBlack[i]=0;
myGrey[i]=192;
}
+ //
+ myCtrlVisibility=1;
+ SetVisibility(1);
}
//==================================================================
// function : ~
return myMode;
}
//==================================================================
-// function : SetBarVisibility
+// function : SetVisibility
+// purpose :
+//==================================================================
+void VISU_ScalarBarCtrl::SetVisibility(const int theFlag)
+{
+ int iVisibility=(myCtrlVisibility && theFlag);
+ for (int i=0; i<2; ++i){
+ mySBA[i]->SetVisibility(iVisibility);
+ }
+}
+//==================================================================
+// function : GetVisibility
// purpose :
//==================================================================
-void VISU_ScalarBarCtrl::SetBarVisibility(const bool theFlag)
+int VISU_ScalarBarCtrl::GetVisibility()const
{
- myBarVisibility=theFlag;
+ return mySBA[0]->GetVisibility();
}
//==================================================================
-// function : GetBarVisibility
+// function : SetCtrlVisibility
// purpose :
//==================================================================
-bool VISU_ScalarBarCtrl::GetBarVisibility()const
+void VISU_ScalarBarCtrl::SetCtrlVisibility(const int theFlag)
{
- return myBarVisibility;
+ myCtrlVisibility=theFlag;
+ SetVisibility(1);
+}
+//==================================================================
+// function : GetCtrlVisibility
+// purpose :
+//==================================================================
+int VISU_ScalarBarCtrl::GetCtrlVisibility()const
+{
+ return myCtrlVisibility;
}
//==================================================================
// function : SetRangeLocal
//==================================================================
void VISU_ScalarBarCtrl::Update()
{
- if (!myBarVisibility) {
- for (int i=0; i<myScalarBarNumberMax; ++i){
- mySBA[i]->SetVisibility(myBarVisibility);
- }
+ if (!myCtrlVisibility) {
+ SetVisibility(0);
return;
}
//
//
mySBA[i]->SetMaximumNumberOfColors(myMaximumNumberOfColors);
mySBA[i]->SetLookupTable(myXLT[i]);
- mySBA[i]->SetVisibility(myBarVisibility);
mySBA[i]->Modified();
}
}
void RemoveFromRender(vtkRenderer* theRenderer);
//
// Visibility
- void SetBarVisibility(const bool theFlag);
- bool GetBarVisibility()const;
+ void SetVisibility(const int theFlag);
+ int GetVisibility()const;
+ //
+ // Visibility
+ void SetCtrlVisibility(const int theFlag);
+ int GetCtrlVisibility()const;
//
// Build
void Update();
float myRangeLocal[2];
float myRangeGlobal[2];
bool myBicolor;
- bool myBarVisibility;
+ int myCtrlVisibility;
int myMaximumNumberOfColors;
unsigned char myBlack[4];
unsigned char myGrey[4];