[bos #32736][CEA] Threshold of criteria. Added Wireframe Off checkbox to hide edges' lines.

This commit is contained in:
kosta 2023-04-17 17:03:01 +01:00
parent 26cb19a6fe
commit 0b4adba6a7
8 changed files with 54 additions and 3 deletions

View File

@ -842,6 +842,7 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode )
myBallActor->GetMapper()->SetScalarVisibility(false);
myScalarBarActor->SetVisibility(false);
ClipThreshold(false);
SetWireframeOff(false);
bool anIsScalarVisible = theMode > eNone;
@ -1825,6 +1826,8 @@ void SMESH_ActorDef::UpdateHighlight()
case SMESH_DeviceActor::eSurface:
case SMESH_DeviceActor::eWireframe:
{
anIsVisible = !IsWireframeOff();
if(myIsHighlighted) {
myHighlitableActor->SetProperty(myHighlightProp);
}else if(myIsPreselected){
@ -2526,6 +2529,14 @@ void SMESH_ActorDef::ClipThreshold(bool isThresholdOn, double min /*= 0.0*/, dou
}
}
// Hides the wireframe if isWireframeOff == true.
void SMESH_ActorDef::SetWireframeOff(bool isWireframeOff)
{
myIsWireframeOff = isWireframeOff;
UpdateHighlight();
}
void SMESH_ActorDef::UpdateDistribution()
{
if(SMESH::Controls::NumericalFunctor* fun =

View File

@ -168,6 +168,8 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
virtual void UpdateDistribution() = 0;
virtual void ClipThreshold(bool isThresholdOn, double min = 0.0, double max = 0.0) = 0;
virtual bool IsClipThresholdOn() const = 0;
virtual void SetWireframeOff(bool isWireframeOff) = 0;
virtual bool IsWireframeOff() const = 0;
virtual void SetPointsFontProperties( SMESH::LabelFont family, int size,
bool bold, bool italic, bool shadow,

View File

@ -228,6 +228,8 @@ class SMESH_ActorDef : public SMESH_Actor
virtual void UpdateDistribution();
virtual void ClipThreshold(bool isThresholdOn, double min = 0.0, double max = 0.0);
virtual bool IsClipThresholdOn() const { return myIsClipThresholdOn; }
virtual void SetWireframeOff(bool isWireframeOff);
virtual bool IsWireframeOff() const { return myIsWireframeOff; }
#ifndef DISABLE_PLOT2DVIEWER
virtual SPlot2d_Histogram* GetPlot2Histogram() { return my2dHistogram; }
@ -303,6 +305,7 @@ class SMESH_ActorDef : public SMESH_Actor
bool myIsEntityModeCache;
bool myIsPointsVisible;
bool myIsClipThresholdOn = false;
bool myIsWireframeOff = false;
bool myIsShrinkable;
bool myIsShrunk;

View File

@ -152,12 +152,17 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
myThresholdCheck->setText(tr("SMESH_TRESHOLD_SCALARBAR"));
myThresholdCheck->setChecked(false);
myWireframeOffCheck = new QCheckBox (myRangeGrp);
myWireframeOffCheck->setText(tr("SMESH_WIREFRAME_OFF_SCALARBAR"));
myWireframeOffCheck->setChecked(false);
myRangeGrpLayout->addWidget( new QLabel( tr( "SMESH_RANGE_MIN" ), myRangeGrp ), 0, 0, 1, 1 );
myRangeGrpLayout->addWidget( myMinEdit, 0, 1, 1, 1 );
myRangeGrpLayout->addWidget( new QLabel( tr( "SMESH_RANGE_MAX" ), myRangeGrp ), 0, 2, 1, 1 );
myRangeGrpLayout->addWidget( myMaxEdit, 0, 3, 1, 1 );
myRangeGrpLayout->addWidget( myLogarithmicCheck, 1, 0, 1, 1 );
myRangeGrpLayout->addWidget( myThresholdCheck, 1, 1, 1, 1 );
myRangeGrpLayout->addWidget( myWireframeOffCheck, 1, 2, 1, 1 );
aTopLayout->addWidget( myRangeGrp );
@ -573,6 +578,8 @@ bool SMESHGUI_Preferences_ScalarBarDlg::onApply()
myLookupTable->SetNumberOfTableValues(myColorsSpin->value());
applyThreshold(aMin, aMax);
applyWireframeOff();
bool scaleChanged = (myLogarithmicCheck->isChecked() != (myLookupTable->GetScale() == VTK_SCALE_LOG10));
if (scaleChanged)
myLookupTable->SetScale(myLogarithmicCheck->isChecked() ? VTK_SCALE_LOG10 : VTK_SCALE_LINEAR);
@ -667,8 +674,12 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged()
myThresholdCheck->setChecked(myActor->IsClipThresholdOn());
applyThreshold(range[0], range[1]);
myWireframeOffCheck->setChecked(myActor->IsWireframeOff());
}
applyWireframeOff();
vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
double aTColor[3];
aTitleTextPrp->GetColor( aTColor );
@ -897,12 +908,22 @@ void SMESHGUI_Preferences_ScalarBarDlg::initScalarBarFromResources()
/*!
* SMESHGUI_Preferences_ScalarBarDlg::applyThreshold()
*
* Switch on and off using of special color for values beyond the min-max range.
* Now this color is completely transparent - RGBA(0,0,0,0).
* Hides and shows elements beyond the given min - max range by threshold filter inside the actor.
*/
//=================================================================================================
//void SMESHGUI_Preferences_ScalarBarDlg::applyThreshold(vtkLookupTable* aLookupTable)
void SMESHGUI_Preferences_ScalarBarDlg::applyThreshold(double min, double max)
{
myActor->ClipThreshold(myThresholdCheck->isChecked(), min, max);
}
//=================================================================================================
/*!
* SMESHGUI_Preferences_ScalarBarDlg::applyWireframeOff()
*
* Hides and shows edges' lines.
*/
//=================================================================================================
void SMESHGUI_Preferences_ScalarBarDlg::applyWireframeOff()
{
myActor->SetWireframeOff(myWireframeOffCheck->isChecked());
}

View File

@ -74,6 +74,7 @@ public:
protected:
void applyThreshold(double min, double max);
void applyWireframeOff();
protected slots:
virtual void reject();
@ -103,6 +104,7 @@ private:
QLineEdit* myMaxEdit;
QCheckBox* myLogarithmicCheck;
QCheckBox* myThresholdCheck;
QCheckBox* myWireframeOffCheck;
QGroupBox* myFontGrp;
QtxColorButton* myTitleColorBtn;

View File

@ -2228,6 +2228,10 @@ Check algorithm documentation for supported geometry</translation>
<source>SMESH_TRESHOLD_SCALARBAR</source>
<translation>Threshold</translation>
</message>
<message>
<source>SMESH_WIREFRAME_OFF_SCALARBAR</source>
<translation>Wireframe Off</translation>
</message>
<message>
<source>SMESH_MAKE_GROUPS</source>
<translation>Generate groups</translation>

View File

@ -2226,6 +2226,10 @@ Référez-vous à la documentation sur l'algorithme et la géométrie supportée
<source>SMESH_TRESHOLD_SCALARBAR</source>
<translation>Seuil</translation>
</message>
<message>
<source>SMESH_WIREFRAME_OFF_SCALARBAR</source>
<translation>Filaire désactivé</translation>
</message>
<message>
<source>SMESH_MAKE_GROUPS</source>
<translation>Générer les groupes</translation>

View File

@ -1983,6 +1983,10 @@
<source>SMESH_TRESHOLD_SCALARBAR</source>
<translation></translation>
</message>
<message>
<source>SMESH_WIREFRAME_OFF_SCALARBAR</source>
<translation> </translation>
</message>
<message>
<source>SMESH_MAKE_GROUPS</source>
<translation></translation>