This commit is contained in:
eap 2011-01-18 12:14:57 +00:00
parent f42b1f95af
commit daa2cf5397
10 changed files with 594 additions and 578 deletions

View File

@ -1967,7 +1967,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
if( theCommandID==302 ) if( theCommandID==302 )
{ {
MESSAGE("anAction = SMESH::eDisplayOnly"); MESSAGE("anAction = SMESH::eDisplayOnly");
startOperation( myEraseAll ); startOperation( myEraseAll );
} }
@ -1980,17 +1980,17 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
if (vtkwnd) { if (vtkwnd) {
SALOME_ListIteratorOfListIO It( to_process ); SALOME_ListIteratorOfListIO It( to_process );
for ( ; It.More(); It.Next()) { for ( ; It.More(); It.Next()) {
MESSAGE("---"); MESSAGE("---");
Handle(SALOME_InteractiveObject) IOS = It.Value(); Handle(SALOME_InteractiveObject) IOS = It.Value();
if (IOS->hasEntry()) { if (IOS->hasEntry()) {
MESSAGE("---"); MESSAGE("---");
if (!SMESH::UpdateView(anAction, IOS->getEntry())) { if (!SMESH::UpdateView(anAction, IOS->getEntry())) {
SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged(); SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
break; // PAL16774 (Crash after display of many groups) break; // PAL16774 (Crash after display of many groups)
} }
if (anAction == SMESH::eDisplayOnly) if (anAction == SMESH::eDisplayOnly)
{ {
MESSAGE("anAction = SMESH::eDisplayOnly"); MESSAGE("anAction = SMESH::eDisplayOnly");
anAction = SMESH::eDisplay; anAction = SMESH::eDisplay;
} }
} }
@ -1999,7 +1999,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
// PAL13338 + PAL15161 --> // PAL13338 + PAL15161 -->
if ( ( theCommandID==301 || theCommandID==302 ) && !checkLock(aStudy)) { if ( ( theCommandID==301 || theCommandID==302 ) && !checkLock(aStudy)) {
MESSAGE("anAction = SMESH::eDisplayOnly"); MESSAGE("anAction = SMESH::eDisplayOnly");
SMESH::UpdateView(); SMESH::UpdateView();
SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged(); SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
} }
@ -2010,7 +2010,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
} }
if (anAction == SMESH::eErase) { if (anAction == SMESH::eErase) {
MESSAGE("anAction == SMESH::eErase"); MESSAGE("anAction == SMESH::eErase");
SALOME_ListIO l1; SALOME_ListIO l1;
aSel->setSelectedObjects( l1 ); aSel->setSelectedObjects( l1 );
} }

View File

@ -743,32 +743,32 @@ void SMESHGUI_BaseComputeOp::computeMesh()
bool limitExceeded; bool limitExceeded;
if ( !memoryLack ) if ( !memoryLack )
{ {
if ( getSMESHGUI()->automaticUpdate( newSize, &limitExceeded ) ) if ( getSMESHGUI()->automaticUpdate( newSize, &limitExceeded ) )
{ {
try { try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#endif #endif
SMESH::Update(myIObject, true); SMESH::Update(myIObject, true);
} }
catch (...) { catch (...) {
#ifdef _DEBUG_ #ifdef _DEBUG_
MESSAGE ( "Exception thrown during mesh visualization" ); MESSAGE ( "Exception thrown during mesh visualization" );
#endif #endif
if ( SMDS_Mesh::CheckMemory(true) ) { // has memory to show warning? if ( SMDS_Mesh::CheckMemory(true) ) { // has memory to show warning?
SMESH::OnVisuException(); SMESH::OnVisuException();
} }
else { else {
memoryLack = true; memoryLack = true;
} }
} }
}
else if ( limitExceeded )
{
SUIT_MessageBox::warning( desktop(),
tr( "SMESH_WRN_WARNING" ),
tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ).arg( newSize ).arg( limitSize ) );
} }
else if ( limitExceeded )
{
SUIT_MessageBox::warning( desktop(),
tr( "SMESH_WRN_WARNING" ),
tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ).arg( newSize ).arg( limitSize ) );
}
} }
LightApp_SelectionMgr *Sel = selectionMgr(); LightApp_SelectionMgr *Sel = selectionMgr();
if ( Sel ) if ( Sel )

View File

