Version: 9.16.0
SalomeWrap_Module Class Reference

#include <SalomeWrap_Module.hxx>

Inheritance diagram for SalomeWrap_Module:
Collaboration diagram for SalomeWrap_Module:

Public Member Functions

 SalomeWrap_Module (const char *name)
 
QxScene_ViewWindow * getNewWindow (QGraphicsScene *scene)
 
void AssociateViewToWindow (QGraphicsView *gView, QxScene_ViewWindow *viewWindow)
 
QDockWidget * objectBrowser ()
 
QAction * wCreateAction (const int id, const QString &toolTip, const QIcon &icon, const QString &menu, const QString &status, const int shortCut, QObject *parent=0, bool checkable=false, QObject *receiver=0, const char *member=0)
 
int wCreateMenu (const QString &subMenu, const int parentMenuId, const int menuId=-1, const int groupId=-1, const int index=-1)
 
int wCreateMenu (const QString &subMenu, const QString &parentMenu, const int menuId=-1, const int groupId=-1, const int index=-1)
 
int wCreateMenu (const int actionId, const int menuId, const int groupId=-1, const int index=-1)
 
int wCreateMenu (const int actionId, const QString &menu, const int groupId=-1, const int index=-1)
 
int wCreateMenu (QAction *action, const int menuId, const int actionId=-1, const int groupId=-1, const int index=-1)
 
int wCreateMenu (QAction *action, const QString &menu, const int actionId=-1, const int groupId=-1, const int index=-1)
 
int wCreateTool (const QString &title, const QString &name=QString())
 
int wCreateTool (const int actionId, const int toolbarId, const int index=-1)
 
int wCreateTool (const int actionId, const QString &toolbar, const int index=-1)
 
int wCreateTool (QAction *action, const int toolbarId, const int actionId=-1, const int index=-1)
 
int wCreateTool (QAction *action, const QString &toolbar, const int actionId=-1, const int index=-1)
 
SalomeWrap_DataModelgetDataModel ()
 

Static Public Member Functions

static QAction * wSeparator ()
 

Protected Member Functions

virtual CAM_DataModel * createDataModel ()
 

Protected Attributes

std::map< QGraphicsScene *, QxScene_ViewWindow * > _mapOfViewWindow
 

Detailed Description

Definition at line 39 of file SalomeWrap_Module.hxx.

Constructor & Destructor Documentation

◆ SalomeWrap_Module()

SalomeWrap_Module::SalomeWrap_Module ( const char *  name)

Definition at line 41 of file SalomeWrap_Module.cxx.

41 :
42 SalomeApp_Module( name )
43{
44 _mapOfViewWindow.clear();
45}
std::map< QGraphicsScene *, QxScene_ViewWindow * > _mapOfViewWindow

References _mapOfViewWindow.

Member Function Documentation

◆ AssociateViewToWindow()

void SalomeWrap_Module::AssociateViewToWindow ( QGraphicsView gView,
QxScene_ViewWindow *  viewWindow 
)

Definition at line 74 of file SalomeWrap_Module.cxx.

76{
77 viewWindow->setSceneView(gView);
78 viewWindow->setCentralWidget(gView);
79}

Referenced by YACS::HMI::SuitWrapper::AssociateViewToWindow().

◆ createDataModel()

CAM_DataModel * SalomeWrap_Module::createDataModel ( )
protectedvirtual

Reimplemented in Yacsgui.

Definition at line 214 of file SalomeWrap_Module.cxx.

215{
216 return new SalomeWrap_DataModel(this);
217}

◆ getDataModel()

SalomeWrap_DataModel * SalomeWrap_Module::getDataModel ( )

◆ getNewWindow()

QxScene_ViewWindow * SalomeWrap_Module::getNewWindow ( QGraphicsScene scene)

create a new QxScene_ViewWindow unless the active view is an empty QxScene_ViewWindow automatically created when SALOME module is loaded.

Definition at line 50 of file SalomeWrap_Module.cxx.

51{
52 SUIT_ViewManager *svm = 0;
53 if (_mapOfViewWindow.empty()) // --- reuse already created view manager
54 svm = getApp()->getViewManager(QxScene_Viewer::Type(), true);
55 else
56 svm = getApp()->createViewManager(QxScene_Viewer::Type());
57 SUIT_ViewWindow* svw = svm->getActiveView();
58 QxScene_ViewWindow *aView = 0;
59 QGraphicsScene* existingScene = 0;
60 if (!svw) svw = svm->createViewWindow();
61 if (svw) aView = dynamic_cast<QxScene_ViewWindow*>(svw);
62 if (aView) existingScene = aView->getScene();
63 if (existingScene)
64 {
65 svw = svm->createViewWindow();
66 if (svw) aView = dynamic_cast<QxScene_ViewWindow*>(svw);
67 }
68 YASSERT(aView);
69 aView->setScene(scene);
70 _mapOfViewWindow[scene] = aView;
71 return aView;
72}
#define YASSERT(val)
YASSERT macro is always defined, used like assert, but throw a YACS::Exception instead of abort.
Definition: YacsTrace.hxx:59

References _mapOfViewWindow, and YASSERT.

Referenced by YACS::HMI::SuitWrapper::getNewWindow().

◆ objectBrowser()

QDockWidget * SalomeWrap_Module::objectBrowser ( )

Definition at line 81 of file SalomeWrap_Module.cxx.

