Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new names of preferences
[modules/smesh.git]
/
src
/
SMESHGUI
/
SMESHGUI_MeshPatternDlg.cxx
diff --git
a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
index 047781d20f51bdc54ba957e3fe3f71854d659a37..f040d82a14c2c26aac834714173a6aa1c7a12c60 100755
(executable)
--- a/
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
+++ b/
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
@@
-110,9
+110,7
@@
SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI* theModule,
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
myBusy(false),
mySMESHGUI( theModule ),
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
myBusy(false),
mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
- myViewWindow( SMESH::GetViewWindow( theModule ) ),
- mySelector( myViewWindow->GetSelector() )
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
setCaption(tr("CAPTION"));
{
setCaption(tr("CAPTION"));
@@
-127,6
+125,9
@@
SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI* theModule,
aDlgLay->setStretchFactor(aMainFrame, 1);
myCreationDlg = 0;
aDlgLay->setStretchFactor(aMainFrame, 1);
myCreationDlg = 0;
+
+ mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
Init();
}
Init();
}
@@
-415,9
+416,7
@@
bool SMESHGUI_MeshPatternDlg::onApply()
if ( myPattern->MakeMesh( myMesh, toCreatePolygons, toCreatePolyedrs ) ) {
mySelectionMgr->clearSelected();
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
if ( myPattern->MakeMesh( myMesh, toCreatePolygons, toCreatePolyedrs ) ) {
mySelectionMgr->clearSelected();
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
- bool autoUpdate = false;
- if (mgr && mgr->stringValue("SMESH", "AutomaticUpdate").compare("true") == 0)
- autoUpdate = true;
+ bool autoUpdate = SMESHGUI::automaticUpdate();
if (!isRefine() && autoUpdate) {
_PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
if (!isRefine() && autoUpdate) {
_PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
@@
-464,7
+463,8
@@
void SMESHGUI_MeshPatternDlg::onClose()
{
mySelectionMgr->clearFilters();
SMESH::SetPickable();
{
mySelectionMgr->clearFilters();
SMESH::SetPickable();
- myViewWindow->SetSelectionMode(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState();
disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState();
@@
-516,6
+516,8
@@
void SMESHGUI_MeshPatternDlg::onSelectionDone()
} else if (mySelInput == Ids) {
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
} else if (mySelInput == Ids) {
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
+ if (aList.Extent() != 1)
+ return;
QString anIds;
if (!SMESH::GetNameOfSelectedElements(mySelector, aList.First(), anIds))
QString anIds;
if (!SMESH::GetNameOfSelectedElements(mySelector, aList.First(), anIds))
@@
-853,7
+855,7
@@
void SMESHGUI_MeshPatternDlg::displayPreview()
aProp->SetRepresentationToWireframe();
aProp->SetColor(250, 0, 250);
if (SMESH::FindActorByObject(myMesh))
aProp->SetRepresentationToWireframe();
aProp->SetColor(250, 0, 250);
if (SMESH::FindActorByObject(myMesh))
- aProp->SetLineWidth(
SMESH::GetFloat("SMESH:SettingsWidth", 1) +1
);
+ aProp->SetLineWidth(
SMESH::GetFloat( "SMESH:element_width", 1 ) + 1
);
else
aProp->SetLineWidth(1);
myPreviewActor->SetProperty(aProp);
else
aProp->SetLineWidth(1);
myPreviewActor->SetProperty(aProp);
@@
-963,14
+965,21
@@
void SMESHGUI_MeshPatternDlg::activateSelection()
SMESH::SetPickable(anActor);
if (myType == Type_2d)
SMESH::SetPickable(anActor);
if (myType == Type_2d)
- myViewWindow->SetSelectionMode(FaceSelection);
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ }
else
else
- myViewWindow->SetSelectionMode(CellSelection);
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(CellSelection);
+ }
}
else {
SMESH::SetPickable();
//mySelectionMgr->setSelectionModes(ActorSelection);
}
else {
SMESH::SetPickable();
//mySelectionMgr->setSelectionModes(ActorSelection);
- myViewWindow->SetSelectionMode(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
}
if (mySelInput == Object && !myMeshShape->_is_nil()) {
}
if (mySelInput == Object && !myMeshShape->_is_nil()) {
@@
-1265,7
+1274,8
@@
void SMESHGUI_MeshPatternDlg::onTextChanged (const QString& theNewText)
newIndices.Add(e->GetID());
}
mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
newIndices.Add(e->GetID());
}
mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
- myViewWindow->highlight( anActor->getIO(), true, true );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( anActor->getIO(), true, true );
}
myBusy = false;
}
myBusy = false;