@ -1169,22 +1169,22 @@ void SMESHGUI_FilterTable::SetCriterion (const int theRow,
aTable->item( theRow, 2 )->setText( QString( theCriterion.ThresholdID ) ); aTable->item( theRow, 2 )->setText( QString( theCriterion.ThresholdID ) );
} }
else if (theCriterion.Type != SMESH::FT_RangeOfIds && else if (theCriterion.Type != SMESH::FT_RangeOfIds &&
theCriterion.Type != SMESH::FT_BelongToGeom && theCriterion.Type != SMESH::FT_BelongToGeom &&
theCriterion.Type != SMESH::FT_BelongToPlane && theCriterion.Type != SMESH::FT_BelongToPlane &&
theCriterion.Type != SMESH::FT_BelongToCylinder && theCriterion.Type != SMESH::FT_BelongToCylinder &&
theCriterion.Type != SMESH::FT_BelongToGenSurface && theCriterion.Type != SMESH::FT_BelongToGenSurface &&
theCriterion.Type != SMESH::FT_LyingOnGeom && theCriterion.Type != SMESH::FT_LyingOnGeom &&
theCriterion.Type != SMESH::FT_CoplanarFaces && theCriterion.Type != SMESH::FT_CoplanarFaces &&
theCriterion.Type != SMESH::FT_FreeBorders && theCriterion.Type != SMESH::FT_FreeBorders &&
theCriterion.Type != SMESH::FT_FreeEdges && theCriterion.Type != SMESH::FT_FreeEdges &&
theCriterion.Type != SMESH::FT_FreeNodes && theCriterion.Type != SMESH::FT_FreeNodes &&
theCriterion.Type != SMESH::FT_FreeFaces && theCriterion.Type != SMESH::FT_FreeFaces &&
theCriterion.Type != SMESH::FT_BadOrientedVolume && theCriterion.Type != SMESH::FT_BadOrientedVolume &&
theCriterion.Type != SMESH::FT_BareBorderFace && theCriterion.Type != SMESH::FT_BareBorderFace &&
theCriterion.Type != SMESH::FT_BareBorderVolume && theCriterion.Type != SMESH::FT_BareBorderVolume &&
theCriterion.Type != SMESH::FT_OverConstrainedFace && theCriterion.Type != SMESH::FT_OverConstrainedFace &&
theCriterion.Type != SMESH::FT_OverConstrainedVolume && theCriterion.Type != SMESH::FT_OverConstrainedVolume &&
theCriterion.Type != SMESH::FT_LinearOrQuadratic) theCriterion.Type != SMESH::FT_LinearOrQuadratic)
{ {
aTable->item( theRow, 2 )->setText(QString("%1").arg(theCriterion.Threshold, 0, 'g', 15)); aTable->item( theRow, 2 )->setText(QString("%1").arg(theCriterion.Threshold, 0, 'g', 15));
} }
@ -1529,12 +1529,12 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
if ((aType == SMESH::NODE && aCriterionType == SMESH::FT_FreeNodes ) || if ((aType == SMESH::NODE && aCriterionType == SMESH::FT_FreeNodes ) ||
(aType == SMESH::EDGE && aCriterionType == SMESH::FT_FreeBorders ) || (aType == SMESH::EDGE && aCriterionType == SMESH::FT_FreeBorders ) ||
(aType == SMESH::FACE && (aCriterionType == SMESH::FT_BareBorderFace || (aType == SMESH::FACE && (aCriterionType == SMESH::FT_BareBorderFace ||
aCriterionType == SMESH::FT_OverConstrainedFace || aCriterionType == SMESH::FT_OverConstrainedFace ||
aCriterionType == SMESH::FT_FreeEdges || aCriterionType == SMESH::FT_FreeEdges ||
aCriterionType == SMESH::FT_FreeFaces)) || aCriterionType == SMESH::FT_FreeFaces)) ||
(aType == SMESH::VOLUME && (aCriterionType == SMESH::FT_BadOrientedVolume || (aType == SMESH::VOLUME && (aCriterionType == SMESH::FT_BadOrientedVolume ||
aCriterionType == SMESH::FT_OverConstrainedVolume || aCriterionType == SMESH::FT_OverConstrainedVolume ||
aCriterionType == SMESH::FT_BareBorderVolume)) || aCriterionType == SMESH::FT_BareBorderVolume)) ||
aCriterionType == SMESH::FT_LinearOrQuadratic || aCriterionType == SMESH::FT_LinearOrQuadratic ||
aCriterionType == SMESH::FT_GroupColor || aCriterionType == SMESH::FT_GroupColor ||
aCriterionType == SMESH::FT_ElemGeomType || aCriterionType == SMESH::FT_ElemGeomType ||

View File

@ -392,50 +392,50 @@ void SMESHGUI_MinDistance::selectionChanged()
SMESH::SMESH_IDSource_var obj = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO ); SMESH::SMESH_IDSource_var obj = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
if ( !CORBA::is_nil( obj ) ) { if ( !CORBA::is_nil( obj ) ) {
if ( myCurrentTgt == FirstTgt ) { if ( myCurrentTgt == FirstTgt ) {
myFirstSrc = obj; myFirstSrc = obj;
myFirstActor = SMESH::FindActorByEntry( IO->getEntry() ); myFirstActor = SMESH::FindActorByEntry( IO->getEntry() );
if ( myFirst->checkedId() == ObjectTgt ) { if ( myFirst->checkedId() == ObjectTgt ) {
QString aName; QString aName;
SMESH::GetNameOfSelectedIObjects( SMESHGUI::selectionMgr(), aName ); SMESH::GetNameOfSelectedIObjects( SMESHGUI::selectionMgr(), aName );
myFirstTgt->setText( aName ); myFirstTgt->setText( aName );
} }
else { else {
SVTK_Selector* selector = SMESH::GetViewWindow()->GetSelector(); SVTK_Selector* selector = SMESH::GetViewWindow()->GetSelector();
QString ID; QString ID;
int nb = 0; int nb = 0;
if ( myFirstActor && selector ) { if ( myFirstActor && selector ) {
nb = myFirst->checkedId() == NodeTgt ? nb = myFirst->checkedId() == NodeTgt ?
SMESH::GetNameOfSelectedElements( selector, IO, ID ) : SMESH::GetNameOfSelectedElements( selector, IO, ID ) :
SMESH::GetNameOfSelectedNodes( selector, IO, ID ); SMESH::GetNameOfSelectedNodes( selector, IO, ID );
} }
if ( nb == 1 ) if ( nb == 1 )
myFirstTgt->setText( ID.trimmed() ); myFirstTgt->setText( ID.trimmed() );
else else
myFirstTgt->clear(); myFirstTgt->clear();
} }
} }
else if ( myCurrentTgt == SecondTgt ) { else if ( myCurrentTgt == SecondTgt ) {
mySecondSrc = obj; mySecondSrc = obj;
mySecondActor = SMESH::FindActorByEntry( IO->getEntry() ); mySecondActor = SMESH::FindActorByEntry( IO->getEntry() );
if ( mySecond->checkedId() == ObjectTgt ) { if ( mySecond->checkedId() == ObjectTgt ) {
QString aName; QString aName;
SMESH::GetNameOfSelectedIObjects( SMESHGUI::selectionMgr(), aName ); SMESH::GetNameOfSelectedIObjects( SMESHGUI::selectionMgr(), aName );
mySecondTgt->setText( aName ); mySecondTgt->setText( aName );
} }
else { else {
SVTK_Selector* selector = SMESH::GetViewWindow()->GetSelector(); SVTK_Selector* selector = SMESH::GetViewWindow()->GetSelector();
QString ID; QString ID;
int nb = 0; int nb = 0;
if ( mySecondActor && selector ) { if ( mySecondActor && selector ) {
nb = mySecond->checkedId() == NodeTgt ? nb = mySecond->checkedId() == NodeTgt ?
SMESH::GetNameOfSelectedElements( selector, IO, ID ) : SMESH::GetNameOfSelectedElements( selector, IO, ID ) :
SMESH::GetNameOfSelectedNodes( selector, IO, ID ); SMESH::GetNameOfSelectedNodes( selector, IO, ID );
} }
if ( nb == 1 ) if ( nb == 1 )
mySecondTgt->setText( ID.trimmed() ); mySecondTgt->setText( ID.trimmed() );
else else
mySecondTgt->clear(); mySecondTgt->clear();
} }
} }
} }
} }
@ -529,11 +529,11 @@ void SMESHGUI_MinDistance::compute()
SMESH::SMESH_Mesh_var m = myFirstSrc->GetMesh(); SMESH::SMESH_Mesh_var m = myFirstSrc->GetMesh();
long id = myFirstTgt->text().toLong(); long id = myFirstTgt->text().toLong();
if ( !CORBA::is_nil( m ) && id ) { if ( !CORBA::is_nil( m ) && id ) {
SMESH::long_array_var ids = new SMESH::long_array(); SMESH::long_array_var ids = new SMESH::long_array();
ids->length( 1 ); ids->length( 1 );
ids[0] = id; ids[0] = id;
SMESH::SMESH_MeshEditor_var me = m->GetMeshEditor(); SMESH::SMESH_MeshEditor_var me = m->GetMeshEditor();
s1 = me->MakeIDSource( ids.in(), myFirst->checkedId() == NodeTgt ? SMESH::NODE : SMESH::FACE ); s1 = me->MakeIDSource( ids.in(), myFirst->checkedId() == NodeTgt ? SMESH::NODE : SMESH::FACE );
} }
} }
else { else {
@ -547,11 +547,11 @@ void SMESHGUI_MinDistance::compute()
SMESH::SMESH_Mesh_var m = mySecondSrc->GetMesh(); SMESH::SMESH_Mesh_var m = mySecondSrc->GetMesh();
long id = mySecondTgt->text().toLong(); long id = mySecondTgt->text().toLong();
if ( !CORBA::is_nil( m ) && id ) { if ( !CORBA::is_nil( m ) && id ) {
SMESH::long_array_var ids = new SMESH::long_array(); SMESH::long_array_var ids = new SMESH::long_array();
ids->length( 1 ); ids->length( 1 );
ids[0] = id; ids[0] = id;
SMESH::SMESH_MeshEditor_var me = m->GetMeshEditor(); SMESH::SMESH_MeshEditor_var me = m->GetMeshEditor();
s2 = me->MakeIDSource( ids.in(), mySecond->checkedId() == NodeTgt ? SMESH::NODE : SMESH::FACE ); s2 = me->MakeIDSource( ids.in(), mySecond->checkedId() == NodeTgt ? SMESH::NODE : SMESH::FACE );
} }
} }
else { else {
@ -912,40 +912,40 @@ void SMESHGUI_BoundingBox::selectionChanged()
mySrc.append( obj ); mySrc.append( obj );
myActor = SMESH::FindActorByEntry( IO->getEntry() ); myActor = SMESH::FindActorByEntry( IO->getEntry() );
if ( mySourceMode->checkedId() == ObjectsSrc ) { if ( mySourceMode->checkedId() == ObjectsSrc ) {
QString aName; QString aName;
SMESH::GetNameOfSelectedIObjects( SMESHGUI::selectionMgr(), aName ); SMESH::GetNameOfSelectedIObjects( SMESHGUI::selectionMgr(), aName );
mySource->setText( aName ); mySource->setText( aName );
} }
else { else {
SVTK_Selector* selector = SMESH::GetViewWindow()->GetSelector(); SVTK_Selector* selector = SMESH::GetViewWindow()->GetSelector();
QString ID; QString ID;
int nb = 0; int nb = 0;
if ( myActor && selector ) { if ( myActor && selector ) {
nb = mySourceMode->checkedId() == NodesSrc ? nb = mySourceMode->checkedId() == NodesSrc ?
SMESH::GetNameOfSelectedElements( selector, IO, ID ) : SMESH::GetNameOfSelectedElements( selector, IO, ID ) :
SMESH::GetNameOfSelectedNodes( selector, IO, ID ); SMESH::GetNameOfSelectedNodes( selector, IO, ID );
} }
if ( nb > 0 ) { if ( nb > 0 ) {
myIDs = ID.trimmed(); myIDs = ID.trimmed();
if ( nb < MAX_NB_FOR_EDITOR ) { if ( nb < MAX_NB_FOR_EDITOR ) {
mySource->setReadOnly( false ); mySource->setReadOnly( false );
if ( mySource->validator() != myValidator ) if ( mySource->validator() != myValidator )
mySource->setValidator( myValidator ); mySource->setValidator( myValidator );
mySource->setText( ID.trimmed() ); mySource->setText( ID.trimmed() );
} }
else { else {
mySource->setReadOnly( true ); mySource->setReadOnly( true );
mySource->setValidator( 0 ); mySource->setValidator( 0 );
mySource->setText( tr( "SELECTED_NB_OBJ" ).arg( nb ) mySource->setText( tr( "SELECTED_NB_OBJ" ).arg( nb )
.arg( mySourceMode->checkedId() == NodesSrc ? tr( "NB_NODES" ) : tr( "NB_ELEMENTS") ) ); .arg( mySourceMode->checkedId() == NodesSrc ? tr( "NB_NODES" ) : tr( "NB_ELEMENTS") ) );
} }
} }
else { else {
myIDs = ""; myIDs = "";
mySource->clear(); mySource->clear();
mySource->setReadOnly( false ); mySource->setReadOnly( false );
mySource->setValidator( myValidator ); mySource->setValidator( myValidator );
} }
} }
} }
} }
@ -956,11 +956,11 @@ void SMESHGUI_BoundingBox::selectionChanged()
myActor = 0; myActor = 0;
if ( mySourceMode->checkedId() == ObjectsSrc ) { if ( mySourceMode->checkedId() == ObjectsSrc ) {
for( ; It.More(); It.Next()){ for( ; It.More(); It.Next()){
Handle(SALOME_InteractiveObject) IO = It.Value(); Handle(SALOME_InteractiveObject) IO = It.Value();
SMESH::SMESH_IDSource_var obj = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO ); SMESH::SMESH_IDSource_var obj = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
if ( !CORBA::is_nil( obj ) ) { if ( !CORBA::is_nil( obj ) ) {
mySrc.append( obj ); mySrc.append( obj );
} }
} }
QString aName; QString aName;
SMESH::GetNameOfSelectedIObjects( SMESHGUI::selectionMgr(), aName ); SMESH::GetNameOfSelectedIObjects( SMESHGUI::selectionMgr(), aName );
@ -999,10 +999,10 @@ void SMESHGUI_BoundingBox::sourceEdited()
if ( mySourceMode->checkedId() == NodesSrc || mySourceMode->checkedId() == ElementsSrc ) { if ( mySourceMode->checkedId() == NodesSrc || mySourceMode->checkedId() == ElementsSrc ) {
TColStd_MapOfInteger ID; TColStd_MapOfInteger ID;
if ( !mySource->isReadOnly() ) if ( !mySource->isReadOnly() )
myIDs = mySource->text(); myIDs = mySource->text();
QStringList ids = myIDs.split( " ", QString::SkipEmptyParts ); QStringList ids = myIDs.split( " ", QString::SkipEmptyParts );
foreach ( QString id, ids ) foreach ( QString id, ids )
ID.Add( id.trimmed().toLong() ); ID.Add( id.trimmed().toLong() );
selector->AddOrRemoveIndex( IO, ID, false ); selector->AddOrRemoveIndex( IO, ID, false );
} }
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() ) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )
@ -1022,14 +1022,14 @@ void SMESHGUI_BoundingBox::compute()
SMESH::SMESH_Mesh_var m = mySrc[0]->GetMesh(); SMESH::SMESH_Mesh_var m = mySrc[0]->GetMesh();
QStringList ids = myIDs.split( " ", QString::SkipEmptyParts ); QStringList ids = myIDs.split( " ", QString::SkipEmptyParts );
if ( !CORBA::is_nil( m ) && ids.count() > 0 ) { if ( !CORBA::is_nil( m ) && ids.count() > 0 ) {
SMESH::long_array_var ids_in = new SMESH::long_array(); SMESH::long_array_var ids_in = new SMESH::long_array();
ids_in->length( ids.count() ); ids_in->length( ids.count() );
for( int i = 0; i < ids.count(); i++ ) for( int i = 0; i < ids.count(); i++ )
ids_in[i] = ids[i].trimmed().toLong(); ids_in[i] = ids[i].trimmed().toLong();
SMESH::SMESH_MeshEditor_var me = m->GetMeshEditor(); SMESH::SMESH_MeshEditor_var me = m->GetMeshEditor();
SMESH::SMESH_IDSource_var s = me->MakeIDSource( ids_in.in(), mySourceMode->checkedId() == NodesSrc ? SMESH::NODE : SMESH::FACE ); SMESH::SMESH_IDSource_var s = me->MakeIDSource( ids_in.in(), mySourceMode->checkedId() == NodesSrc ? SMESH::NODE : SMESH::FACE );
srcList->length( 1 ); srcList->length( 1 );
srcList[0] = s; srcList[0] = s;
} }
} }
} }
@ -1204,8 +1204,8 @@ void SMESHGUI_MeasureDlg::updateSelection()
void SMESHGUI_MeasureDlg::help() void SMESHGUI_MeasureDlg::help()
{ {
SMESH::ShowHelpFile( myTabWidget->currentIndex() == MinDistance ? SMESH::ShowHelpFile( myTabWidget->currentIndex() == MinDistance ?
"measurements_page.html#min_distance_anchor" : "measurements_page.html#min_distance_anchor" :
"measurements_page.html#bounding_box_anchor" ); "measurements_page.html#bounding_box_anchor" );
} }
/*! /*!

View File

@ -804,15 +804,15 @@ void SMESHGUI_MergeDlg::onDetect()
switch (myAction) { switch (myAction) {
case 0 : case 0 :
for ( int i = 0; GroupExclude->isChecked() && i < ListExclude->count(); i++ ) { for ( int i = 0; GroupExclude->isChecked() && i < ListExclude->count(); i++ ) {
if ( ListExclude->item( i )->checkState() == Qt::Checked ) { if ( ListExclude->item( i )->checkState() == Qt::Checked ) {
aExcludeGroups->length( aExcludeGroups->length()+1 ); aExcludeGroups->length( aExcludeGroups->length()+1 );
aExcludeGroups[ aExcludeGroups->length()-1 ] = SMESH::SMESH_IDSource::_duplicate( myGroups[i] ); aExcludeGroups[ aExcludeGroups->length()-1 ] = SMESH::SMESH_IDSource::_duplicate( myGroups[i] );
} }
} }
aMeshEditor->FindCoincidentNodesOnPartBut(src.in(), aMeshEditor->FindCoincidentNodesOnPartBut(src.in(),
SpinBoxTolerance->GetValue(), SpinBoxTolerance->GetValue(),
aGroupsArray.out(), aGroupsArray.out(),
aExcludeGroups.in()); aExcludeGroups.in());
break; break;
case 1 : case 1 :
aMeshEditor->FindEqualElements(src.in(), aGroupsArray.out()); aMeshEditor->FindEqualElements(src.in(), aGroupsArray.out());
@ -1155,17 +1155,17 @@ void SMESHGUI_MergeDlg::SelectionIntoArgument()
ListExclude->clear(); ListExclude->clear();
SMESH::ListOfGroups_var aListOfGroups = myMesh->GetGroups(); SMESH::ListOfGroups_var aListOfGroups = myMesh->GetGroups();
for( int i = 0, n = aListOfGroups->length(); i < n; i++ ) { for( int i = 0, n = aListOfGroups->length(); i < n; i++ ) {
SMESH::SMESH_GroupBase_var aGroup = aListOfGroups[i]; SMESH::SMESH_GroupBase_var aGroup = aListOfGroups[i];
if ( !aGroup->_is_nil() ) { // && aGroup->GetType() == SMESH::NODE if ( !aGroup->_is_nil() ) { // && aGroup->GetType() == SMESH::NODE
QString aGroupName( aGroup->GetName() ); QString aGroupName( aGroup->GetName() );
if ( !aGroupName.isEmpty() ) { if ( !aGroupName.isEmpty() ) {
myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup)); myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroup));
QListWidgetItem* item = new QListWidgetItem( aGroupName ); QListWidgetItem* item = new QListWidgetItem( aGroupName );
item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable ); item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable );
item->setCheckState( Qt::Unchecked ); item->setCheckState( Qt::Unchecked );
ListExclude->addItem( item ); ListExclude->addItem( item );
} }
} }
} }
} }

View File

@ -290,23 +290,23 @@ void SMESHGUI_MeshInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
QString objType; QString objType;
switch( aGroup->GetType() ) { switch( aGroup->GetType() ) {
case SMESH::NODE: case SMESH::NODE:
objType = tr( "OBJECT_GROUP_NODES" ); objType = tr( "OBJECT_GROUP_NODES" );
break; break;
case SMESH::EDGE: case SMESH::EDGE:
objType = tr( "OBJECT_GROUP_EDGES" ); objType = tr( "OBJECT_GROUP_EDGES" );
break; break;
case SMESH::FACE: case SMESH::FACE:
objType = tr( "OBJECT_GROUP_FACES" ); objType = tr( "OBJECT_GROUP_FACES" );
break; break;
case SMESH::VOLUME: case SMESH::VOLUME:
objType = tr( "OBJECT_GROUP_VOLUMES" ); objType = tr( "OBJECT_GROUP_VOLUMES" );
break; break;
case SMESH::ELEM0D: case SMESH::ELEM0D:
objType = tr( "OBJECT_GROUP_0DELEMS" ); objType = tr( "OBJECT_GROUP_0DELEMS" );
break; break;
default: default:
objType = tr( "OBJECT_GROUP" ); objType = tr( "OBJECT_GROUP" );
break; break;
} }
myWidgets[iObject][iSingle]->setProperty( "text", objType ); myWidgets[iObject][iSingle]->setProperty( "text", objType );
} }
@ -712,152 +712,152 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 ); int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 );
foreach ( long id, ids ) { foreach ( long id, ids ) {
if ( !isElements() ) { if ( !isElements() ) {
// //
// show node info // show node info
// //
const SMDS_MeshElement* e = actor()->GetObject()->GetMesh()->FindNode( id ); const SMDS_MeshElement* e = actor()->GetObject()->GetMesh()->FindNode( id );
if ( !e ) return; if ( !e ) return;
const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( e ); const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( e );
// node ID // node ID
myInfo->append( QString( "<b>%1 #%2</b>" ).arg( tr( "NODE" ) ).arg( id ) ); myInfo->append( QString( "<b>%1 #%2</b>" ).arg( tr( "NODE" ) ).arg( id ) );
// separator // separator
myInfo->append( "" ); myInfo->append( "" );
// coordinates // coordinates
myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( tr( "COORDINATES" ) ). myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( tr( "COORDINATES" ) ).
arg( node->X(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ). arg( node->X(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ).
arg( node->Y(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ). arg( node->Y(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ).
arg( node->Z(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); arg( node->Z(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
// separator // separator
myInfo->append( "" ); myInfo->append( "" );
// connectivity // connectivity
Connectivity connectivity = nodeConnectivity( node ); Connectivity connectivity = nodeConnectivity( node );
if ( !connectivity.isEmpty() ) { if ( !connectivity.isEmpty() ) {
myInfo->append( QString( "<b>%1:</b>" ).arg( tr( "CONNECTIVITY" ) ) ); myInfo->append( QString( "<b>%1:</b>" ).arg( tr( "CONNECTIVITY" ) ) );
QString con = formatConnectivity( connectivity, SMDSAbs_0DElement ); QString con = formatConnectivity( connectivity, SMDSAbs_0DElement );
if ( !con.isEmpty() ) if ( !con.isEmpty() )
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "0D_ELEMENTS" ) ).arg( con ) ); myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "0D_ELEMENTS" ) ).arg( con ) );
con = formatConnectivity( connectivity, SMDSAbs_Edge ); con = formatConnectivity( connectivity, SMDSAbs_Edge );
if ( !con.isEmpty() ) if ( !con.isEmpty() )
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "EDGES" ) ).arg( con ) ); myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "EDGES" ) ).arg( con ) );
con = formatConnectivity( connectivity, SMDSAbs_Face ); con = formatConnectivity( connectivity, SMDSAbs_Face );
if ( !con.isEmpty() ) if ( !con.isEmpty() )
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "FACES" ) ).arg( con ) ); myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "FACES" ) ).arg( con ) );
con = formatConnectivity( connectivity, SMDSAbs_Volume ); con = formatConnectivity( connectivity, SMDSAbs_Volume );
if ( !con.isEmpty() ) if ( !con.isEmpty() )
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "VOLUMES" ) ).arg( con ) ); myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "VOLUMES" ) ).arg( con ) );
} }
else { else {
myInfo->append( QString( "<b>%1</b>" ).arg( tr( "FREE_NODE" ) ).arg( id ) ); myInfo->append( QString( "<b>%1</b>" ).arg( tr( "FREE_NODE" ) ).arg( id ) );
} }
} }
else { else {
// //
// show element info // show element info
// //
const SMDS_MeshElement* e = actor()->GetObject()->GetMesh()->FindElement( id ); const SMDS_MeshElement* e = actor()->GetObject()->GetMesh()->FindElement( id );
if ( !e ) return; if ( !e ) return;
// element ID && type // element ID && type
QString stype; QString stype;
switch( e->GetType() ) { switch( e->GetType() ) {
case SMDSAbs_0DElement: case SMDSAbs_0DElement:
stype = tr( "0D ELEMENT" ); break; stype = tr( "0D ELEMENT" ); break;
case SMDSAbs_Edge: case SMDSAbs_Edge:
stype = tr( "EDGE" ); break; stype = tr( "EDGE" ); break;
case SMDSAbs_Face: case SMDSAbs_Face:
stype = tr( "FACE" ); break; stype = tr( "FACE" ); break;
case SMDSAbs_Volume: case SMDSAbs_Volume:
stype = tr( "VOLUME" ); break; stype = tr( "VOLUME" ); break;
default: default:
break; break;
} }
if ( stype.isEmpty() ) return; if ( stype.isEmpty() ) return;
myInfo->append( QString( "<b>%1 #%2</b>" ).arg( stype ).arg( id ) ); myInfo->append( QString( "<b>%1 #%2</b>" ).arg( stype ).arg( id ) );
// separator // separator
myInfo->append( "" ); myInfo->append( "" );
// geometry type // geometry type
QString gtype; QString gtype;
switch( e->GetEntityType() ) { switch( e->GetEntityType() ) {
case SMDSEntity_Triangle: case SMDSEntity_Triangle:
case SMDSEntity_Quad_Triangle: case SMDSEntity_Quad_Triangle:
gtype = tr( "TRIANGLE" ); break; gtype = tr( "TRIANGLE" ); break;
case SMDSEntity_Quadrangle: case SMDSEntity_Quadrangle:
case SMDSEntity_Quad_Quadrangle: case SMDSEntity_Quad_Quadrangle:
gtype = tr( "QUADRANGLE" ); break; gtype = tr( "QUADRANGLE" ); break;
case SMDSEntity_Polygon: case SMDSEntity_Polygon:
case SMDSEntity_Quad_Polygon: case SMDSEntity_Quad_Polygon:
gtype = tr( "POLYGON" ); break; gtype = tr( "POLYGON" ); break;
case SMDSEntity_Tetra: case SMDSEntity_Tetra:
case SMDSEntity_Quad_Tetra: case SMDSEntity_Quad_Tetra:
gtype = tr( "TETRAHEDRON" ); break; gtype = tr( "TETRAHEDRON" ); break;
case SMDSEntity_Pyramid: case SMDSEntity_Pyramid:
case SMDSEntity_Quad_Pyramid: case SMDSEntity_Quad_Pyramid:
gtype = tr( "PYRAMID" ); break; gtype = tr( "PYRAMID" ); break;
case SMDSEntity_Hexa: case SMDSEntity_Hexa:
case SMDSEntity_Quad_Hexa: case SMDSEntity_Quad_Hexa:
gtype = tr( "HEXAHEDRON" ); break; gtype = tr( "HEXAHEDRON" ); break;
case SMDSEntity_Penta: case SMDSEntity_Penta:
case SMDSEntity_Quad_Penta: case SMDSEntity_Quad_Penta:
gtype = tr( "PRISM" ); break; gtype = tr( "PRISM" ); break;
case SMDSEntity_Polyhedra: case SMDSEntity_Polyhedra:
case SMDSEntity_Quad_Polyhedra: case SMDSEntity_Quad_Polyhedra:
gtype = tr( "POLYHEDRON" ); break; gtype = tr( "POLYHEDRON" ); break;
default: default:
break; break;
} }
if ( !gtype.isEmpty() ) if ( !gtype.isEmpty() )
myInfo->append( QString( "<b>%1:</b> %2" ).arg( tr( "TYPE" ) ).arg( gtype ) ); myInfo->append( QString( "<b>%1:</b> %2" ).arg( tr( "TYPE" ) ).arg( gtype ) );
// quadratic flag and gravity center (any element except 0D) // quadratic flag and gravity center (any element except 0D)
if ( e->GetEntityType() > SMDSEntity_0D && e->GetEntityType() < SMDSEntity_Last ) { if ( e->GetEntityType() > SMDSEntity_0D && e->GetEntityType() < SMDSEntity_Last ) {
// quadratic flag // quadratic flag
myInfo->append( QString( "<b>%1?</b> %2" ).arg( tr( "QUADRATIC" ) ).arg( e->IsQuadratic() ? tr( "YES" ) : tr( "NO" ) ) ); myInfo->append( QString( "<b>%1?</b> %2" ).arg( tr( "QUADRATIC" ) ).arg( e->IsQuadratic() ? tr( "YES" ) : tr( "NO" ) ) );
// separator // separator
myInfo->append( "" ); myInfo->append( "" );
// gravity center // gravity center
XYZ gc = gravityCenter( e ); XYZ gc = gravityCenter( e );
myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( tr( "GRAVITY_CENTER" ) ).arg( gc.x() ).arg( gc.y() ).arg( gc.z() ) ); myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( tr( "GRAVITY_CENTER" ) ).arg( gc.x() ).arg( gc.y() ).arg( gc.z() ) );
} }
// separator // separator
myInfo->append( "" ); myInfo->append( "" );
// connectivity // connectivity
SMDS_ElemIteratorPtr nodeIt = e->nodesIterator(); SMDS_ElemIteratorPtr nodeIt = e->nodesIterator();
for ( int idx = 1; nodeIt->more(); idx++ ) { for ( int idx = 1; nodeIt->more(); idx++ ) {
const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() ); const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
// node number and ID // node number and ID
myInfo->append( QString( "<b>%1 %2/%3</b> - #%4" ).arg( tr( "NODE" ) ).arg( idx ).arg( e->NbNodes() ).arg( node->GetID() ) ); myInfo->append( QString( "<b>%1 %2/%3</b> - #%4" ).arg( tr( "NODE" ) ).arg( idx ).arg( e->NbNodes() ).arg( node->GetID() ) );
// node coordinates // node coordinates
myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( tr( "COORDINATES" ) ). myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( tr( "COORDINATES" ) ).
arg( node->X(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ). arg( node->X(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ).
arg( node->Y(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ). arg( node->Y(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ).
arg( node->Z(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); arg( node->Z(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
// node connectivity // node connectivity
Connectivity connectivity = nodeConnectivity( node ); Connectivity connectivity = nodeConnectivity( node );
if ( !connectivity.isEmpty() ) { if ( !connectivity.isEmpty() ) {
myInfo->append( QString( "<b>%1:</b>" ).arg( tr( "CONNECTIVITY" ) ) ); myInfo->append( QString( "<b>%1:</b>" ).arg( tr( "CONNECTIVITY" ) ) );
QString con = formatConnectivity( connectivity, SMDSAbs_0DElement ); QString con = formatConnectivity( connectivity, SMDSAbs_0DElement );
if ( !con.isEmpty() ) if ( !con.isEmpty() )
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "0D_ELEMENTS" ) ).arg( con ) ); myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "0D_ELEMENTS" ) ).arg( con ) );
con = formatConnectivity( connectivity, SMDSAbs_Edge ); con = formatConnectivity( connectivity, SMDSAbs_Edge );
if ( !con.isEmpty() ) if ( !con.isEmpty() )
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "EDGES" ) ).arg( con ) ); myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "EDGES" ) ).arg( con ) );
con = formatConnectivity( connectivity, SMDSAbs_Face ); con = formatConnectivity( connectivity, SMDSAbs_Face );
if ( !con.isEmpty() ) if ( !con.isEmpty() )
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "FACES" ) ).arg( con ) ); myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "FACES" ) ).arg( con ) );
con = formatConnectivity( connectivity, SMDSAbs_Volume ); con = formatConnectivity( connectivity, SMDSAbs_Volume );
if ( !con.isEmpty() ) if ( !con.isEmpty() )
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "VOLUMES" ) ).arg( con ) ); myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "VOLUMES" ) ).arg( con ) );
} }
else { else {
myInfo->append( QString( "<b>%1</b>" ).arg( tr( "FREE_NODE" ) ).arg( id ) ); myInfo->append( QString( "<b>%1</b>" ).arg( tr( "FREE_NODE" ) ).arg( id ) );
} }
} }
} }
// separator // separator
if ( ids.count() > 1 ) { if ( ids.count() > 1 ) {
myInfo->append( "" ); myInfo->append( "" );
myInfo->append( "------" ); myInfo->append( "------" );
myInfo->append( "" ); myInfo->append( "" );
} }
} }
} }
@ -937,205 +937,205 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 ); int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 );
foreach ( long id, ids ) { foreach ( long id, ids ) {
if ( !isElements() ) { if ( !isElements() ) {
// //
// show node info // show node info
// //
const SMDS_MeshElement* e = actor()->GetObject()->GetMesh()->FindNode( id ); const SMDS_MeshElement* e = actor()->GetObject()->GetMesh()->FindNode( id );
if ( !e ) return; if ( !e ) return;
const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( e ); const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( e );
// node ID // node ID
QTreeWidgetItem* nodeItem = createItem( 0, -1 ); QTreeWidgetItem* nodeItem = createItem( 0, -1 );
nodeItem->setText( 0, tr( "NODE" ) ); nodeItem->setText( 0, tr( "NODE" ) );
nodeItem->setText( 1, QString( "#%1" ).arg( id ) ); nodeItem->setText( 1, QString( "#%1" ).arg( id ) );
nodeItem->setExpanded( true ); nodeItem->setExpanded( true );
// coordinates // coordinates
QTreeWidgetItem* coordItem = createItem( nodeItem, 0 ); QTreeWidgetItem* coordItem = createItem( nodeItem, 0 );
coordItem->setText( 0, tr( "COORDINATES" ) ); coordItem->setText( 0, tr( "COORDINATES" ) );
coordItem->setExpanded( true ); coordItem->setExpanded( true );
QTreeWidgetItem* xItem = createItem( coordItem ); QTreeWidgetItem* xItem = createItem( coordItem );
xItem->setText( 0, "X" ); xItem->setText( 0, "X" );
xItem->setText( 1, QString::number( node->X(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); xItem->setText( 1, QString::number( node->X(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
QTreeWidgetItem* yItem = createItem( coordItem ); QTreeWidgetItem* yItem = createItem( coordItem );
yItem->setText( 0, "Y" ); yItem->setText( 0, "Y" );
yItem->setText( 1, QString::number( node->Y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); yItem->setText( 1, QString::number( node->Y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
QTreeWidgetItem* zItem = createItem( coordItem ); QTreeWidgetItem* zItem = createItem( coordItem );
zItem->setText( 0, "Z" ); zItem->setText( 0, "Z" );
zItem->setText( 1, QString::number( node->Z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); zItem->setText( 1, QString::number( node->Z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
// connectivity // connectivity
QTreeWidgetItem* conItem = createItem( nodeItem, 0 ); QTreeWidgetItem* conItem = createItem( nodeItem, 0 );
conItem->setText( 0, tr( "CONNECTIVITY" ) ); conItem->setText( 0, tr( "CONNECTIVITY" ) );
conItem->setExpanded( true ); conItem->setExpanded( true );
Connectivity connectivity = nodeConnectivity( node ); Connectivity connectivity = nodeConnectivity( node );
if ( !connectivity.isEmpty() ) { if ( !connectivity.isEmpty() ) {
QString con = formatConnectivity( connectivity, SMDSAbs_0DElement ); QString con = formatConnectivity( connectivity, SMDSAbs_0DElement );
if ( !con.isEmpty() ) { if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem ); QTreeWidgetItem* i = createItem( conItem );
i->setText( 0, tr( "0D_ELEMENTS" ) ); i->setText( 0, tr( "0D_ELEMENTS" ) );
i->setText( 1, con ); i->setText( 1, con );
} }
con = formatConnectivity( connectivity, SMDSAbs_Edge ); con = formatConnectivity( connectivity, SMDSAbs_Edge );
if ( !con.isEmpty() ) { if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem ); QTreeWidgetItem* i = createItem( conItem );
i->setText( 0, tr( "EDGES" ) ); i->setText( 0, tr( "EDGES" ) );
i->setText( 1, con ); i->setText( 1, con );
} }
con = formatConnectivity( connectivity, SMDSAbs_Face ); con = formatConnectivity( connectivity, SMDSAbs_Face );
if ( !con.isEmpty() ) { if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem ); QTreeWidgetItem* i = createItem( conItem );
i->setText( 0, tr( "FACES" ) ); i->setText( 0, tr( "FACES" ) );
i->setText( 1, con ); i->setText( 1, con );
} }
con = formatConnectivity( connectivity, SMDSAbs_Volume ); con = formatConnectivity( connectivity, SMDSAbs_Volume );
if ( !con.isEmpty() ) { if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem ); QTreeWidgetItem* i = createItem( conItem );
i->setText( 0, tr( "VOLUMES" ) ); i->setText( 0, tr( "VOLUMES" ) );
i->setText( 1, con ); i->setText( 1, con );
} }
} }
else { else {
conItem->setText( 1, tr( "FREE_NODE" ) ); conItem->setText( 1, tr( "FREE_NODE" ) );
} }
} }
else { else {
// //
// show element info // show element info
// //
const SMDS_MeshElement* e = actor()->GetObject()->GetMesh()->FindElement( id ); const SMDS_MeshElement* e = actor()->GetObject()->GetMesh()->FindElement( id );
if ( !e ) return; if ( !e ) return;
// element ID && type // element ID && type
QString stype; QString stype;
switch( e->GetType() ) { switch( e->GetType() ) {
case SMDSAbs_0DElement: case SMDSAbs_0DElement:
stype = tr( "0D ELEMENT" ); break; stype = tr( "0D ELEMENT" ); break;
case SMDSAbs_Edge: case SMDSAbs_Edge:
stype = tr( "EDGE" ); break; stype = tr( "EDGE" ); break;
case SMDSAbs_Face: case SMDSAbs_Face:
stype = tr( "FACE" ); break; stype = tr( "FACE" ); break;
case SMDSAbs_Volume: case SMDSAbs_Volume:
stype = tr( "VOLUME" ); break; stype = tr( "VOLUME" ); break;
default: default:
break; break;
} }
if ( stype.isEmpty() ) return; if ( stype.isEmpty() ) return;
QTreeWidgetItem* elemItem = createItem( 0, -1 ); QTreeWidgetItem* elemItem = createItem( 0, -1 );
elemItem->setText( 0, stype ); elemItem->setText( 0, stype );
elemItem->setText( 1, QString( "#%1" ).arg( id ) ); elemItem->setText( 1, QString( "#%1" ).arg( id ) );
elemItem->setExpanded( true ); elemItem->setExpanded( true );
// geometry type // geometry type
QString gtype; QString gtype;
switch( e->GetEntityType() ) { switch( e->GetEntityType() ) {
case SMDSEntity_Triangle: case SMDSEntity_Triangle:
case SMDSEntity_Quad_Triangle: case SMDSEntity_Quad_Triangle:
gtype = tr( "TRIANGLE" ); break; gtype = tr( "TRIANGLE" ); break;
case SMDSEntity_Quadrangle: case SMDSEntity_Quadrangle:
case SMDSEntity_Quad_Quadrangle: case SMDSEntity_Quad_Quadrangle:
gtype = tr( "QUADRANGLE" ); break; gtype = tr( "QUADRANGLE" ); break;
case SMDSEntity_Polygon: case SMDSEntity_Polygon:
case SMDSEntity_Quad_Polygon: case SMDSEntity_Quad_Polygon:
gtype = tr( "POLYGON" ); break; gtype = tr( "POLYGON" ); break;
case SMDSEntity_Tetra: case SMDSEntity_Tetra:
case SMDSEntity_Quad_Tetra: case SMDSEntity_Quad_Tetra:
gtype = tr( "TETRAHEDRON" ); break; gtype = tr( "TETRAHEDRON" ); break;
case SMDSEntity_Pyramid: case SMDSEntity_Pyramid:
case SMDSEntity_Quad_Pyramid: case SMDSEntity_Quad_Pyramid:
gtype = tr( "PYRAMID" ); break; gtype = tr( "PYRAMID" ); break;
case SMDSEntity_Hexa: case SMDSEntity_Hexa:
case SMDSEntity_Quad_Hexa: case SMDSEntity_Quad_Hexa:
gtype = tr( "HEXAHEDRON" ); break; gtype = tr( "HEXAHEDRON" ); break;
case SMDSEntity_Penta: case SMDSEntity_Penta:
case SMDSEntity_Quad_Penta: case SMDSEntity_Quad_Penta:
gtype = tr( "PRISM" ); break; gtype = tr( "PRISM" ); break;
case SMDSEntity_Polyhedra: case SMDSEntity_Polyhedra:
case SMDSEntity_Quad_Polyhedra: case SMDSEntity_Quad_Polyhedra:
gtype = tr( "POLYHEDRON" ); break; gtype = tr( "POLYHEDRON" ); break;
default: default:
break; break;
} }
if ( !gtype.isEmpty() ) { if ( !gtype.isEmpty() ) {
QTreeWidgetItem* typeItem = createItem( elemItem, 0 ); QTreeWidgetItem* typeItem = createItem( elemItem, 0 );
typeItem->setText( 0, tr( "TYPE" ) ); typeItem->setText( 0, tr( "TYPE" ) );
typeItem->setText( 1, gtype ); typeItem->setText( 1, gtype );
} }
// quadratic flag and gravity center (any element except 0D) // quadratic flag and gravity center (any element except 0D)
if ( e->GetEntityType() > SMDSEntity_0D && e->GetEntityType() < SMDSEntity_Last ) { if ( e->GetEntityType() > SMDSEntity_0D && e->GetEntityType() < SMDSEntity_Last ) {
// quadratic flag // quadratic flag
QTreeWidgetItem* quadItem = createItem( elemItem, 0 ); QTreeWidgetItem* quadItem = createItem( elemItem, 0 );
quadItem->setText( 0, tr( "QUADRATIC" ) ); quadItem->setText( 0, tr( "QUADRATIC" ) );
quadItem->setText( 1, e->IsQuadratic() ? tr( "YES" ) : tr( "NO" ) ); quadItem->setText( 1, e->IsQuadratic() ? tr( "YES" ) : tr( "NO" ) );
// gravity center // gravity center
XYZ gc = gravityCenter( e ); XYZ gc = gravityCenter( e );
QTreeWidgetItem* gcItem = createItem( elemItem, 0 ); QTreeWidgetItem* gcItem = createItem( elemItem, 0 );
gcItem->setText( 0, tr( "GRAVITY_CENTER" ) ); gcItem->setText( 0, tr( "GRAVITY_CENTER" ) );
gcItem->setExpanded( true ); gcItem->setExpanded( true );
QTreeWidgetItem* xItem = createItem( gcItem ); QTreeWidgetItem* xItem = createItem( gcItem );
xItem->setText( 0, "X" ); xItem->setText( 0, "X" );
xItem->setText( 1, QString::number( gc.x(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); xItem->setText( 1, QString::number( gc.x(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
QTreeWidgetItem* yItem = createItem( gcItem ); QTreeWidgetItem* yItem = createItem( gcItem );
yItem->setText( 0, "Y" ); yItem->setText( 0, "Y" );
yItem->setText( 1, QString::number( gc.y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); yItem->setText( 1, QString::number( gc.y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
QTreeWidgetItem* zItem = createItem( gcItem ); QTreeWidgetItem* zItem = createItem( gcItem );
zItem->setText( 0, "Z" ); zItem->setText( 0, "Z" );
zItem->setText( 1, QString::number( gc.z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); zItem->setText( 1, QString::number( gc.z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
} }
// connectivity // connectivity
QTreeWidgetItem* conItem = createItem( elemItem, 0 ); QTreeWidgetItem* conItem = createItem( elemItem, 0 );
conItem->setText( 0, tr( "CONNECTIVITY" ) ); conItem->setText( 0, tr( "CONNECTIVITY" ) );
conItem->setExpanded( true ); conItem->setExpanded( true );
SMDS_ElemIteratorPtr nodeIt = e->nodesIterator(); SMDS_ElemIteratorPtr nodeIt = e->nodesIterator();
for ( int idx = 1; nodeIt->more(); idx++ ) { for ( int idx = 1; nodeIt->more(); idx++ ) {
const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() ); const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
// node number and ID // node number and ID
QTreeWidgetItem* nodeItem = createItem( conItem, 0 ); QTreeWidgetItem* nodeItem = createItem( conItem, 0 );
nodeItem->setText( 0, QString( "%1 %2/%3" ).arg( tr( "NODE" ) ).arg( idx ).arg( e->NbNodes() ) ); nodeItem->setText( 0, QString( "%1 %2/%3" ).arg( tr( "NODE" ) ).arg( idx ).arg( e->NbNodes() ) );
nodeItem->setText( 1, QString( "#%1" ).arg( node->GetID() ) ); nodeItem->setText( 1, QString( "#%1" ).arg( node->GetID() ) );
//nodeItem->setExpanded( true ); //nodeItem->setExpanded( true );
// node coordinates // node coordinates
QTreeWidgetItem* coordItem = createItem( nodeItem ); QTreeWidgetItem* coordItem = createItem( nodeItem );
coordItem->setText( 0, tr( "COORDINATES" ) ); coordItem->setText( 0, tr( "COORDINATES" ) );
coordItem->setExpanded( true ); coordItem->setExpanded( true );
QTreeWidgetItem* xItem = createItem( coordItem ); QTreeWidgetItem* xItem = createItem( coordItem );
xItem->setText( 0, "X" ); xItem->setText( 0, "X" );
xItem->setText( 1, QString::number( node->X(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); xItem->setText( 1, QString::number( node->X(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
QTreeWidgetItem* yItem = createItem( coordItem ); QTreeWidgetItem* yItem = createItem( coordItem );
yItem->setText( 0, "Y" ); yItem->setText( 0, "Y" );
yItem->setText( 1, QString::number( node->Y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); yItem->setText( 1, QString::number( node->Y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
QTreeWidgetItem* zItem = createItem( coordItem ); QTreeWidgetItem* zItem = createItem( coordItem );
zItem->setText( 0, "Z" ); zItem->setText( 0, "Z" );
zItem->setText( 1, QString::number( node->Z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); zItem->setText( 1, QString::number( node->Z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
// node connectivity // node connectivity
QTreeWidgetItem* nconItem = createItem( nodeItem ); QTreeWidgetItem* nconItem = createItem( nodeItem );
nconItem->setText( 0, tr( "CONNECTIVITY" ) ); nconItem->setText( 0, tr( "CONNECTIVITY" ) );
nconItem->setExpanded( true ); nconItem->setExpanded( true );
Connectivity connectivity = nodeConnectivity( node ); Connectivity connectivity = nodeConnectivity( node );
if ( !connectivity.isEmpty() ) { if ( !connectivity.isEmpty() ) {
QString con = formatConnectivity( connectivity, SMDSAbs_0DElement ); QString con = formatConnectivity( connectivity, SMDSAbs_0DElement );
if ( !con.isEmpty() ) { if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem ); QTreeWidgetItem* i = createItem( nconItem );
i->setText( 0, tr( "0D_ELEMENTS" ) ); i->setText( 0, tr( "0D_ELEMENTS" ) );
i->setText( 1, con ); i->setText( 1, con );
} }
con = formatConnectivity( connectivity, SMDSAbs_Edge ); con = formatConnectivity( connectivity, SMDSAbs_Edge );
if ( !con.isEmpty() ) { if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem ); QTreeWidgetItem* i = createItem( nconItem );
i->setText( 0, tr( "EDGES" ) ); i->setText( 0, tr( "EDGES" ) );
i->setText( 1, con ); i->setText( 1, con );
} }
con = formatConnectivity( connectivity, SMDSAbs_Face ); con = formatConnectivity( connectivity, SMDSAbs_Face );
if ( !con.isEmpty() ) { if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem ); QTreeWidgetItem* i = createItem( nconItem );
i->setText( 0, tr( "FACES" ) ); i->setText( 0, tr( "FACES" ) );
i->setText( 1, con ); i->setText( 1, con );
} }
con = formatConnectivity( connectivity, SMDSAbs_Volume ); con = formatConnectivity( connectivity, SMDSAbs_Volume );
if ( !con.isEmpty() ) { if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem ); QTreeWidgetItem* i = createItem( nconItem );
i->setText( 0, tr( "VOLUMES" ) ); i->setText( 0, tr( "VOLUMES" ) );
i->setText( 1, con ); i->setText( 1, con );
} }
} }
} }
} }
} }
} }
@ -1290,8 +1290,8 @@ void SMESHGUI_MeshInfoDlg::showInfo( const Handle(SALOME_InteractiveObject)& IO
int nb = 0; int nb = 0;
if ( myActor && selector ) { if ( myActor && selector ) {
nb = myMode->checkedId() == NodeMode ? nb = myMode->checkedId() == NodeMode ?
SMESH::GetNameOfSelectedElements( selector, IO, ID ) : SMESH::GetNameOfSelectedElements( selector, IO, ID ) :
SMESH::GetNameOfSelectedNodes( selector, IO, ID ); SMESH::GetNameOfSelectedNodes( selector, IO, ID );
} }
myElemInfo->setSource( myActor ) ; myElemInfo->setSource( myActor ) ;
if ( nb > 0 ) { if ( nb > 0 ) {
@ -1299,7 +1299,7 @@ void SMESHGUI_MeshInfoDlg::showInfo( const Handle(SALOME_InteractiveObject)& IO
QSet<long> ids; QSet<long> ids;
QStringList idTxt = ID.split( " ", QString::SkipEmptyParts ); QStringList idTxt = ID.split( " ", QString::SkipEmptyParts );
foreach ( ID, idTxt ) foreach ( ID, idTxt )
ids << ID.trimmed().toLong(); ids << ID.trimmed().toLong();
myElemInfo->showInfo( ids, myMode->checkedId() == ElemMode ); myElemInfo->showInfo( ids, myMode->checkedId() == ElemMode );
} }
else { else {
@ -1362,12 +1362,12 @@ void SMESHGUI_MeshInfoDlg::updateSelection()
if ( myMode->checkedId() == NodeMode ) { if ( myMode->checkedId() == NodeMode ) {
SMESH::SetPointRepresentation( true ); SMESH::SetPointRepresentation( true );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() ) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )
aViewWindow->SetSelectionMode( NodeSelection ); aViewWindow->SetSelectionMode( NodeSelection );
} }
else { else {
SMESH::SetPointRepresentation( false ); SMESH::SetPointRepresentation( false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() ) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )
aViewWindow->SetSelectionMode( CellSelection ); aViewWindow->SetSelectionMode( CellSelection );
} }
} }
@ -1390,8 +1390,8 @@ void SMESHGUI_MeshInfoDlg::updateSelection()
void SMESHGUI_MeshInfoDlg::help() void SMESHGUI_MeshInfoDlg::help()
{ {
SMESH::ShowHelpFile( myTabWidget->currentIndex() == BaseInfo ? SMESH::ShowHelpFile( myTabWidget->currentIndex() == BaseInfo ?
"mesh_infos_page.html#advanced_mesh_infos_anchor" : "mesh_infos_page.html#advanced_mesh_infos_anchor" :
"mesh_infos_page.html#mesh_element_info_anchor" ); "mesh_infos_page.html#mesh_element_info_anchor" );
} }
/*! /*!
@ -1457,11 +1457,11 @@ void SMESHGUI_MeshInfoDlg::idChanged()
foreach ( QString tid, idTxt ) { foreach ( QString tid, idTxt ) {
long id = tid.trimmed().toLong(); long id = tid.trimmed().toLong();
const SMDS_MeshElement* e = myMode->checkedId() == ElemMode ? const SMDS_MeshElement* e = myMode->checkedId() == ElemMode ?
myActor->GetObject()->GetMesh()->FindElement( id ) : myActor->GetObject()->GetMesh()->FindElement( id ) :
myActor->GetObject()->GetMesh()->FindNode( id ); myActor->GetObject()->GetMesh()->FindNode( id );
if ( e ) { if ( e ) {
ID.Add( id ); ID.Add( id );
ids << id; ids << id;
} }
} }
selector->AddOrRemoveIndex( IO, ID, false ); selector->AddOrRemoveIndex( IO, ID, false );

View File

@ -1029,8 +1029,8 @@ namespace
*/ */
//================================================================================ //================================================================================
void SMESHGUI_MeshOp::createHypothesis(const int theDim, void SMESHGUI_MeshOp::createHypothesis(const int theDim,
const int theType, const int theType,
const QString& theTypeName) const QString& theTypeName)
{ {
HypothesisData* aData = SMESH::GetHypothesisData(theTypeName); HypothesisData* aData = SMESH::GetHypothesisData(theTypeName);
if (!aData) if (!aData)
@ -1089,20 +1089,29 @@ void SMESHGUI_MeshOp::createHypothesis(const int theDim,
aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh ); aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ); anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
if ( aMeshEntry != "" ) { // Get Geom object from Mesh if ( myToCreate && myIsMesh )
aMeshEntry = aGeomEntry;
if ( aMeshEntry != aGeomEntry ) { // Get Geom object from Mesh of a sub-mesh being edited
_PTR(SObject) pObj = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() ); _PTR(SObject) pObj = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj ); GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
aMeshEntry = ( aGeomVar->_is_nil() ) ? "" : aMeshEntry = aGeomVar->GetStudyEntry(); aMeshEntry = ( aGeomVar->_is_nil() ) ? "" : aMeshEntry = aGeomVar->GetStudyEntry();
} }
if ( aMeshEntry == "" && aGeomEntry == "" ) { if ( aMeshEntry == "" && aGeomEntry == "" ) { // get geom of an object being edited
_PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() ); _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj ); bool isMesh;
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj, &isMesh );
if ( !aGeomVar->_is_nil() ) if ( !aGeomVar->_is_nil() )
{
aGeomEntry = aGeomVar->GetStudyEntry(); aGeomEntry = aGeomVar->GetStudyEntry();
if ( isMesh )
aMeshEntry = aGeomEntry;
}
} }
if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) { // take geometry from submesh if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) {
// take geometry from submesh being created
_PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() ); _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
if ( pObj ) { if ( pObj ) {
// if current object is sub-mesh // if current object is sub-mesh
@ -1200,8 +1209,6 @@ void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex )
if ( aHyp->_is_nil() ) if ( aHyp->_is_nil() )
return; return;
// BUG 0020378
//SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHyp->GetName());
SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHyp->GetName()); SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHyp->GetName());
if ( aCreator ) if ( aCreator )
{ {
@ -1218,20 +1225,29 @@ void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex )
aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh ); aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ); anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
if ( aMeshEntry != "" ) { // Get Geom object from Mesh if ( myToCreate && myIsMesh )
aMeshEntry = aGeomEntry;
if ( aMeshEntry != aGeomEntry ) { // Get Geom object from Mesh of a sub-mesh being edited
_PTR(SObject) pObj = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() ); _PTR(SObject) pObj = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj ); GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
aMeshEntry = ( aGeomVar->_is_nil() ) ? "" : aMeshEntry = aGeomVar->GetStudyEntry(); aMeshEntry = ( aGeomVar->_is_nil() ) ? "" : aMeshEntry = aGeomVar->GetStudyEntry();
} }
if ( aMeshEntry == "" && aGeomEntry == "" ) { if ( aMeshEntry == "" && aGeomEntry == "" ) { // get geom of an object being edited
_PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() ); _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj ); bool isMesh;
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj, &isMesh );
if ( !aGeomVar->_is_nil() ) if ( !aGeomVar->_is_nil() )
{
aGeomEntry = aGeomVar->GetStudyEntry(); aGeomEntry = aGeomVar->GetStudyEntry();
if ( isMesh )
aMeshEntry = aGeomEntry;
}
} }
if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) { // take geometry from submesh if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) {
// take geometry from submesh being created
_PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() ); _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
if ( pObj ) { if ( pObj ) {
// if current object is sub-mesh // if current object is sub-mesh

View File

@ -94,32 +94,32 @@ namespace SMESH
_PTR(SObject) p = theParent; _PTR(SObject) p = theParent;
if ( !p ) p = aStudy->FindComponent( "SMESH" ); if ( !p ) p = aStudy->FindComponent( "SMESH" );
if ( p ) { if ( p ) {
_PTR(ChildIterator) iter = aStudy->NewChildIterator( p ); _PTR(ChildIterator) iter = aStudy->NewChildIterator( p );
int idx = 0; int idx = 0;
while( true ) { while( true ) {
bool found = false; bool found = false;
for ( ; iter->More(); iter->Next() ) { for ( ; iter->More(); iter->Next() ) {
_PTR(SObject) so = iter->Value(); _PTR(SObject) so = iter->Value();
if ( !so ) continue; // skip bad objects if ( !so ) continue; // skip bad objects
_PTR(SObject) ref; _PTR(SObject) ref;
if ( so->ReferencedObject( ref ) ) continue; // skip references if ( so->ReferencedObject( ref ) ) continue; // skip references
QString n = so->GetName().c_str(); QString n = so->GetName().c_str();
if ( !n.isEmpty() && n == name ) { if ( !n.isEmpty() && n == name ) {
QStringList names = name.split("_", QString::KeepEmptyParts); QStringList names = name.split("_", QString::KeepEmptyParts);
if ( names.count() > 0 ) { if ( names.count() > 0 ) {
bool ok; bool ok;
names.last().toInt( &ok ); names.last().toInt( &ok );
if ( ok ) if ( ok )
names.removeLast(); names.removeLast();
} }
names.append( QString::number( ++idx ) ); names.append( QString::number( ++idx ) );
name = names.join( "_" ); name = names.join( "_" );
found = true; found = true;
break; break;
} }
} }
if ( !found ) break; if ( !found ) break;
} }
} }
} }
return name; return name;

