*/
Orientation GetBarOrientation();
- // RKV : Begin
/*!
* Set the visibility of a distribution curve.
* \param theIs is used to switch on/off the visibility of a distribution curve.
boolean GetIsDistributionVisible();
//! Gets current filtering by scalars mode
- boolean IsFilteredByScalars();
+ boolean IsScalarFilterUsed();
+
+ void UseScalarFiltering( in boolean theUseScalarFilter );
/*!
* Sets scalar range - min and max boundaries of the scalar bar.
* \param theMax Max boundary of the scalar bar.
* \param theIsFilter if true then filter by scalars.
*/
- void SetRangeAndFilter(in double theMin, in double theMax, in boolean theIsFilter);
+ void SetScalarFilterRange( in double theMin, in double theMax );
+
+ double GetScalarFilterMin();
- // RKV : End
+ double GetScalarFilterMax();
/*!
* Add group as geometry of presentation.
cout << "before filter limits set" << endl;
vtkObject::GlobalWarningDisplayOn();
aPresent->DebugOn();
- aPresent->SetScalarRange(aRange, true);
+ aPresent->SetScalarFilteredRange( aRange );
+ aPresent->UseScalarFiltering( true );
cout << "after filter set" << endl;
//aPresent->ClearGeometry();
#include "VISU_PipeLineUtils.hxx"
+#include <vtkThreshold.h>
+#include <vtkPassThroughFilter.h>
+#include <vtkDoubleArray.h>
+
//----------------------------------------------------------------------------
VISU_ColoredPL
::VISU_ColoredPL():
- myMapperTable(VISU_LookupTable::New()),
- myBarTable(VISU_LookupTable::New()),
- myExtractor(VISU_Extractor::New()),
- myFieldTransform(VISU_FieldTransform::New()),
- myThreshold(vtkThreshold::New()), // RKV
- myPassFilter(vtkPassThroughFilter::New()), // RKV
- myDistribution(vtkDoubleArray::New()), // RKV
- myIsFiltered(false) // RKV
+ myMapperTable( VISU_LookupTable::New() ),
+ myBarTable( VISU_LookupTable::New() ),
+ myExtractor( VISU_Extractor::New() ),
+ myFieldTransform( VISU_FieldTransform::New() ),
+ myThreshold ( vtkThreshold::New() ),
+ myPassFilter( vtkPassThroughFilter::New() ),
+ myDistribution( vtkDoubleArray::New() )
{
myMapperTable->Delete();
myMapperTable->SetScale(VTK_SCALE_LINEAR);
myFieldTransform->Delete();
- myThreshold->AllScalarsOn(); // RKV
- myThreshold->Delete(); // RKV
- myPassFilter->Delete(); // RKV
- myDistribution->Delete(); // RKV
+ myThreshold->AllScalarsOn();
+ myThreshold->Delete();
+ myPassFilter->Delete();
+ myDistribution->Delete();
}
aTime = std::max(aTime, myBarTable->GetMTime());
aTime = std::max(aTime, myExtractor->GetMTime());
aTime = std::max(aTime, myFieldTransform->GetMTime());
- // RKV : Begin
- if (IsFiltered()) {
- aTime = std::max(aTime, myThreshold->GetMTime());
- }
+ aTime = std::max(aTime, myThreshold->GetMTime());
aTime = std::max(aTime, myPassFilter->GetMTime());
aTime = std::max(aTime, myDistribution->GetMTime());
- // RKV : End
return aTime;
}
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if(VISU_ColoredPL *aPipeLine = dynamic_cast<VISU_ColoredPL*>(thePipeLine)){
- if(theIsCopyInput)
- SetScalarRange(aPipeLine->GetScalarRange(), aPipeLine->IsFiltered()); // RKV
-// RKV SetScalarRange(aPipeLine->GetScalarRange());
+ if ( theIsCopyInput ) {
+ SetScalarRange( aPipeLine->GetScalarRange() );
+ if ( this->IsScalarFilterUsed() )
+ SetScalarFilteredRange( aPipeLine->GetScalarFilteredRange() );
+ }
+
SetScalarMode(aPipeLine->GetScalarMode());
SetNbColors(aPipeLine->GetNbColors());
SetScaling(aPipeLine->GetScaling());
SetMapScale(aPipeLine->GetMapScale());
- if(this != thePipeLine){
- if(aPipeLine->IsExternalGeometryUsed()){
+
+ if ( this != thePipeLine ) {
+ if ( aPipeLine->IsExternalGeometryUsed() ) {
ClearGeometry();
int aNbOfGeometry = aPipeLine->GetNumberOfGeometry();
for(int aGeomNumber = 0; aGeomNumber < aNbOfGeometry; aGeomNumber++)
- AddGeometry(aPipeLine->GetGeometry(aGeomNumber));
+ AddGeometry( aPipeLine->GetGeometry( aGeomNumber ) );
}else
SetSourceGeometry();
}
SetScalarMode(theScalarMode, GetInput(), myExtractor);
}
+
//----------------------------------------------------------------------------
-/* RKV
void
VISU_ColoredPL
-::SetScalarRange(vtkFloatingPointType theRange[2])
+::SetScalarRange( vtkFloatingPointType theRange[2] )
{
- if(theRange[0] > theRange[1])
+ if ( theRange[0] > theRange[1] )
return;
- if(VISU::CheckIsSameRange(GetScalarRange(), theRange))
+ if (VISU::CheckIsSameRange( GetScalarRange(), theRange) )
return;
- myFieldTransform->SetScalarRange(theRange);
- myBarTable->SetRange(theRange);
+ myFieldTransform->SetScalarRange( theRange );
+ myBarTable->SetRange( theRange );
}
-*/
-// RKV : Begin
+
+
+//----------------------------------------------------------------------------
void
VISU_ColoredPL
-::SetScalarRange(vtkFloatingPointType theRange[2], const bool isFiltered)
+::SetScalarFilteredRange( vtkFloatingPointType theRange[2] )
{
- // isFiltered - if true then drop cells which are not in the scalar range
- if(theRange[0] > theRange[1])
- return;
-
- if(VISU::CheckIsSameRange(GetScalarRange(), theRange) && (myIsFiltered == isFiltered))
+ vtkFloatingPointType aRange[ 2 ];
+ this->GetScalarFilteredRange( aRange );
+
+ if ( VISU::CheckIsSameRange( aRange, theRange) )
return;
- myFieldTransform->SetScalarRange(theRange);
- myBarTable->SetRange(theRange);
- myIsFiltered = isFiltered;
- if (IsFiltered()) {
+ myThreshold->ThresholdBetween( theRange[0], theRange[1] );
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_ColoredPL
+::GetScalarFilteredRange( vtkFloatingPointType theRange[2] )
+{
+ theRange[ 0 ] = myThreshold->GetLowerThreshold();
+ theRange[ 1 ] = myThreshold->GetUpperThreshold();
+}
+
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType*
+VISU_ColoredPL
+::GetScalarFilteredRange()
+{
+ static vtkFloatingPointType aRange[ 2 ];
+
+ this->GetScalarFilteredRange( aRange );
+
+ return aRange;
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_ColoredPL
+::UseScalarFiltering( bool theUseScalarFilter )
+{
+ if ( theUseScalarFilter ) {
// Include threshold filter between the transform and the pass filters.
- myThreshold->SetInput(myFieldTransform->GetOutput());
- myThreshold->ThresholdBetween(theRange[0], theRange[1]);
- myPassFilter->SetInput(myThreshold->GetOutput());
+ myPassFilter->SetInput( myThreshold->GetOutput() );
} else {
// Exclude threshold filter before the pass filter.
- myPassFilter->SetInput(myFieldTransform->GetOutput());
+ myPassFilter->SetInput( myFieldTransform->GetOutput() );
}
}
+
+//----------------------------------------------------------------------------
+bool
+VISU_ColoredPL
+::IsScalarFilterUsed()
+{
+ return myThreshold->GetOutput() == myPassFilter->GetInput();
+}
+
+
//----------------------------------------------------------------------------
vtkDoubleArray*
VISU_ColoredPL
::Init()
{
SetScalarMode(0);
- SetSourceRange();
+
+ vtkFloatingPointType aRange[2];
+ GetSourceRange( aRange );
+
+ SetScalarRange( aRange );
+ SetScalarFilteredRange( aRange );
}
//----------------------------------------------------------------------------
VISU_ColoredPL
::Build()
{
- myExtractor->SetInput(Superclass::GetClippedInput());
+ myExtractor->SetInput( Superclass::GetClippedInput() );
myFieldTransform->SetInput(myExtractor->GetOutput());
+
+ myThreshold->SetInput( myFieldTransform->GetOutput() );
// The pass filter is used here for possibility to include/exclude
// threshold filter before it.
- myPassFilter->SetInput(myFieldTransform->GetOutput()); // RKV
+ myPassFilter->SetInput( myFieldTransform->GetOutput() );
GetMapperHolder()->SetLookupTable(GetMapperTable());
GetMapper()->SetUseLookupTableScalarRange(true);
::GetSourceRange(vtkFloatingPointType theRange[2])
{
myExtractor->Update();
- myExtractor->GetOutput()->GetScalarRange(theRange);
+ myExtractor->GetOutput()->GetScalarRange( theRange );
}
void
::SetSourceRange()
{
vtkFloatingPointType aRange[2];
- GetSourceRange(aRange);
-// RKV SetScalarRange(aRange);
- SetScalarRange(aRange, myIsFiltered); // RKV
+ GetSourceRange( aRange );
+ SetScalarRange( aRange );
}
#include "VISU_PipeLine.hxx"
#include <vtkSmartPointer.h>
-#include <vtkThreshold.h> // RKV
-#include <vtkPassThroughFilter.h> // RKV
-#include <vtkDoubleArray.h> // RKV
class VISU_Extractor;
class VISU_FieldTransform;
class VISU_LookupTable;
+class vtkPassThroughFilter;
+class vtkDoubleArray;
+class vtkThreshold;
+
+
//----------------------------------------------------------------------------
class VISU_ColoredPL : public VISU_PipeLine
{
virtual
void
- SetScalarRange(vtkFloatingPointType theRange[2], const bool isFiltered); // RKV
-// RKV SetScalarRange(vtkFloatingPointType theRange[2]);
+ SetScalarRange( vtkFloatingPointType theRange[2] );
+
+ void
+ SetScalarFilteredRange( vtkFloatingPointType theRange[2] );
+
+ void
+ GetScalarFilteredRange( vtkFloatingPointType theRange[2] );
+
+ vtkFloatingPointType*
+ GetScalarFilteredRange();
+
+ bool
+ IsScalarFilterUsed();
+
+ void
+ UseScalarFiltering( bool theUseScalarFilter );
virtual
void
int
GetNbColors();
-// RKV : Begin
- //----------------------------------------------------------------------------
- bool IsFiltered() {return myIsFiltered;};
-
- vtkDoubleArray* GetDistribution(); // RKV
-// RKV : End
- //----------------------------------------------------------------------------
+ vtkDoubleArray* GetDistribution();
+
+
public:
+ //----------------------------------------------------------------------------
virtual
void
Init();
virtual
void
- SetSourceGeometry()=0;
+ SetSourceGeometry() = 0;
virtual
int
- AddGeometry(vtkDataSet* theGeometry)=0;
+ AddGeometry(vtkDataSet* theGeometry) = 0;
virtual
vtkDataSet*
- GetGeometry(int theGeomNumber)=0;
+ GetGeometry( int theGeomNumber ) = 0;
virtual
int
- GetNumberOfGeometry()=0;
+ GetNumberOfGeometry() = 0;
virtual
bool
- IsExternalGeometryUsed()=0;
+ IsExternalGeometryUsed() = 0;
virtual
void
- ClearGeometry()=0;
+ ClearGeometry() = 0;
virtual
vtkPointSet*
- GetMergedInput()=0;
+ GetMergedInput() = 0;
protected:
//----------------------------------------------------------------------------
VISU_Extractor* theExtractor);
private:
- vtkSmartPointer<VISU_LookupTable> myMapperTable;
- vtkSmartPointer<VISU_LookupTable> myBarTable;
- vtkSmartPointer<VISU_Extractor> myExtractor;
- vtkSmartPointer<VISU_FieldTransform> myFieldTransform;
- vtkSmartPointer<vtkThreshold> myThreshold; // RKV
- vtkSmartPointer<vtkPassThroughFilter> myPassFilter; // RKV
- vtkSmartPointer<vtkDoubleArray> myDistribution; // RKV
- bool myIsFiltered; // RKV
+ vtkSmartPointer< VISU_LookupTable > myMapperTable;
+ vtkSmartPointer< VISU_LookupTable > myBarTable;
+ vtkSmartPointer< VISU_Extractor > myExtractor;
+ vtkSmartPointer< VISU_FieldTransform > myFieldTransform;
+ vtkSmartPointer< vtkThreshold > myThreshold;
+ vtkSmartPointer< vtkPassThroughFilter > myPassFilter;
+ vtkSmartPointer< vtkDoubleArray > myDistribution;
};
#endif
//----------------------------------------------------------------------------
void
VISU_IsoSurfacesPL
-::SetScalarRange(vtkFloatingPointType theRange[2], const bool isFiltered)
+::SetScalarRange( vtkFloatingPointType theRange[2] )
{
-// RKV Superclass::SetScalarRange(theRange);
-// Superclass::SetScalarRange(theRange, IsFiltered()); // RKV
- Superclass::SetScalarRange(theRange, isFiltered); // VSV
+ Superclass::SetScalarRange( theRange );
SetRange(myRange);
}
virtual
void
- SetScalarRange(vtkFloatingPointType theRange[2], const bool isFiltered);
+ SetScalarRange( vtkFloatingPointType theRange[2] );
virtual
void
</message>
<message>
<source>VISU_LOGARITHMIC_SCALING</source>
- <translation>Logarithmic scaling</translation>
+ <translation>Logarithmic</translation>
</message>
<message>
<source>VISU_MAX</source>
void VisuGUI::OnFilterScalars()
{
- VisuGUI_FilterScalarsDlg* aDlg = new VisuGUI_FilterScalarsDlg(this);
+ VisuGUI_FilterScalarsDlg* aDlg = new VisuGUI_FilterScalarsDlg( this );
aDlg->show();
}
//
#include "VisuGUI_FilterScalarsDlg.h"
+#include "VISU_ColoredPrs3d_i.hh"
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
-#include <LightApp_Application.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+
#include <SUIT_Desktop.h>
#include <SUIT_MessageBox.h>
#include <SUIT_Session.h>
#include <QDoubleValidator>
-VisuGUI_FilterScalarsDlg::VisuGUI_FilterScalarsDlg(VisuGUI* theModule)
+VisuGUI_FilterScalarsDlg::VisuGUI_FilterScalarsDlg( VisuGUI* theModule )
: QDialog(VISU::GetDesktop(theModule), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
- myVisuGUI(theModule)
+ myVisuGUI( theModule )
{
setModal( false );
setWindowTitle(tr("TITLE"));
QVBoxLayout* aMainLayout = new QVBoxLayout(this);
- QGroupBox* aRangeBox = new QGroupBox(this);
- aRangeBox->setTitle(tr("BOXTITLE"));
- aRangeBox->setCheckable(true);
- aMainLayout->addWidget(aRangeBox);
-
- QHBoxLayout* aBoxLayout = new QHBoxLayout(aRangeBox);
- aBoxLayout->addWidget(new QLabel(tr("MINLBL"), aRangeBox));
- myMinEdit = new QLineEdit( aRangeBox );
+ myRangeBox = new QGroupBox(this);
+ myRangeBox->setTitle(tr("BOXTITLE"));
+ myRangeBox->setCheckable(true);
+ aMainLayout->addWidget(myRangeBox);
+
+ QHBoxLayout* aBoxLayout = new QHBoxLayout(myRangeBox);
+ aBoxLayout->addWidget(new QLabel(tr("MINLBL"), myRangeBox));
+ myMinEdit = new QLineEdit( myRangeBox );
myMinEdit->setValidator( new QDoubleValidator(myMinEdit) );
aBoxLayout->addWidget(myMinEdit);
- aBoxLayout->addWidget(new QLabel(tr("MAXLBL"), aRangeBox));
- myMaxEdit = new QLineEdit( aRangeBox );
+ aBoxLayout->addWidget(new QLabel(tr("MAXLBL"), myRangeBox));
+ myMaxEdit = new QLineEdit( myRangeBox );
myMaxEdit->setValidator( new QDoubleValidator(myMaxEdit) );
aBoxLayout->addWidget(myMaxEdit);
connect(aBtnOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(aBtnCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(aBtnHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
+
+ SalomeApp_Application* anApp = theModule->getApp();
+ LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
+ connect( aSelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionEvent() ) );
+
+ onSelectionEvent();
}
+VisuGUI_FilterScalarsDlg::~VisuGUI_FilterScalarsDlg()
+{}
+
+void VisuGUI_FilterScalarsDlg::onSelectionEvent()
+{
+ VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects( myVisuGUI );
+ if ( !aSelectionInfo.empty() ) {
+ VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
+ if ( VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase )
+ if ( VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast< VISU::ColoredPrs3d_i* >( aBase ) ) {
+ myRangeBox->setChecked( aColoredPrs3d->IsScalarFilterUsed() );
+ myMinEdit->setText( QString::number( aColoredPrs3d->GetScalarFilterMin() ) );
+ myMaxEdit->setText( QString::number( aColoredPrs3d->GetScalarFilterMax() ) );
+ myColoredPrs3d = aColoredPrs3d;
+ setEnabled( true );
+ return;
+ }
+ }
+ typedef SALOME::GenericObjPtr< VISU::ColoredPrs3d_i > TColoredPrs3dPtr;
+ myColoredPrs3d = TColoredPrs3dPtr();
+ setEnabled( false );
+ return;
+}
+
void VisuGUI_FilterScalarsDlg::accept()
{
+ myColoredPrs3d->SetScalarFilterRange( myMinEdit->text().toDouble(), myMaxEdit->text().toDouble() );
+ myColoredPrs3d->UseScalarFiltering( myRangeBox->isChecked() );
QDialog::accept();
}
#include <QDialog>
-class QLineEdit;
+#include "SALOME_GenericObjPointer.hh"
+
class VisuGUI;
+class QLineEdit;
+class QGroupBox;
+
+namespace VISU
+{
+ class ColoredPrs3d_i;
+}
+
class VisuGUI_FilterScalarsDlg: public QDialog
{
Q_OBJECT;
public:
- VisuGUI_FilterScalarsDlg(VisuGUI* theModule);
- ~VisuGUI_FilterScalarsDlg() {};
+ VisuGUI_FilterScalarsDlg( VisuGUI* theModule );
+ ~VisuGUI_FilterScalarsDlg();
protected slots:
private slots:
void onHelp();
+ void onSelectionEvent();
private:
VisuGUI* myVisuGUI;
+ SALOME::GenericObjPtr< VISU::ColoredPrs3d_i > myColoredPrs3d;
+ QGroupBox* myRangeBox;
QLineEdit* myMinEdit;
QLineEdit* myMaxEdit;
};
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 );
MinEdit->setValidator( new QDoubleValidator(this) );
MinEdit->setText( "0.0" );
QLabel* MinLabel = new QLabel (tr("LBL_MIN"), aGB);
+ MinLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
MinLabel->setBuddy(MinEdit);
MaxEdit = new QLineEdit( aGB );
MaxEdit->setValidator( new QDoubleValidator(this) );
MaxEdit->setText( "0.0" );
QLabel* MaxLabel = new QLabel (tr("LBL_MAX"), aGB);
+ MaxLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
MaxLabel->setBuddy(MaxEdit);
- RangeGroupLayout->addWidget( myModeLbl, 0, 0 );
- RangeGroupLayout->addWidget( myModeCombo, 0, 1, 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 );
- RangeGroupLayout->addWidget( MinEdit, 3, 1 );
- RangeGroupLayout->addWidget( MaxLabel, 3, 2 );
- RangeGroupLayout->addWidget( MaxEdit, 3, 3 );
+ RangeGroupLayout->addWidget( myModeLbl, 0, 0, 1, 1 );
+ RangeGroupLayout->addWidget( myModeCombo, 0, 1, 1, 2);
+ RangeGroupLayout->addWidget( CBLog, 0, 3, 1, 1);
+ RangeGroupLayout->addWidget( RBFrange, 1, 0, 1, 2);
+ RangeGroupLayout->addWidget( RBIrange, 1, 2, 1, 2);
+ RangeGroupLayout->addWidget( MinLabel, 2, 0 );
+ RangeGroupLayout->addWidget( MinEdit, 2, 1 );
+ RangeGroupLayout->addWidget( MaxLabel, 2, 2 );
+ RangeGroupLayout->addWidget( MaxEdit, 2, 3 );
//TopLayout->addWidget( RangeGroup );
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() ));
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();
myScalarMapPL->SetScaling(VISU::LOGARITHMIC);
else
myScalarMapPL->SetScaling(VISU::LINEAR);
- vtkFloatingPointType theRange[2];
- if(RBFrange->isChecked()) {
- theRange[0] = myScalarMap->GetSourceMin();
- theRange[1] = myScalarMap->GetSourceMax();
+
+ if ( RBFrange->isChecked() ) {
+ myScalarMapPL->SetSourceRange();
} else {
- theRange[0] = (vtkFloatingPointType)MinEdit->text().toDouble();
- theRange[1] = (vtkFloatingPointType)MaxEdit->text().toDouble();
+ vtkFloatingPointType aRange[2];
+ aRange[0] = (vtkFloatingPointType)MinEdit->text().toDouble();
+ aRange[1] = (vtkFloatingPointType)MaxEdit->text().toDouble();
+ myScalarMapPL->SetScalarRange( aRange );
}
-// RKV myScalarMapPL->SetScalarRange(theRange, false);
- myScalarMapPL->SetScalarRange(theRange, isFilteredByScalars()); // RKV
- myScalarMapPL->SetNbColors(sbCol);
-
+
+ myScalarMapPL->SetNbColors(sbCol);
myScalarMapPL->Update();
aScalarBarActor->SetLookupTable(myScalarMapPL->GetBarTable());
-// RKV : Begin
- aScalarBarActor->SetDistribution(myScalarMapPL->GetDistribution());
- aScalarBarActor->SetDistributionVisibility(isShowDistribution());
-// RKV : End
+ aScalarBarActor->SetDistribution( myScalarMapPL->GetDistribution() );
+ aScalarBarActor->SetDistributionVisibility( isShowDistribution() );
if (!myTextDlg->getTitleText().isEmpty()) {
VISU::PValForTime aValForTime;
else
myScalarMap->SetScaling(VISU::LINEAR);
- if (RBFrange->isChecked()) {
+ if ( RBFrange->isChecked() ) {
myScalarMap->SetSourceRange();
} else {
-// RKV myScalarMap->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble());
- myScalarMap->SetRangeAndFilter(MinEdit->text().toDouble(), MaxEdit->text().toDouble(), isFilteredByScalars()); // RKV
+ myScalarMap->SetRange( MinEdit->text().toDouble(), MaxEdit->text().toDouble() );
}
myScalarMap->SetNbColors(ColorSpin->value());
myScalarMap->SetLabels(LabelSpin->value());
myScalarMap->SetSourceRange();
MinEdit->setEnabled( false );
MaxEdit->setEnabled( false );
- CBFilter->setEnabled( false );
changeScalarMode(myModeCombo->currentIndex());
}
}
void VisuGUI_ScalarBarPane::onImposedRange( bool isOn )
{
if (isOn) {
- myScalarMap->SetRange(myScalarMap->GetMin(), myScalarMap->GetMax());
- //myScalarMap->SetRangeAndFilter(myScalarMap->GetMin(), myScalarMap->GetMax(), isFilteredByScalars());
+ myScalarMap->SetRange( myScalarMap->GetMin(), myScalarMap->GetMax() );
MinEdit->setEnabled( true );
MaxEdit->setEnabled( true );
- CBFilter->setEnabled( true );
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() ) {
myScalarMap->SetSourceRange();
MinEdit->setEnabled( false );
MaxEdit->setEnabled( false );
- CBFilter->setEnabled( false );
} else {
- myScalarMap->SetRange(myScalarMap->GetMin(), myScalarMap->GetMax());
- //myScalarMap->SetRangeAndFilter(myScalarMap->GetMin(), myScalarMap->GetMax(), isFilteredByScalars());
+ myScalarMap->SetRange( myScalarMap->GetMin(), myScalarMap->GetMax() );
MinEdit->setEnabled( true );
MaxEdit->setEnabled( true );
- CBFilter->setEnabled( true );
}
changeScalarMode(myModeCombo->currentIndex());
CBLog->setChecked( on );
}
-// RKV : Begin
-//----------------------------------------------------------------------------
-bool VisuGUI_ScalarBarPane::isFilteredByScalars() {
- if (CBFilter->isEnabled())
- return CBFilter->isChecked();
- return false;
-}
-
-
-//----------------------------------------------------------------------------
-void VisuGUI_ScalarBarPane::setFilteredByScalars( bool on ) {
- CBFilter->setChecked( on );
-}
-
//----------------------------------------------------------------------------
bool VisuGUI_ScalarBarPane::isShowDistribution() {
return CBDistr->isChecked();
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;
SetNbColors(anOrigin->GetNbColors());
SetUnitsVisible(anOrigin->IsUnitsVisible());
- SetIsDistributionVisible(anOrigin->GetIsDistributionVisible()); // RKV
+ SetIsDistributionVisible(anOrigin->GetIsDistributionVisible());
SetLabelsFormat(anOrigin->GetLabelsFormat());
SetBarOrientation(anOrigin->GetBarOrientation());
SetMinMaxController( anOrigin );
- if(anOrigin->IsRangeFixed())
-// RKV SetRange(anOrigin->GetMin(), anOrigin->GetMax());
- SetRangeAndFilter(anOrigin->GetMin(), anOrigin->GetMax(), anOrigin->IsFilteredByScalars()); // RKV
+ if ( anOrigin->IsRangeFixed() )
+ SetRange( anOrigin->GetMin(), anOrigin->GetMax() );
else
SetSourceRange();
+ SetScalarFilterRange( anOrigin->GetScalarFilterMin(), anOrigin->GetScalarFilterMax() );
+ UseScalarFiltering( anOrigin->IsScalarFilterUsed() );
+
SetPosition(anOrigin->GetPosX(), anOrigin->GetPosY());
SetSize(anOrigin->GetWidth(), anOrigin->GetHeight());
SetRatios(anOrigin->GetTitleWidth(), anOrigin->GetTitleHeight(),
return myColoredPL->GetScalarRange()[1];
}
+
//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
-::SetRange(CORBA::Double theMin, CORBA::Double theMax)
+::SetRange( CORBA::Double theMin, CORBA::Double theMax )
{
VISU::TSetModified aModified(this);
vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
-/* 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
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
UseFixedRange(true);
}
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetScalarFilterRange( CORBA::Double theMin, CORBA::Double theMax )
+{
+ VISU::TSetModified aModified(this);
+
+ vtkFloatingPointType aScalarRange[ 2 ] = { theMin, theMax };
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScalarFilteredRange, aScalarRange) );
+}
+
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::ColoredPrs3d_i
+::GetScalarFilterMin()
+{
+ vtkFloatingPointType aScalarRange[ 2 ];
+ GetSpecificPL()->GetScalarFilteredRange( aScalarRange );
+
+ return aScalarRange[ 0 ];
+}
+
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::ColoredPrs3d_i
+::GetScalarFilterMax()
+{
+ vtkFloatingPointType aScalarRange[ 2 ];
+ GetSpecificPL()->GetScalarFilteredRange( aScalarRange );
+
+ return aScalarRange[ 1 ];
+}
+
+
+//----------------------------------------------------------------------------
+CORBA::Boolean
+VISU::ColoredPrs3d_i
+::IsScalarFilterUsed()
+{
+ return myColoredPL->IsScalarFilterUsed();
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::UseScalarFiltering( CORBA::Boolean theUseScalarFilter )
+{
+ return myColoredPL->UseScalarFiltering( theUseScalarFilter );
+}
+
//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
ProcessVoidEvent(new TVoidMemFunEvent<VISU_ColoredPL>
(GetSpecificPL(), &VISU_ColoredPL::SetSourceRange));
}else{
- vtkFloatingPointType aScalarRange[2] = {GetSourceMin(), GetSourceMax()};
- ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_ColoredPL, vtkFloatingPointType*, bool>
- (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange, false));
+ vtkFloatingPointType aScalarRange[ 2 ] = {GetSourceMin(), GetSourceMax()};
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
}
UseFixedRange(false);
}
// Scalar Range
int aRangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0);
- if(aRangeType == 1){
+ if ( aRangeType == 1 ) {
float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0);
float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0);
-// RKV SetRange(aMin, aMax);
- bool isFiltered = aResourceMgr->booleanValue("VISU", "scalar_bar_filter_by_scalars", false); // RKV
- SetRangeAndFilter(aMin, aMax, isFiltered);
+ SetRange( aMin, aMax );
}
- UseFixedRange(aRangeType == 1);
+ UseFixedRange( aRangeType == 1 );
+
+ bool isFiltered = aResourceMgr->booleanValue("VISU", "scalar_bar_filter_by_scalars", false);
+ UseScalarFiltering( isFiltered );
int aNumberOfColors = aResourceMgr->integerValue( "VISU", "scalar_bar_num_colors", 64 );
SetNbColors(aNumberOfColors);
Build(ERestore);
- 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();
-// RKV SetRange(aMin, aMax);
- // RKV : Begin
- bool isFiltered = VISU::Storable::FindValue(theMap,"myIsFilteredByScalars", "0").toInt();
- SetRangeAndFilter(aMin, aMax, isFiltered);
+ 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 );
+ }
+ {
+ bool isFiltered = VISU::Storable::FindValue( theMap, "myIsFilteredByScalars", "0" ).toInt();
+ float aMin = VISU::Storable::FindValue( theMap, "myScalarFilterRange[0]" ).toDouble();
+ float aMax = VISU::Storable::FindValue( theMap, "myScalarFilterRange[1]" ).toDouble();
+ SetScalarFilterRange( aMin, aMax );
+ UseScalarFiltering( isFiltered );
+ }
SetIsDistributionVisible(VISU::Storable::FindValue(theMap,"myIsDistributionVisible", "0").toInt());
- // RKV : End
UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange", "0").toInt());
Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
Storable::DataToStream( theStr, "myIsFixedRange", IsRangeFixed() );
- Storable::DataToStream( theStr, "myIsFilteredByScalars", IsFilteredByScalars() ); // RKV
+ Storable::DataToStream( theStr, "myIsFilteredByScalars", IsScalarFilterUsed() );
+ Storable::DataToStream( theStr, "myScalarFilterRange[0]", GetScalarFilterMin() );
+ Storable::DataToStream( theStr, "myScalarFilterRange[1]", GetScalarFilterMax() );
+
Storable::DataToStream( theStr, "myIsDistributionVisible", GetIsDistributionVisible() ); // RKV
Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
return this;
}
-// RKV : Begin
//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
}
//----------------------------------------------------------------------------
-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 CORBA::Boolean GetIsDistributionVisible();
//! Gets current filtering by scalars mode
- virtual CORBA::Boolean IsFilteredByScalars();
+ virtual CORBA::Boolean IsScalarFilterUsed();
+ virtual void UseScalarFiltering( CORBA::Boolean theUseScalarFilter );
+
/*!
* Sets scalar range - min and max boundaries of the scalar bar.
* \param theMin Min boundary of the scalar bar.
*/
virtual
void
- SetRangeAndFilter(CORBA::Double theMin, CORBA::Double theMax, CORBA::Boolean theIs);
-// RKV : End
+ SetScalarFilterRange( CORBA::Double theMin, CORBA::Double theMax );
+
+ //----------------------------------------------------------------------------
+ virtual
+ CORBA::Double
+ GetScalarFilterMin();
+
+ //----------------------------------------------------------------------------
+ virtual
+ CORBA::Double
+ GetScalarFilterMax();
//----------------------------------------------------------------------------
//! Gets memory size actually used by the presentation (Mb).
VISU::TSetModified aModified(this);
vtkFloatingPointType aScalarRange[2] = {GetSourceMin(), GetSourceMax()};
- ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_ColoredPL, vtkFloatingPointType*, bool>
- (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange, false));
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
UseFixedRange(false);
}