Version: 8.3.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)
 
int AssociateViewToWindow (QGraphicsView *gView, QxScene_ViewWindow *viewWindow)
 
int activeStudyId ()
 
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 ( const char *  name)

Definition at line 41 of file SalomeWrap_Module.cxx.

References _mapOfViewWindow.

42  :
43  SalomeApp_Module( name )
44 {
45  _mapOfViewWindow.clear();
}

Member Function Documentation

int SalomeWrap_Module::activeStudyId ( )

Definition at line 82 of file SalomeWrap_Module.cxx.

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

83 {
84  return getApp()->activeStudy()->id();
85 }
int SalomeWrap_Module::AssociateViewToWindow ( QGraphicsView gView,
QxScene_ViewWindow *  viewWindow 
)

Definition at line 74 of file SalomeWrap_Module.cxx.

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

76 {
77  viewWindow->setSceneView(gView);
78  viewWindow->setCentralWidget(gView);
79  return viewWindow->getViewManager()->study()->id();
80 }
CAM_DataModel * SalomeWrap_Module::createDataModel ( )
protectedvirtual

Reimplemented in Yacsgui.

Definition at line 220 of file SalomeWrap_Module.cxx.

221 {
222  return new SalomeWrap_DataModel(this);
223 }
SalomeWrap_DataModel * SalomeWrap_Module::getDataModel ( )
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.

References _mapOfViewWindow, and YASSERT.

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

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 }
QDockWidget * SalomeWrap_Module::objectBrowser ( )

Definition at line 87 of file SalomeWrap_Module.cxx.

References gui.logview::w.

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

87  {
88  if ( !getApp()->objectBrowser() )
89  return 0;
90 
91  QWidget* wid = getApp()->objectBrowser()->treeView();
92 
93  if ( !wid ) {
94  return 0;
95  };
96 
97  QDockWidget* dock = 0;
98  QWidget* w = wid->parentWidget();
99  while ( w && !dock ) {
100  dock = ::qobject_cast<QDockWidget*>( w );
101  w = w->parentWidget();
102  };
103 
104  return dock;
105 }
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 108 of file SalomeWrap_Module.cxx.

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

118 {
119  return createAction(id, toolTip, icon, menu, status, shortCut,
120  parent, checkable, receiver, member);
121 }
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 123 of file SalomeWrap_Module.cxx.

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

128 {
129  return createMenu(subMenu, parentMenuId, menuId, groupId, index);
130 }
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 132 of file SalomeWrap_Module.cxx.

137 {
138  return createMenu(subMenu, parentMenu, menuId, groupId, index);
139 }
int SalomeWrap_Module::wCreateMenu ( const int  actionId,
const int  menuId,
const int  groupId = -1,
const int  index = -1 
)

Definition at line 141 of file SalomeWrap_Module.cxx.

145 {
146  return createMenu(actionId, menuId, groupId, index);
147 }
int SalomeWrap_Module::wCreateMenu ( const int  actionId,
const QString &  menu,
const int  groupId = -1,
const int  index = -1 
)

Definition at line 149 of file SalomeWrap_Module.cxx.

153 {
154  return createMenu(actionId, menu, groupId, index);
155 }
int SalomeWrap_Module::wCreateMenu ( QAction *  action,
const int  menuId,
const int  actionId = -1,
const int  groupId = -1,
const int  index = -1 
)

Definition at line 157 of file SalomeWrap_Module.cxx.

162 {
163  return createMenu(action, menuId, actionId, groupId, index);
164 }
int SalomeWrap_Module::wCreateMenu ( QAction *  action,
const QString &  menu,
const int  actionId = -1,
const int  groupId = -1,
const int  index = -1 
)

Definition at line 166 of file SalomeWrap_Module.cxx.

171 {
172  return createMenu(action, menu, actionId, groupId, index);
173 }
int SalomeWrap_Module::wCreateTool ( const QString &  title,
const QString &  name = QString() 
)

Definition at line 175 of file SalomeWrap_Module.cxx.

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

176 {
177  return createTool(title, name);
178 }
int SalomeWrap_Module::wCreateTool ( const int  actionId,
const int  toolbarId,
const int  index = -1 
)

Definition at line 180 of file SalomeWrap_Module.cxx.

183 {
184  return createTool(actionId, toolbarId, index);
185 }
int SalomeWrap_Module::wCreateTool ( const int  actionId,
const QString &  toolbar,
const int  index = -1 
)

Definition at line 187 of file SalomeWrap_Module.cxx.

190 {
191  return createTool(actionId, toolbar, index);
192 }
int SalomeWrap_Module::wCreateTool ( QAction *  action,
const int  toolbarId,
const int  actionId = -1,
const int  index = -1 
)

Definition at line 194 of file SalomeWrap_Module.cxx.

198 {
199  return createTool(action, toolbarId, actionId, index);
200 }
int SalomeWrap_Module::wCreateTool ( QAction *  action,
const QString &  toolbar,
const int  actionId = -1,
const int  index = -1 
)

Definition at line 202 of file SalomeWrap_Module.cxx.

206 {
207  return createTool(action, toolbar, actionId, index);
208 }
QAction * SalomeWrap_Module::wSeparator ( )
static

Definition at line 210 of file SalomeWrap_Module.cxx.

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

211 {
212  return separator();
213 }

Member Data Documentation

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

Definition at line 128 of file SalomeWrap_Module.hxx.

Referenced by getNewWindow(), and SalomeWrap_Module().


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