X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_AddMeshElementDlg.cxx;h=bccdc505e9f25ced76a8a5b1c5596bed3d505547;hb=90f96fce551a8330199884e60129dfcc4e4ed065;hp=1267a44ce7c57511ae7efc4901a2f80554be314d;hpb=d303154d91eb916a55ac93a372cbdb918aa18d14;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index 1267a44ce..bccdc505e 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -34,6 +34,7 @@ #include #include +#include #include // SALOME GUI inclues @@ -59,6 +60,7 @@ #include #include #include +#include #include // Qt includes @@ -70,9 +72,10 @@ #include #include #include -#include +#include #include #include +#include #define SPACING 6 #define MARGIN 11 @@ -89,6 +92,10 @@ namespace SMESH vtkDataSetMapper* myMapper; vtkUnstructuredGrid* myGrid; + SALOME_Actor* myFaceOrientation; + vtkPolyDataMapper* myFaceOrientationDataMapper; + SMESH_FaceOrientationFilter* myFaceOrientationFilter; + public: TElementSimulation (SalomeApp_Application* theApplication) { @@ -123,6 +130,26 @@ namespace SMESH aBackProp->Delete(); myVTKViewWindow->AddActor(myPreviewActor); + + // Orientation of faces + myFaceOrientationFilter = SMESH_FaceOrientationFilter::New(); + myFaceOrientationFilter->SetInput(myGrid); + + myFaceOrientationDataMapper = vtkPolyDataMapper::New(); + myFaceOrientationDataMapper->SetInput(myFaceOrientationFilter->GetOutput()); + + myFaceOrientation = SALOME_Actor::New(); + myFaceOrientation->PickableOff(); + myFaceOrientation->VisibilityOff(); + myFaceOrientation->SetMapper(myFaceOrientationDataMapper); + + vtkProperty* anOrientationProp = vtkProperty::New(); + GetColor( "SMESH", "orientation_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) ); + anOrientationProp->SetColor( anRGB[0], anRGB[1], anRGB[2] ); + myFaceOrientation->SetProperty( anOrientationProp ); + anOrientationProp->Delete(); + + myVTKViewWindow->AddActor(myFaceOrientation); } typedef std::vector TVTKIds; @@ -170,13 +197,14 @@ namespace SMESH myGrid->Modified(); - SetVisibility(true); + SetVisibility(true, theActor->GetFacesOriented()); } - void SetVisibility (bool theVisibility) + void SetVisibility (bool theVisibility, bool theShowOrientation = false) { myPreviewActor->SetVisibility(theVisibility); + myFaceOrientation->SetVisibility(theShowOrientation); RepaintCurrentView(); } @@ -185,12 +213,19 @@ namespace SMESH { if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) { myVTKViewWindow->RemoveActor(myPreviewActor); + myVTKViewWindow->RemoveActor(myFaceOrientation); } myPreviewActor->Delete(); + myFaceOrientation->Delete(); myMapper->RemoveAllInputs(); myMapper->Delete(); + myFaceOrientationFilter->Delete(); + + myFaceOrientationDataMapper->RemoveAllInputs(); + myFaceOrientationDataMapper->Delete(); + myGrid->Delete(); } }; @@ -281,6 +316,7 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule, /***************************************************************/ GroupConstructors = new QGroupBox(buttonGrTitle, this); + QButtonGroup* ButtonGroup = new QButtonGroup(this); QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors); GroupConstructorsLayout->setSpacing(SPACING); GroupConstructorsLayout->setMargin(MARGIN); @@ -290,7 +326,7 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule, Constructor1->setChecked(true); GroupConstructorsLayout->addWidget(Constructor1); - GroupConstructorsLayout->addStretch(); + ButtonGroup->addButton( Constructor1, 0 ); /***************************************************************/ GroupC1 = new QGroupBox(grBoxTitle, this); @@ -319,7 +355,7 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule, GroupButtonsLayout->setSpacing(SPACING); GroupButtonsLayout->setMargin(MARGIN); - buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons); + buttonOk = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), GroupButtons); buttonOk->setAutoDefault(true); buttonOk->setDefault(true); buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);