Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef SMESHGUI_SELECTIONOP_H
00027 #define SMESHGUI_SELECTIONOP_H
00028
00029
00030 #include "SMESH_SMESHGUI.hxx"
00031
00032 #include "SMESHGUI_Operation.h"
00033 #include "SMESHGUI_Dialog.h"
00034
00035
00036 #include <SVTK_Selection.h>
00037 #include <SALOME_InteractiveObject.hxx>
00038
00039
00040 #include <SALOMEconfig.h>
00041 #include CORBA_SERVER_HEADER(SMESH_Mesh)
00042
00043 class SUIT_SelectionFilter;
00044 class TColStd_MapOfInteger;
00045 class SVTK_ViewWindow;
00046 class SVTK_Selector;
00047 class SMESH_Actor;
00048
00049
00050
00051
00052
00053
00054 class SMESHGUI_EXPORT SMESHGUI_SelectionOp : public SMESHGUI_Operation
00055 {
00056 Q_OBJECT
00057
00058 public:
00059 typedef QList<int> IdList;
00060
00061 public:
00062 SMESHGUI_SelectionOp( const Selection_Mode = ActorSelection );
00063 virtual ~SMESHGUI_SelectionOp();
00064
00065 static void extractIds( const QStringList&, IdList&, const QChar );
00066
00067 protected:
00068 typedef enum
00069 {
00070 Object,
00071 MeshNode,
00072 MeshElement
00073
00074 } EntityType;
00080 protected:
00081 virtual void startOperation();
00082 virtual void commitOperation();
00083 virtual void abortOperation();
00084 virtual void selectionDone();
00085
00087 virtual void initDialog();
00088
00094 virtual SUIT_SelectionFilter* createFilter( const int ) const;
00095
00097 void removeCustomFilters();
00098
00100 Selection_Mode selectionMode() const;
00101
00103 void setSelectionMode( const Selection_Mode );
00104
00106 void highlight( const Handle( SALOME_InteractiveObject )&,
00107 const bool, const bool = true );
00108
00110 void addOrRemoveIndex( const Handle( SALOME_InteractiveObject )&,
00111 const TColStd_MapOfInteger&, const bool isModeShift);
00112
00113 SVTK_ViewWindow* viewWindow() const;
00114 SVTK_Selector* selector() const;
00115
00117 virtual void selected( QStringList&,
00118 SMESHGUI_Dialog::TypesList&, QStringList& ) const;
00119
00121 virtual int typeById( const QString&, const EntityType ) const;
00122
00124 virtual QChar idChar() const;
00125
00127 void selectedIds( const int, IdList& ) const;
00128
00130 void extractIds( const QStringList&, IdList& ) const;
00131
00133 SMESH::SMESH_Mesh_var mesh() const;
00134
00136 SMESH_Actor* actor() const;
00137
00138 protected slots:
00140 virtual void onActivateObject( int );
00141
00143 virtual void onDeactivateObject( int );
00144
00149 virtual void onSelectionChanged( int );
00150
00158 virtual void onTextChanged( int, const QStringList& );
00159
00160 private:
00161 typedef QMap<int, SUIT_SelectionFilter*> Filters;
00162
00163 private:
00164 Filters myFilters;
00165 Selection_Mode myDefSelectionMode, myOldSelectionMode;
00166 };
00167
00168 #endif // SMESHGUI_SELECTIONOP_H