type = QObject::tr( "BARE_BORDER_VOLUME" );
else if ( dynamic_cast< SMESH::Controls::BareBorderFace* >( f.get() ) )
type = QObject::tr( "BARE_BORDER_FACE" );
+ else if ( dynamic_cast< SMESH::Controls::OverConstrainedVolume* >( f.get() ) )
+ type = QObject::tr( "OVER_CONSTRAINED_VOLUME" );
+ else if ( dynamic_cast< SMESH::Controls::OverConstrainedFace* >( f.get() ) )
+ type = QObject::tr( "OVER_CONSTRAINED_FACE" );
return type;
}
if ( aScalarBarActor && aFunctor ) {
SMESH::Controls::NumericalFunctor* aNumFun = dynamic_cast<SMESH::Controls::NumericalFunctor*>( aFunctor.get() );
if ( aNumFun ) {
+ std::vector<int> elements;
+ SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIO);
+ if ( mesh->_is_nil() ) {
+ SMESH::SMESH_IDSource_var idSource =
+ SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(anIO);
+ if ( !idSource->_is_nil() )
+ {
+ SMESH::long_array_var ids = idSource->GetIDs();
+ elements.resize( ids->length() );
+ for ( unsigned i = 0; i < elements.size(); ++i )
+ elements[i] = ids[i];
+ }
+ }
int nbRanges = aScalarBarActor->GetMaximumNumberOfColors();
std::vector<int> nbEvents;
std::vector<double> funValues;
- aNumFun->GetHistogram( nbRanges, nbEvents, funValues );
+ aNumFun->GetHistogram( nbRanges, nbEvents, funValues, elements );
QString anInitialPath = "";
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
anInitialPath = QDir::currentPath();
if ( selected.Extent() == 1 ) {
Handle(SALOME_InteractiveObject) anIO = selected.First();
if ( anIO->hasEntry() ) {
- SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() );
- if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) {
- SMESH_ScalarBarActor *aScalarBarActor = anActor->GetScalarBarActor();
- aScalarBarActor->SetDistributionVisibility(!aScalarBarActor->GetDistributionVisibility());
- }
+ SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() );
+ if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) {
+ SMESH_ScalarBarActor *aScalarBarActor = anActor->GetScalarBarActor();
+ aScalarBarActor->SetDistributionVisibility(!aScalarBarActor->GetDistributionVisibility());
+ }
}
}
}
case 6025:
aControl = SMESH_Actor::eBareBorderFace;
break;
+ case 6026:
+ aControl = SMESH_Actor::eOverConstrainedVolume;
+ break;
+ case 6027:
+ aControl = SMESH_Actor::eOverConstrainedFace;
+ break;
}
anActor->SetControlMode(aControl);
anActor->GetScalarBarActor()->SetTitle( functorToString( anActor->GetFunctor() ).toLatin1().constData() );
case 6023:
case 6024:
case 6025:
+ case 6026:
+ case 6027:
if ( vtkwnd ) {
LightApp_SelectionMgr* mgr = selectionMgr();
createSMESHAction( 6023, "MAX_ELEMENT_LENGTH_3D", "ICON_MAX_ELEMENT_LENGTH_3D", 0, true );
createSMESHAction( 6024, "BARE_BORDER_VOLUME","ICON_BARE_BORDER_VOLUME", 0, true );
createSMESHAction( 6025, "BARE_BORDER_FACE","ICON_BARE_BORDER_FACE", 0, true );
+ createSMESHAction( 6026, "OVER_CONSTRAINED_VOLUME","ICON_OVER_CONSTRAINED_VOLUME", 0, true );
+ createSMESHAction( 6027, "OVER_CONSTRAINED_FACE","ICON_OVER_CONSTRAINED_FACE", 0, true );
createSMESHAction( 6003, "FREE_BORDER", "ICON_FREE_EDGE_2D", 0, true );
createSMESHAction( 6004, "CONNECTION", "ICON_CONNECTION", 0, true );
createSMESHAction( 6005, "FREE_NODE", "ICON_FREE_NODE", 0, true );
createMenu( 6004, edgeId, -1 );
createMenu( 6021, faceId, -1 );
createMenu( 6025, faceId, -1 );
+ createMenu( 6027, faceId, -1 );
createMenu( 6018, faceId, -1 );
createMenu( 6019, faceId, -1 );
createMenu( 6011, faceId, -1 );
createMenu( 6009, volumeId, -1 );
createMenu( 6023, volumeId, -1 );
createMenu( 6024, volumeId, -1 );
+ createMenu( 6026, volumeId, -1 );
createMenu( 4000, addId, -1 );
createMenu( 4009, addId, -1 );
createTool( separator(), ctrlTb );
createTool( 6021, ctrlTb );
createTool( 6025, ctrlTb );
+ createTool( 6027, ctrlTb );
createTool( 6018, ctrlTb );
createTool( 6019, ctrlTb );
createTool( 6011, ctrlTb );
createTool( 6009, ctrlTb );
createTool( 6023, ctrlTb );
createTool( 6024, ctrlTb );
+ createTool( 6026, ctrlTb );
createTool( separator(), ctrlTb );
createTool( 4000, addRemTb );
popupMgr()->setRule( action( 6025 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6025 ), "controlMode = 'eBareBorderFace'", QtxPopupMgr::ToggleRule );
+ popupMgr()->insert ( action( 6027 ), aSubId, -1 ); // OVER_CONSTRAINED_FACE
+ popupMgr()->setRule( action( 6027 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6027 ), "controlMode = 'eOverConstrainedFace'", QtxPopupMgr::ToggleRule );
+
aSubId = popupMgr()->insert( tr( "MEN_VOLUME_CTRL" ), anId, -1 ); // VOLUME CONTROLS
popupMgr()->insert ( action( 6017 ), aSubId, -1 ); // ASPECT_3D
popupMgr()->setRule( action( 6024 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6024 ), "controlMode = 'eBareBorderVolume'", QtxPopupMgr::ToggleRule );
+ popupMgr()->insert ( action( 6026 ), aSubId, -1 ); // OVER_CONSTRAINED_VOLUME
+ popupMgr()->setRule( action( 6026 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6026 ), "controlMode = 'eOverConstrainedVolume'", QtxPopupMgr::ToggleRule );
+
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( 201 ), anId, -1 ); // SCALAR_BAR_PROP
}
QColor distributionColor = mgr->colorValue("SMESH", "distribution_color",
- QColor(255, 255, 255));
+ QColor(255, 255, 255));
myMonoColorBtn->setColor(distributionColor);
myScalarBarActor->SetLabelTextProperty( aLabelsTextPrp );
myScalarBarActor->SetNumberOfLabels( myLabelsSpin->value() );
- if( myColorsSpin->value() != myScalarBarActor->GetMaximumNumberOfColors() ) {
- myScalarBarActor->SetMaximumNumberOfColors( myColorsSpin->value() );
- SMESH::Controls::FunctorPtr fn = myActor->GetFunctor();
- SMESH::Controls::NumericalFunctor* aNumericalFunctor = dynamic_cast<SMESH::Controls::NumericalFunctor*>(fn.get());
- if( aNumericalFunctor ) {
- int nbIntervals = myColorsSpin->value();
- std::vector<int> nbEvents;
- std::vector<double> funValues;
- aNumericalFunctor->GetHistogram(nbIntervals, nbEvents, funValues);
- myScalarBarActor->SetDistribution(nbEvents);
- }
- }
+ if( myColorsSpin->value() != myScalarBarActor->GetMaximumNumberOfColors() )
+ myActor->UpdateDistribution();
if ( myHorizRadioBtn->isChecked() )
myScalarBarActor->SetOrientationToHorizontal();
myIniH = myScalarBarActor->GetHeight();
setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
- myDistributionGrp->setChecked((bool)myScalarBarActor->GetDistributionVisibility());
- int coloringType = myScalarBarActor->GetDistributionColoringType();
- myScalarBarActor->GetDistributionColor( aTColor );
- myMonoColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
- if ( coloringType == SMESH_MONOCOLOR_TYPE ) {
- myDMonoColor->setChecked(true);
- onDistributionChanged(myDistribColorGrp->id(myDMonoColor));
- } else {
- myDMultiColor->setChecked(true);
- onDistributionChanged(myDistribColorGrp->id(myDMultiColor));
- }
+ myDistributionGrp->setChecked((bool)myScalarBarActor->GetDistributionVisibility());
+ int coloringType = myScalarBarActor->GetDistributionColoringType();
+ myScalarBarActor->GetDistributionColor( aTColor );
+ myMonoColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
+ if ( coloringType == SMESH_MONOCOLOR_TYPE ) {
+ myDMonoColor->setChecked(true);
+ onDistributionChanged(myDistribColorGrp->id(myDMonoColor));
+ } else {
+ myDMultiColor->setChecked(true);
+ onDistributionChanged(myDistribColorGrp->id(myDMultiColor));
+ }
myRangeGrp->setEnabled( true );
myFontGrp->setEnabled( true );
myLabColorGrp->setEnabled( true );