81 {
82 if ( !getApp()->objectBrowser() )
83 return 0;
84
85 QWidget* wid = getApp()->objectBrowser()->treeView();
86
87 if ( !wid ) {
88 return 0;
89 };
90
91 QDockWidget* dock = 0;
92 QWidget* w = wid->parentWidget();
93 while ( w && !dock ) {
94 dock = ::qobject_cast<QDockWidget*>( w );
95 w = w->parentWidget();
96 };
97
98 return dock;
99}
QDockWidget * objectBrowser()

References objectBrowser(), and gui.logview::w.

Referenced by objectBrowser(), and YACS::HMI::SuitWrapper::objectBrowser().

◆ wCreateAction()

QAction * SalomeWrap_Module::wCreateAction ( const int  id,
const QString &  toolTip,
const QIcon &  icon,
const QString &  menu,
const QString &  status,
const int  shortCut,
QObject parent = 0,
bool  checkable = false,
QObject receiver = 0,
const char *  member = 0 
)

Definition at line 102 of file SalomeWrap_Module.cxx.

112{
113 return createAction(id, toolTip, icon, menu, status, shortCut,
114 parent, checkable, receiver, member);
115}

Referenced by YACS::HMI::SuitWrapper::createAction().

◆ wCreateMenu() [1/6]

int SalomeWrap_Module::wCreateMenu ( const int  actionId,
const int  menuId,
const int  groupId = -1,
const int  index = -1 
)

Definition at line 135 of file SalomeWrap_Module.cxx.

139{
140 return createMenu(actionId, menuId, groupId, index);
141}

◆ wCreateMenu() [2/6]

int SalomeWrap_Module::wCreateMenu ( const int  actionId,
const QString &  menu,
const int  groupId = -1,
const int  index = -1 
)

Definition at line 143 of file SalomeWrap_Module.cxx.

147{
148 return createMenu(actionId, menu, groupId, index);
149}

◆ wCreateMenu() [3/6]

int SalomeWrap_Module::wCreateMenu ( const QString &  subMenu,
const int  parentMenuId,
const int  menuId = -1,
const int  groupId = -1,
const int  index = -1 
)

Definition at line 117 of file SalomeWrap_Module.cxx.

122{
123 return createMenu(subMenu, parentMenuId, menuId, groupId, index);
124}

Referenced by YACS::HMI::SuitWrapper::createMenu().

◆ wCreateMenu() [4/6]

int SalomeWrap_Module::wCreateMenu ( const QString &  subMenu,
const QString &  parentMenu,
const int  menuId = -1,
const int  groupId = -1,
const int  index = -1 
)

Definition at line 126 of file SalomeWrap_Module.cxx.

131{
132 return createMenu(subMenu, parentMenu, menuId, groupId, index);
133}

◆ wCreateMenu() [5/6]

int SalomeWrap_Module::wCreateMenu ( QAction *  action,
const int  menuId,
const int  actionId = -1,
const int  groupId = -1,
const int  index = -1 
)

Definition at line 151 of file SalomeWrap_Module.cxx.

156{
157 return createMenu(action, menuId, actionId, groupId, index);
158}

◆ wCreateMenu() [6/6]

int SalomeWrap_Module::wCreateMenu ( QAction *  action,
const QString &  menu,
const int  actionId = -1,
const int  groupId = -1,
const int  index = -1 
)

Definition at line 160 of file SalomeWrap_Module.cxx.

165{
166 return createMenu(action, menu, actionId, groupId, index);
167}

◆ wCreateTool() [1/5]

int SalomeWrap_Module::wCreateTool ( const int  actionId,
const int  toolbarId,
const int  index = -1 
)

Definition at line 174 of file SalomeWrap_Module.cxx.

177{
178 return createTool(actionId, toolbarId, index);
179}

◆ wCreateTool() [2/5]

int SalomeWrap_Module::wCreateTool ( const int  actionId,
const QString &  toolbar,
const int  index = -1 
)

Definition at line 181 of file SalomeWrap_Module.cxx.

184{
185 return createTool(actionId, toolbar, index);
186}

◆ wCreateTool() [3/5]

int SalomeWrap_Module::wCreateTool ( const QString &  title,
const QString &  name = QString() 
)

Definition at line 169 of file SalomeWrap_Module.cxx.

170{
171 return createTool(title, name);
172}

Referenced by YACS::HMI::SuitWrapper::createTool().

◆ wCreateTool() [4/5]

int SalomeWrap_Module::wCreateTool ( QAction *  action,
const int  toolbarId,
const int  actionId = -1,
const int  index = -1 
)

Definition at line 188 of file SalomeWrap_Module.cxx.

192{
193 return createTool(action, toolbarId, actionId, index);
194}

◆ wCreateTool() [5/5]

int SalomeWrap_Module::wCreateTool ( QAction *  action,
const QString &  toolbar,
const int  actionId = -1,
const int  index = -1 
)

Definition at line 196 of file SalomeWrap_Module.cxx.

200{
201 return createTool(action, toolbar, actionId, index);
202}

◆ wSeparator()

QAction * SalomeWrap_Module::wSeparator ( )
static

Definition at line 204 of file SalomeWrap_Module.cxx.

205{
206 return separator();
207}

Referenced by YACS::HMI::SuitWrapper::separator().

Member Data Documentation

◆ _mapOfViewWindow

std::map<QGraphicsScene*, QxScene_ViewWindow*> SalomeWrap_Module::_mapOfViewWindow
protected

Definition at line 126 of file SalomeWrap_Module.hxx.

Referenced by getNewWindow(), and SalomeWrap_Module().


The documentation for this class was generated from the following files: