<parameter name="scalar_bar_label_font" value="Arial,Bold,Italic,Underline,12"/>
<parameter name="scalar_bar_label_format" value="%-#6.3g" />
<parameter name="scalar_bar_logarithmic" value="false"/>
+ <!-- RKV : Begin -->
+ <!-- Do filter by scalars or don't -->
+ <parameter name="scalar_bar_filter_by_scalars" value="false"/>
+ <!-- Show distribution curve or don't -->
+ <parameter name="scalar_bar_show_distribution" value="false"/>
+ <!-- RKV : End -->
<parameter name="scalar_bar_mode" value="0" />
<parameter name="scalar_bar_num_colors" value="64"/>
<parameter name="scalar_bar_num_labels" value="5" />
<source>LBL_SHOW_PREVIEW</source>
<translation>Show preview</translation>
</message>
+ <message>
+ <source>SHOW_DISTRIBUTION</source>
+ <translation>Show distribution</translation>
+ </message>
+ <message>
+ <source>FILTER_BY_SCALARS</source>
+ <translation>Filter by scalars</translation>
+ </message>
<message>
<source>LBL_WIDTH</source>
<translation>Width:</translation>
CBLog = new QCheckBox (tr("LOGARITHMIC_SCALING"), aGB);
CBLog->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+// RKV : Begin
+ CBFilter = new QCheckBox (tr("FILTER_BY_SCALARS"), aGB);
+ CBFilter->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+// RKV : End
+
RBFrange = new QRadioButton (tr("FIELD_RANGE_BTN"), aGB);
RBIrange = new QRadioButton (tr("IMPOSED_RANGE_BTN"), aGB);
RangeGroup->addButton( RBFrange, 0 );
RangeGroupLayout->addWidget( myModeLbl, 0, 0 );
RangeGroupLayout->addWidget( myModeCombo, 0, 1, 1, 4);
- RangeGroupLayout->addWidget( CBLog, 1, 0, 1, 4);
+// RKV RangeGroupLayout->addWidget( CBLog, 1, 0, 1, 4);
+ RangeGroupLayout->addWidget( CBLog, 1, 0, 1, 2); // RKV
+ RangeGroupLayout->addWidget( CBFilter, 1, 2, 1, 2); // RKV
RangeGroupLayout->addWidget( RBFrange, 2, 0, 1, 2);
RangeGroupLayout->addWidget( RBIrange, 2, 2, 1, 2);
RangeGroupLayout->addWidget( MinLabel, 3, 0 );
myPreviewCheck = new QCheckBox(tr("LBL_SHOW_PREVIEW"), CheckGroup);
myPreviewCheck->setChecked(false);
+
+// RKV : Begin
+ myPreviewCheck->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ CBDistr = new QCheckBox (tr("SHOW_DISTRIBUTION"), CheckGroup);
+ CBDistr->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+// RKV : End
+
CheckGroupLayout->addWidget(myPreviewCheck , 0, 0 );
+ CheckGroupLayout->addWidget(CBDistr , 0, 2 ); // RKV
if ( thePreview ) {
myPreviewCheck->hide();
connect( myTextBtn, SIGNAL( clicked() ), this, SLOT( onTextPref() ) );
connect( myBarBtn, SIGNAL( clicked() ), this, SLOT( onBarPref() ) );
connect( myPreviewCheck, SIGNAL( toggled( bool )), this, SLOT( onPreviewCheck( bool ) ) );
+
+ connect( CBFilter, SIGNAL( toggled( bool ) ), this, SLOT( onFilterByScalars( bool ) )); // RKV
+ connect( CBDistr, SIGNAL( toggled( bool ) ), this, SLOT( onShowDistribution( bool ) )); // RKV
+
connect( ColorSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() ));
connect( LabelSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() ));
connect( WidthSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() ));
aResourceMgr->setValue("VISU", "scalar_range_type", 0);
aResourceMgr->setValue("VISU", "scalar_bar_logarithmic", isLogarithmic());
+ aResourceMgr->setValue("VISU", "scalar_bar_filter_by_scalars", isFilteredByScalars()); // RKV
+ aResourceMgr->setValue("VISU", "scalar_bar_show_distribution", isShowDistribution()); // RKV
////
setRange( myScalarMap->GetMin(), myScalarMap->GetMax(), myScalarMap->IsRangeFixed() );
setScalarBarData( myScalarMap->GetNbColors(), myScalarMap->GetLabels() );
+// RKV : Begin
+ setFilteredByScalars( myScalarMap->IsFilteredByScalars() );
+ setShowDistribution( myScalarMap->GetIsDistributionVisible() );
+// RKV : End
+
// "Title"
CORBA::String_var aTitle = myScalarMap->GetTitle();
theRange[0] = (vtkFloatingPointType)MinEdit->text().toDouble();
theRange[1] = (vtkFloatingPointType)MaxEdit->text().toDouble();
}
- myScalarMapPL->SetScalarRange(theRange, false);
+// RKV myScalarMapPL->SetScalarRange(theRange, false);
+ myScalarMapPL->SetScalarRange(theRange, isFilteredByScalars()); // RKV
myScalarMapPL->SetNbColors(sbCol);
myScalarMapPL->Update();
aScalarBarActor->SetLookupTable(myScalarMapPL->GetBarTable());
+// RKV : Begin
+ aScalarBarActor->SetDistribution(myScalarMapPL->GetDistribution());
+ aScalarBarActor->SetDistributionVisibility(isShowDistribution());
+// RKV : End
if (!myTextDlg->getTitleText().isEmpty()) {
VISU::PValForTime aValForTime;
if (RBFrange->isChecked()) {
myScalarMap->SetSourceRange();
} else {
- myScalarMap->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble());
+// RKV myScalarMap->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble());
+ myScalarMap->SetRangeAndFilter(MinEdit->text().toDouble(), MaxEdit->text().toDouble(), isFilteredByScalars()); // RKV
}
myScalarMap->SetNbColors(ColorSpin->value());
myScalarMap->SetLabels(LabelSpin->value());
+ myScalarMap->SetIsDistributionVisible(isShowDistribution()); // RKV
if (isToSave()) storeToResources();
changeScalarMode(myModeCombo->currentIndex());
}
}
+// RKV : Begin
+void VisuGUI_ScalarBarPane::onFilterByScalars( bool isOn )
+{
+ myScalarMap->SetRangeAndFilter(myScalarMap->GetMin(), myScalarMap->GetMax(), isOn);
+ updatePreview();
+}
+void VisuGUI_ScalarBarPane::onShowDistribution( bool isOn )
+{
+ myScalarMap->SetIsDistributionVisible(isOn);
+ updatePreview();
+}
+// RKV : End
void VisuGUI_ScalarBarPane::changeRange( int )
{
if ( RBFrange->isChecked() ) {
CBLog->setChecked( on );
}
+// RKV : Begin
+//----------------------------------------------------------------------------
+bool VisuGUI_ScalarBarPane::isFilteredByScalars() {
+ return CBFilter->isChecked();
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_ScalarBarPane::setFilteredByScalars( bool on ) {
+ CBFilter->setChecked( on );
+}
+
+//----------------------------------------------------------------------------
+bool VisuGUI_ScalarBarPane::isShowDistribution() {
+ return CBDistr->isChecked();
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_ScalarBarPane::setShowDistribution( bool on ) {
+ CBDistr->setChecked( on );
+}
+
+// RKV : End
//----------------------------------------------------------------------------
bool VisuGUI_ScalarBarPane::isToSave() {
return CBSave ? CBSave->isChecked() : false;
int getNbLabels();
bool isLogarithmic();
void setLogarithmic( bool on );
+ // RKV : Begin
+ bool isFilteredByScalars();
+ void setFilteredByScalars( bool on );
+ bool isShowDistribution();
+ void setShowDistribution( bool on );
+ // RKV : End
bool isToSave();
void storeToResources();
QCheckBox* CBSave;
QCheckBox* CBLog;
+ // RKV : Begin
+ QCheckBox* CBFilter;
+ QCheckBox* CBDistr;
+ // RKV : End
QLabel* myModeLbl;
QComboBox* myModeCombo;
QPushButton* myTextBtn;
void onBarPref();
void onPreviewCheck(bool thePreview);
void updatePreview();
+ void onFilterByScalars(bool); // RKV
+ void onShowDistribution(bool); // RKV
private:
void createScalarBar();
myIsTimeStampFixed(thePublishInStudyMode == EPublishUnderTimeStamp),
myColoredPL(NULL),
myIsFixedRange(false),
- myIsRestored(true)
+ myIsRestored(true)/* RKV : Begin*/,
+ myIsDistributionVisible(false)/* RKV : End*/
{}
//---------------------------------------------------------------
SetNbColors(anOrigin->GetNbColors());
SetUnitsVisible(anOrigin->IsUnitsVisible());
+ SetIsDistributionVisible(anOrigin->GetIsDistributionVisible()); // RKV
SetLabelsFormat(anOrigin->GetLabelsFormat());
SetBarOrientation(anOrigin->GetBarOrientation());
SetMinMaxController( anOrigin );
if(anOrigin->IsRangeFixed())
- SetRange(anOrigin->GetMin(), anOrigin->GetMax());
+// RKV SetRange(anOrigin->GetMin(), anOrigin->GetMax());
+ SetRangeAndFilter(anOrigin->GetMin(), anOrigin->GetMax(), anOrigin->IsFilteredByScalars()); // RKV
else
SetSourceRange();
VISU::TSetModified aModified(this);
vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
- ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_ColoredPL, vtkFloatingPointType*, bool>
+/* RKV ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_ColoredPL, vtkFloatingPointType*, bool>
(GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange, false));
-
+*/
+// RKV : Begin
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_ColoredPL, vtkFloatingPointType*, bool>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange, myColoredPL->IsFiltered()));
+// RKV : End
UseFixedRange(true);
}
if(aRangeType == 1){
float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0);
float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0);
- SetRange(aMin, aMax);
+// RKV SetRange(aMin, aMax);
+ bool isFiltered = aResourceMgr->booleanValue("VISU", "scalar_bar_filter_by_scalars", false); // RKV
+ SetRangeAndFilter(aMin, aMax, isFiltered);
}
UseFixedRange(aRangeType == 1);
bool isUnits = aResourceMgr->booleanValue( "VISU", "scalar_bar_display_units", true );
SetUnitsVisible(isUnits);
+ SetIsDistributionVisible( aResourceMgr->booleanValue("VISU", "scalar_bar_show_distribution", false) ); // RKV
+
QString aLabelsFormat = aResourceMgr->stringValue( "VISU", "scalar_bar_label_format", "%-#6.3g" );
SetLabelsFormat(aLabelsFormat.toLatin1().data());
SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt());
float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble();
float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
- SetRange(aMin, aMax);
+// RKV SetRange(aMin, aMax);
+ // RKV : Begin
+ bool isFiltered = VISU::Storable::FindValue(theMap,"myIsFilteredByScalars", "0").toInt();
+ SetRangeAndFilter(aMin, aMax, isFiltered);
+ SetIsDistributionVisible(VISU::Storable::FindValue(theMap,"myIsDistributionVisible", "0").toInt());
+ // RKV : End
UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange", "0").toInt());
Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
Storable::DataToStream( theStr, "myIsFixedRange", IsRangeFixed() );
+
+ Storable::DataToStream( theStr, "myIsFilteredByScalars", IsFilteredByScalars() ); // RKV
+ Storable::DataToStream( theStr, "myIsDistributionVisible", GetIsDistributionVisible() ); // RKV
Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
Storable::DataToStream( theStr, "myOrientation", myOrientation );
aStudyBuilder->CommitCommand();
return this;
}
+
+// RKV : Begin
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetIsDistributionVisible(CORBA::Boolean isVisible)
+{
+ if( myIsDistributionVisible != isVisible ){
+ VISU::TSetModified aModified(this);
+ myIsDistributionVisible = isVisible;
+ myParamsTime.Modified();
+ }
+}
+
+//----------------------------------------------------------------------------
+CORBA::Boolean
+VISU::ColoredPrs3d_i
+::GetIsDistributionVisible()
+{
+ return myIsDistributionVisible;
+}
+
+//----------------------------------------------------------------------------
+CORBA::Boolean
+VISU::ColoredPrs3d_i
+::IsFilteredByScalars()
+{
+ return myColoredPL->IsFiltered();
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetRangeAndFilter(CORBA::Double theMin, CORBA::Double theMax, CORBA::Boolean isFilter)
+{
+ VISU::TSetModified aModified(this);
+
+ vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_ColoredPL, vtkFloatingPointType*, bool>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange, isFilter));
+
+ UseFixedRange(true);
+}
+
+//----------------------------------------------------------------------------
+// RKV : End
CORBA::Boolean
IsUnitsVisible();
+// RKV : Begin
+ /*!
+ * Set the visibility of a distribution curve.
+ * \param theIs is used to switch on/off the visibility of a distribution curve.
+ */
+ virtual void SetIsDistributionVisible(CORBA::Boolean theIs);
+
+ //! Gets current visibility of a distribution curve
+ virtual CORBA::Boolean GetIsDistributionVisible();
+
+ //! Gets current filtering by scalars mode
+ virtual CORBA::Boolean IsFilteredByScalars();
+
+ /*!
+ * Sets scalar range - min and max boundaries of the scalar bar.
+ * \param theMin Min boundary of the scalar bar.
+ * \param theMax Max boundary of the scalar bar.
+ * \param theIsFilter if true then filter by scalars.
+ */
+ virtual
+ void
+ SetRangeAndFilter(CORBA::Double theMin, CORBA::Double theMax, CORBA::Boolean theIs);
+// RKV : End
+
//----------------------------------------------------------------------------
//! Gets memory size actually used by the presentation (Mb).
virtual
VISU_ColoredPL* myColoredPL;
bool myIsFixedRange;
+ bool myIsDistributionVisible; // RKV
+
};
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
aScalarBar->SetLookupTable(GetSpecificPL()->GetBarTable());
+ // RKV : Begin
+ aScalarBar->SetDistribution(GetSpecificPL()->GetDistribution());
+ aScalarBar->SetDistributionVisibility(GetIsDistributionVisible());
+ // RKV : End
aScalarBar->SetTitle(GetScalarBarTitle().c_str());
aScalarBar->SetOrientation(GetBarOrientation());
aScalarBar->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();