View File

@ -333,7 +333,7 @@ namespace SMESH
#endif #endif
//MESSAGE("GetVisualObj"); //MESSAGE("GetVisualObj");
if (nulData) if (nulData)
objModified = aVisualObj->NulData(); objModified = aVisualObj->NulData();
else else
objModified = aVisualObj->Update(); objModified = aVisualObj->Update();
} }
@ -640,7 +640,7 @@ namespace SMESH
void RemoveActor( SUIT_ViewWindow *theWnd, SMESH_Actor* theActor){ void RemoveActor( SUIT_ViewWindow *theWnd, SMESH_Actor* theActor){
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(theWnd)){ if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(theWnd)){
MESSAGE("RemoveActor " << theActor); MESSAGE("RemoveActor " << theActor);
vtkWnd->RemoveActor(theActor); vtkWnd->RemoveActor(theActor);
if(theActor->hasIO()){ if(theActor->hasIO()){
Handle(SALOME_InteractiveObject) anIO = theActor->getIO(); Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
@ -679,7 +679,7 @@ namespace SMESH
bool UpdateView(SUIT_ViewWindow *theWnd, EDisplaing theAction, const char* theEntry) bool UpdateView(SUIT_ViewWindow *theWnd, EDisplaing theAction, const char* theEntry)
{ {
//MESSAGE("UpdateView"); //MESSAGE("UpdateView");
bool OK = false; bool OK = false;
SVTK_ViewWindow* aViewWnd = GetVtkViewWindow(theWnd); SVTK_ViewWindow* aViewWnd = GetVtkViewWindow(theWnd);
if (!aViewWnd) if (!aViewWnd)
@ -696,7 +696,7 @@ namespace SMESH
case eDisplayAll: { case eDisplayAll: {
while (vtkActor *anAct = aCollection->GetNextActor()) { while (vtkActor *anAct = aCollection->GetNextActor()) {
if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) { if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
MESSAGE("--- display " << anActor); MESSAGE("--- display " << anActor);
anActor->SetVisibility(true); anActor->SetVisibility(true);
} }
} }
@ -704,10 +704,10 @@ namespace SMESH
} }
case eDisplayOnly: case eDisplayOnly:
case eEraseAll: { case eEraseAll: {
//MESSAGE("---case eDisplayOnly"); //MESSAGE("---case eDisplayOnly");
while (vtkActor *anAct = aCollection->GetNextActor()) { while (vtkActor *anAct = aCollection->GetNextActor()) {
if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) { if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
//MESSAGE("--- erase " << anActor); //MESSAGE("--- erase " << anActor);
anActor->SetVisibility(false); anActor->SetVisibility(false);
} }
} }
@ -717,12 +717,12 @@ namespace SMESH
switch (theAction) { switch (theAction) {
case eDisplay: case eDisplay:
case eDisplayOnly: case eDisplayOnly:
//MESSAGE("--- display " << anActor); //MESSAGE("--- display " << anActor);
anActor->SetVisibility(true); anActor->SetVisibility(true);
if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange(); if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
break; break;
case eErase: case eErase:
//MESSAGE("--- erase " << anActor); //MESSAGE("--- erase " << anActor);
anActor->SetVisibility(false); anActor->SetVisibility(false);
break; break;
} }
@ -731,7 +731,7 @@ namespace SMESH
case eDisplay: case eDisplay:
case eDisplayOnly: case eDisplayOnly:
{ {
//MESSAGE("---"); //MESSAGE("---");
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(theWnd->getViewManager()->study()); SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(theWnd->getViewManager()->study());
_PTR(Study) aDocument = aStudy->studyDS(); _PTR(Study) aDocument = aStudy->studyDS();
// Pass non-visual objects (hypotheses, etc.), return true in this case // Pass non-visual objects (hypotheses, etc.), return true in this case
@ -760,7 +760,7 @@ namespace SMESH
bool UpdateView(EDisplaing theAction, const char* theEntry){ bool UpdateView(EDisplaing theAction, const char* theEntry){
//MESSAGE("UpdateView"); //MESSAGE("UpdateView");
SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( GetActiveStudy() ); SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( GetActiveStudy() );
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( aStudy->application() ); SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( aStudy->application() );
SUIT_ViewWindow *aWnd = app->activeViewManager()->getActiveView(); SUIT_ViewWindow *aWnd = app->activeViewManager()->getActiveView();
@ -799,7 +799,7 @@ namespace SMESH
bool Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay) bool Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
{ {
MESSAGE("Update"); MESSAGE("Update");
_PTR(Study) aStudy = GetActiveStudyDocument(); _PTR(Study) aStudy = GetActiveStudyDocument();
CORBA::Long anId = aStudy->StudyId(); CORBA::Long anId = aStudy->StudyId();
if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry())) { if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry())) {
@ -812,7 +812,7 @@ namespace SMESH
bool UpdateNulData(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay) bool UpdateNulData(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
{ {
MESSAGE("UpdateNulData"); MESSAGE("UpdateNulData");
_PTR(Study) aStudy = GetActiveStudyDocument(); _PTR(Study) aStudy = GetActiveStudyDocument();
CORBA::Long anId = aStudy->StudyId(); CORBA::Long anId = aStudy->StudyId();
if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry(), true)) { if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry(), true)) {

View File

@ -93,8 +93,8 @@ Measurements_i::~Measurements_i()
} }
static bool getNodeNodeDistance (SMESH::Measure& theMeasure, static bool getNodeNodeDistance (SMESH::Measure& theMeasure,
const SMDS_MeshNode* theNode1, const SMDS_MeshNode* theNode1,
const SMDS_MeshNode* theNode2 = 0) const SMDS_MeshNode* theNode2 = 0)
{ {
double dist = 0., dd = 0.; double dist = 0., dd = 0.;