Version: 9.15.0
YACS::HMI::SuitWrapper Class Reference

viewer QGraphicsScene: deriver SUIT_ViewModel comme QxGraph_Viewer More...

#include <SuitWrapper.hxx>

Collaboration diagram for YACS::HMI::SuitWrapper:

Public Member Functions

 SuitWrapper (QObject *wrapped)
 
virtual ~SuitWrapper ()
 
QWidgetgetNewWindow (QGraphicsScene *scene)
 
void AssociateViewToWindow (QGraphicsView *gView, QWidget *viewWindow)
 
QDockWidget * objectBrowser ()
 
QAction * createAction (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 createMenu (const QString &subMenu, const int parentMenuId, const int menuId=-1, const int groupId=-1, const int index=-1)
 
int createMenu (const QString &subMenu, const QString &parentMenu, const int menuId=-1, const int groupId=-1, const int index=-1)
 
int createMenu (const int actionId, const int menuId, const int groupId=-1, const int index=-1)
 
int createMenu (const int actionId, const QString &menu, const int groupId=-1, const int index=-1)
 
int createMenu (QAction *action, const int menuId, const int actionId=-1, const int groupId=-1, const int index=-1)
 
int createMenu (QAction *action, const QString &menu, const int actionId=-1, const int groupId=-1, const int index=-1)
 
int createTool (const QString &title, const QString &name=QString())
 
int createTool (const int actionId, const int toolbarId, const int index=-1)
 
int createTool (const int actionId, const QString &toolbar, const int index=-1)
 
int createTool (QAction *action, const int toolbarId, const int actionId=-1, const int index=-1)
 
int createTool (QAction *action, const QString &toolbar, const int actionId=-1, const int index=-1)
 
void setMenuShown (QAction *act, bool show)
 
void setToolShown (QAction *act, bool show)
 
void createNewSchema (const QString &schemaName, QWidget *viewWindow)
 
bool renameSchema (const QString &oldName, const QString &newName, QWidget *viewWindow)
 
bool deleteSchema (QWidget *viewWindow)
 
void createNewRun (const QString &schemaName, const QString &runName, QWidget *refWindow, QWidget *viewWindow)
 
QStringList getQuickDirList ()
 
virtual void onHelpContextModule (const QString &, const QString &, const QString &=QString())
 

Static Public Member Functions

static QAction * separator ()
 

Protected Attributes

QObject_wrapped
 

Detailed Description

viewer QGraphicsScene: deriver SUIT_ViewModel comme QxGraph_Viewer

wrapping for SalomeApp_Module

Definition at line 42 of file SuitWrapper.hxx.

Constructor & Destructor Documentation

◆ SuitWrapper()

SuitWrapper::SuitWrapper ( QObject wrapped)

Definition at line 49 of file SuitWrapper.cxx.

49  : _wrapped(wrapped)
50 {
51 }

◆ ~SuitWrapper()

SuitWrapper::~SuitWrapper ( )
virtual

Definition at line 53 of file SuitWrapper.cxx.

54 {
55 }

Member Function Documentation

◆ AssociateViewToWindow()

void SuitWrapper::AssociateViewToWindow ( QGraphicsView gView,
QWidget viewWindow 
)

Definition at line 63 of file SuitWrapper.cxx.

64 {
65  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
66  QxScene_ViewWindow *svw = dynamic_cast<QxScene_ViewWindow*>(viewWindow);
67  YASSERT(svw);
68  module->AssociateViewToWindow(gView, svw);
69  WrapGraphicsView* wgv = dynamic_cast<WrapGraphicsView*>(gView);
70  YASSERT(wgv);
71  QObject::disconnect(svw->toolMgr()->action(QxScene_ViewWindow::FitAllId),
72  SIGNAL(triggered(bool)),
73  svw, SLOT(onViewFitAll()));
74  QObject::connect(svw->toolMgr()->action(QxScene_ViewWindow::FitAllId),
75  SIGNAL(triggered(bool)),
76  wgv, SLOT(onViewFitAll()));
77 
78  QObject::disconnect(svw->toolMgr()->action(QxScene_ViewWindow::FitRectId),
79  SIGNAL(triggered(bool)),
80  svw, SLOT(onViewFitArea()));
81  QObject::connect(svw->toolMgr()->action(QxScene_ViewWindow::FitRectId),
82  SIGNAL(triggered(bool)),
83  wgv, SLOT(onViewFitArea()));
84 
85  QObject::disconnect(svw->toolMgr()->action(QxScene_ViewWindow::ZoomId),
86  SIGNAL(triggered(bool)),
87  svw, SLOT(onViewZoom()));
88  QObject::connect(svw->toolMgr()->action(QxScene_ViewWindow::ZoomId),
89  SIGNAL(triggered(bool)),
90  wgv, SLOT(onViewZoom()));
91 
92  QObject::disconnect(svw->toolMgr()->action(QxScene_ViewWindow::PanId),
93  SIGNAL(triggered(bool)),
94  svw, SLOT(onViewPan()));
95  QObject::connect(svw->toolMgr()->action(QxScene_ViewWindow::PanId),
96  SIGNAL(triggered(bool)),
97  wgv, SLOT(onViewPan()));
98 
99  QObject::disconnect(svw->toolMgr()->action(QxScene_ViewWindow::GlobalPanId),
100  SIGNAL(triggered(bool)),
101  svw, SLOT(onViewGlobalPan()));
102  QObject::connect(svw->toolMgr()->action(QxScene_ViewWindow::GlobalPanId),
103  SIGNAL(triggered(bool)),
104  wgv, SLOT(onViewGlobalPan()));
105 
106  QObject::disconnect(svw->toolMgr()->action(QxScene_ViewWindow::ResetId),
107  SIGNAL(triggered(bool)),
108  svw, SLOT(onViewReset()));
109  QObject::connect(svw->toolMgr()->action(QxScene_ViewWindow::ResetId),
110  SIGNAL(triggered(bool)),
111  wgv, SLOT(onViewReset()));
112 }
#define YASSERT(val)
YASSERT macro is always defined, used like assert, but throw a YACS::Exception instead of abort.
Definition: YacsTrace.hxx:59
void AssociateViewToWindow(QGraphicsView *gView, QxScene_ViewWindow *viewWindow)

References _wrapped, SalomeWrap_Module::AssociateViewToWindow(), and YASSERT.

◆ createAction()

QAction * SuitWrapper::createAction ( 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 120 of file SuitWrapper.cxx.

130 {
131  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
132  return module->wCreateAction(id, toolTip, icon, menu, status, shortCut,
133  parent, checkable, receiver, member);
134 }
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)

References _wrapped, and SalomeWrap_Module::wCreateAction().

◆ createMenu() [1/6]

int SuitWrapper::createMenu ( const int  actionId,
const int  menuId,
const int  groupId = -1,
const int  index = -1 
)

Definition at line 156 of file SuitWrapper.cxx.

160 {
161  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
162  return module->wCreateMenu(actionId, menuId, groupId, index);
163 }
int wCreateMenu(const QString &subMenu, const int parentMenuId, const int menuId=-1, const int groupId=-1, const int index=-1)

References _wrapped, and SalomeWrap_Module::wCreateMenu().

◆ createMenu() [2/6]

int SuitWrapper::createMenu ( const int  actionId,
const QString &  menu,
const int  groupId = -1,
const int  index = -1 
)

Definition at line 165 of file SuitWrapper.cxx.

169 {
170  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
171  return module->wCreateMenu(actionId, menu, groupId, index);
172 }

References _wrapped, and SalomeWrap_Module::wCreateMenu().

◆ createMenu() [3/6]

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

Definition at line 136 of file SuitWrapper.cxx.

141 {
142  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
143  return module->wCreateMenu(subMenu, parentMenuId, menuId, groupId, index);
144 }

References _wrapped, and SalomeWrap_Module::wCreateMenu().

◆ createMenu() [4/6]

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

Definition at line 146 of file SuitWrapper.cxx.

151 {
152  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
153  return module->wCreateMenu(subMenu, parentMenu, menuId, groupId, index);
154 }

References _wrapped, and SalomeWrap_Module::wCreateMenu().

◆ createMenu() [5/6]

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

Definition at line 174 of file SuitWrapper.cxx.

179 {
180  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
181  return module->wCreateMenu(action, menuId, actionId, groupId, index);
182 }

References _wrapped, and SalomeWrap_Module::wCreateMenu().

◆ createMenu() [6/6]

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

Definition at line 184 of file SuitWrapper.cxx.

189 {
190  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
191  return module->wCreateMenu(action, menu, actionId, groupId, index);
192 }

References _wrapped, and SalomeWrap_Module::wCreateMenu().

◆ createNewRun()

void SuitWrapper::createNewRun ( const QString &  schemaName,
const QString &  runName,
QWidget refWindow,
QWidget viewWindow 
)

Definition at line 272 of file SuitWrapper.cxx.

276 {
277  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
278  module->getDataModel()->createNewRun(schemaName, runName, refWindow, viewWindow);
279 }
virtual void createNewRun(const QString &schemaName, const QString &runName, QWidget *refWindow, QWidget *viewWindow)
SalomeWrap_DataModel * getDataModel()

References _wrapped, SalomeWrap_DataModel::createNewRun(), and SalomeWrap_Module::getDataModel().

◆ createNewSchema()

void SuitWrapper::createNewSchema ( const QString &  schemaName,
QWidget viewWindow 
)

Definition at line 251 of file SuitWrapper.cxx.

253 {
254  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
255  module->getDataModel()->createNewSchema(schemaName, viewWindow);
256 }
virtual void createNewSchema(const QString &schemaName, QWidget *viewWindow)

References _wrapped, SalomeWrap_DataModel::createNewSchema(), and SalomeWrap_Module::getDataModel().

◆ createTool() [1/5]

int SuitWrapper::createTool ( const int  actionId,
const int  toolbarId,
const int  index = -1 
)

Definition at line 200 of file SuitWrapper.cxx.

203 {
204  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
205  return module->wCreateTool(actionId, toolbarId, index);
206 }
int wCreateTool(const QString &title, const QString &name=QString())

References _wrapped, and SalomeWrap_Module::wCreateTool().

◆ createTool() [2/5]

int SuitWrapper::createTool ( const int  actionId,
const QString &  toolbar,
const int  index = -1 
)

Definition at line 208 of file SuitWrapper.cxx.

211 {
212  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
213  return module->wCreateTool(actionId, toolbar, index);
214 }

References _wrapped, and SalomeWrap_Module::wCreateTool().

◆ createTool() [3/5]

int SuitWrapper::createTool ( const QString &  title,
const QString &  name = QString() 
)

Definition at line 194 of file SuitWrapper.cxx.

195 {
196  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
197  return module->wCreateTool(title, name);
198 }

References _wrapped, and SalomeWrap_Module::wCreateTool().

◆ createTool() [4/5]

int SuitWrapper::createTool ( QAction *  action,
const int  toolbarId,
const int  actionId = -1,
const int  index = -1 
)

Definition at line 216 of file SuitWrapper.cxx.

220 {
221  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
222  return module->wCreateTool(action, toolbarId, actionId, index);
223 }

References _wrapped, and SalomeWrap_Module::wCreateTool().

◆ createTool() [5/5]

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

Definition at line 225 of file SuitWrapper.cxx.

229 {
230  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
231  return module->wCreateTool(action, toolbar, actionId, index);
232 }

References _wrapped, and SalomeWrap_Module::wCreateTool().

◆ deleteSchema()

bool SuitWrapper::deleteSchema ( QWidget viewWindow)

Definition at line 266 of file SuitWrapper.cxx.

267 {
268  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
269  return module->getDataModel()->deleteSchema(viewWindow);
270 }
virtual bool deleteSchema(QWidget *viewWindow)

References _wrapped, SalomeWrap_DataModel::deleteSchema(), and SalomeWrap_Module::getDataModel().

◆ getNewWindow()

QWidget * SuitWrapper::getNewWindow ( QGraphicsScene scene)

Definition at line 57 of file SuitWrapper.cxx.

58 {
59  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
60  return module->getNewWindow(scene);
61 }
QxScene_ViewWindow * getNewWindow(QGraphicsScene *scene)

References _wrapped, and SalomeWrap_Module::getNewWindow().

◆ getQuickDirList()

QStringList SuitWrapper::getQuickDirList ( )

Definition at line 281 of file SuitWrapper.cxx.

282 {
283  QStringList dirList;
284  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
285  if ( resMgr )
286  dirList = resMgr->stringValue( "FileDlg", "QuickDirList" ).split( ';', QString::SkipEmptyParts );
287  return dirList;
288 }

◆ objectBrowser()

QDockWidget * SuitWrapper::objectBrowser ( )

Definition at line 114 of file SuitWrapper.cxx.

115 {
116  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
117  return module->objectBrowser();
118 }
QDockWidget * objectBrowser()

References _wrapped, and SalomeWrap_Module::objectBrowser().

◆ onHelpContextModule()

void SuitWrapper::onHelpContextModule ( const QString &  theComponentName,
const QString &  theFileName,
const QString &  theContext = QString() 
)
virtual

Definition at line 290 of file SuitWrapper.cxx.

291 {
292  LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
293  if(app)
294  app->onHelpContextModule( theComponentName, theFileName, theContext );
295 }

References gui.Appli::app.

◆ renameSchema()

bool SuitWrapper::renameSchema ( const QString &  oldName,
const QString &  newName,
QWidget viewWindow 
)

Definition at line 258 of file SuitWrapper.cxx.

261 {
262  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
263  return module->getDataModel()->renameSchema(oldName, newName, viewWindow);
264 }
virtual bool renameSchema(const QString &oldName, const QString &newName, QWidget *viewWindow)

References _wrapped, SalomeWrap_Module::getDataModel(), and SalomeWrap_DataModel::renameSchema().

◆ separator()

QAction * SuitWrapper::separator ( )
static

Definition at line 234 of file SuitWrapper.cxx.

235 {
237 }
static QAction * wSeparator()

References SalomeWrap_Module::wSeparator().

◆ setMenuShown()

void SuitWrapper::setMenuShown ( QAction *  act,
bool  show 
)

Definition at line 239 of file SuitWrapper.cxx.

240 {
241  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
242  module->setMenuShown(act, show);
243 }

References _wrapped.

◆ setToolShown()

void SuitWrapper::setToolShown ( QAction *  act,
bool  show 
)

Definition at line 245 of file SuitWrapper.cxx.

246 {
247  SalomeWrap_Module* module = dynamic_cast<SalomeWrap_Module*>(_wrapped);
248  module->setToolShown(act, show);
249 }

References _wrapped.

Member Data Documentation

◆ _wrapped


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