// SMESH SMESHGUI : GUI for the adaptation in the SMESH component
// File : SMESHGUI_AdaptDlg.cxx
// Author : Gerald NICOLAS, EDF
-// ADAPTGUI includes
-//
-#include "SMESHGUI_AdaptDlg.h"
+// SMESH includes
#include "SMESHGUI.h"
+#include "SMESHGUI_AdaptDlg.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_GroupUtils.h"
#include <GEOM_wrap.hxx>
// SALOME GUI includes
+#include <LightApp_SelectionMgr.h>
#include <QtxColorButton.h>
-
+#include <SALOME_ListIO.hxx>
#include <SUIT_Desktop.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
#include <SUIT_MessageBox.h>
#include <SUIT_OverrideCursor.h>
-
-#include <SalomeApp_Tools.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SVTK_ViewWindow.h>
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
-#include <LightApp_SelectionMgr.h>
-
-#include <SALOME_ListIO.hxx>
-
-#include <SVTK_ViewWindow.h>
-
+#include <SalomeApp_Tools.h>
#include <VTKViewer_Algorithm.h>
-// SALOME KERNEL includes
-#include <SALOMEDSClient_Study.hxx>
-#include <utilities.h>
-
-// VTK Includes
-#include <vtkRenderer.h>
-#include <vtkActorCollection.h>
-
-// OCCT includes
-#include <TColStd_MapOfInteger.hxx>
-
// Qt includes
#include <QButtonGroup>
#include <QGroupBox>
#include <algorithm>
#include <set>
+// VTK includes
+#include <vtkRenderer.h>
+#include <vtkActorCollection.h>
+
+// SALOME KERNEL includes
+#include <SALOMEDSClient_ClientFactory.hxx>
+#include <SALOMEDSClient_IParameters.hxx>
+#include <SALOMEDSClient_SComponent.hxx>
+#include <SALOMEDSClient_StudyBuilder.hxx>
+#include <SALOMEDS_Study.hxx>
+#include <SALOMEDS_SObject.hxx>
+#include "utilities.h"
+#include <SALOME_LifeCycleCORBA.hxx>
+
+// OCCT includes
+#include <TColStd_MapOfInteger.hxx>
+
#define SPACING 6
#define MARGIN 11
// myGeomGroupLine->setEnabled( false );
// }
}
-//=======================================================================
-// OnGUIEvent for the adaptations
-//=======================================================================
+/*!
+ * \brief Launches the GUI for the adaptation
+ * \param theCommandID - the integer taht references the operation
+ * \return Graphical object
+*/
bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID)
{
std::cout << "OnGUIEvent avec theCommandID : " << theCommandID << std::endl;
dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
if ( !app ) return false;
- SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !stud )
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
+ if ( !aStudy )
{
MESSAGE ( "FAILED to cast active study to SalomeApp_Study" );
return false;
SUIT_Desktop* parent = SUIT_Session::session()->activeApplication()->desktop();
-// ADAPT::ADAPT_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app);
-//
-// if (!CORBA::is_nil(homardGen))
-// homardGen->UpdateStudy();
-//
+ SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA(app->namingService());
+ Engines::EngineComponent_var comp =
+ ls->FindOrLoad_Component("FactoryServer", "SMESH");
+ ADAPT::ADAPT_Gen_var homardGen = ADAPT::ADAPT_Gen::_narrow(comp);
+ if (!CORBA::is_nil(homardGen))
+ homardGen->UpdateStudy();
+
SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser();
//
// B. Choix selon les commandes
int theCommandID,
SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
~SMESHGUI_AdaptDlg();
-
+
virtual bool OnGUIEvent (int theCommandID);
static QString GetDefaultName( const QString& );
-
+
public slots:
void onAdd();
void onRemove();
void onTypeChanged( int );
void onGrpTypeChanged( int );
void onColorChanged( QColor );
-
+
void onOK();
bool onApply();
void onHelp();
void onDeactivate();
void onVisibilityChanged();
-
+
void onListSelectionChanged();
void onObjectSelectionChanged();
-
+
void onSelectAll();
void onSelectSubMesh( bool );
void onSelectGroup( bool );
void onSelectGeomGroup( bool );
void setCurrentSelection();
-
+
void setFilters();
void onSort();
-
+
void onNameChanged( const QString& );
void onFilterAccepted();
-
+
void onGeomPopup( QAction* );
void onGeomSelectionButton( bool );
-
+
void onPublishShapeByMeshDlg( SUIT_Operation* );
void onCloseShapeByMeshDlg( SUIT_Operation* );
void restoreShowEntityMode();
bool IsActorVisible( SMESH_Actor* );
-
+
void setGroupColor( const SALOMEDS::Color& );
SALOMEDS::Color getGroupColor() const;
-
+
void setGroupQColor( const QColor& );
QColor getGroupQColor() const;
void setDefaultName() const;
int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
QLineEdit* myCurrentLineEdit; /* Current LineEdit */
SVTK_Selector* mySelector;
-
+
QPushButton* myMeshGroupBtn;
QLineEdit* myMeshGroupLine;
-
+
QButtonGroup* myTypeGroup;
QLineEdit* myName;
QString myOldName;
-
+
QButtonGroup* myGrpTypeGroup;
-
+
QStackedWidget* myWGStack;
QCheckBox* mySelectAll;
QCheckBox* myAllowElemsModif;
QPushButton* myAddBtn;
QPushButton* myRemoveBtn;
QPushButton* mySortBtn;
-
+
QGroupBox* mySelectBox;
QCheckBox* mySelectSubMesh;
QPushButton* mySubMeshBtn;
QCheckBox* mySelectGroup;
QPushButton* myGroupBtn;
QLineEdit* myGroupLine;
-
+
QtxColorButton* myColorBtn;
-
+
QCheckBox* mySelectGeomGroup;
QToolButton* myGeomGroupBtn;
QLineEdit* myGeomGroupLine;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QPushButton* myHelpBtn;
-
+
SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
-
+
SMESH::SMESH_Mesh_var myMesh;
QList<SMESH_Actor*> myActorsList;
SMESH::SMESH_Group_var myGroup;
SMESH::Filter_var myFilter;
QList<int> myIdList;
GEOM::ListOfGO_var myGeomObjects;
-
+
int mySelectionMode;
//Handle(SMESH_TypeFilter) myMeshFilter;
//Handle(SMESH_TypeFilter) mySubMeshFilter;
SMESH_LogicalFilter* mySubMeshFilter;
SMESH_LogicalFilter* myGroupFilter;
SUIT_SelectionFilter* myGeomFilter;
-
+
SMESHGUI_FilterDlg* myFilterDlg;
-
+
bool myCreate, myIsBusy;
-
+
QString myHelpFileName;
-
+
QMap<QAction*, int> myActions;
bool myNameChanged; //added by skl for IPAL19574