Salome HOME
eda8bd6fbca6a981b90c95edc2f215a8d0889487
[modules/gui.git] / src / Plot2d / Plot2d_ViewWindow.cxx
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either 
6 // version 2.1 of the License.
7 // 
8 // This library is distributed in the hope that it will be useful 
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public  
14 // License along with this library; if not, write to the Free Software 
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/
18 //
19 // Plot2d_ViewWindow.cxx: implementation of the Plot2d_ViewWindow class.
20
21 #include "Plot2d_ViewWindow.h"
22 #include "Plot2d_ViewFrame.h"
23
24 #include "SUIT_ViewManager.h"
25 #include "SUIT_ResourceMgr.h"
26 #include "SUIT_Session.h"
27 #include "SUIT_ToolButton.h"
28 #include "SUIT_Desktop.h"
29
30 #include "QtxAction.h"
31
32 #include <qstatusbar.h>
33 #include <qlayout.h>
34 #include <qapplication.h>
35 #include <qpopupmenu.h>
36 #include <qimage.h>
37
38 /*!
39   Constructor
40 */
41 Plot2d_ViewWindow::Plot2d_ViewWindow(SUIT_Desktop* theDesktop, Plot2d_Viewer* theModel)
42 : SUIT_ViewWindow(theDesktop)
43 {
44   myModel = theModel;
45
46   myViewFrame = new Plot2d_ViewFrame(this, "plotView");
47   setCentralWidget(myViewFrame);
48
49   myToolBar = new QToolBar(this);
50   myToolBar->setCloseMode(QDockWindow::Undocked);
51   myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
52   createActions();
53   createToolBar();
54
55   connect(myViewFrame, SIGNAL(vpModeHorChanged()), this, SLOT(onChangeHorMode()));
56   connect(myViewFrame, SIGNAL(vpModeVerChanged()), this, SLOT(onChangeVerMode()));
57   connect(myViewFrame, SIGNAL(vpCurveChanged()),   this, SLOT(onChangeCurveMode()));
58   connect(myViewFrame, SIGNAL(contextMenuRequested( QContextMenuEvent * )),
59           this,        SIGNAL(contextMenuRequested( QContextMenuEvent * )) );
60
61 }
62
63 /*!
64   Destructor
65 */
66 Plot2d_ViewWindow::~Plot2d_ViewWindow()
67 {
68 }
69
70 /*!
71   Puts message to status bar
72   \param theMsg - message text
73 */
74 void Plot2d_ViewWindow::putInfo(QString theMsg)
75 {
76   QStatusBar*   aStatusBar = myDesktop->statusBar();
77   aStatusBar->message(theMsg/*, 3000*/);
78 }
79
80 /*!
81   Fills popup menu with custom actions
82  \param popup - popup menu to be filled with
83 */
84 void Plot2d_ViewWindow::contextMenuPopup( QPopupMenu* thePopup )
85 {
86   // scaling
87   QPopupMenu* scalingPopup = new QPopupMenu( thePopup );
88   myActionsMap[ PModeXLinearId ]->addTo( scalingPopup );
89   myActionsMap[ PModeXLogarithmicId ]->addTo( scalingPopup );
90   onChangeHorMode();
91   scalingPopup->insertSeparator();
92   myActionsMap[ PModeYLinearId ]->addTo( scalingPopup );
93   myActionsMap[ PModeYLogarithmicId ]->addTo( scalingPopup );
94   thePopup->insertItem( tr( "SCALING_POPUP" ), scalingPopup );
95   onChangeVerMode();
96
97   thePopup->insertItem(tr("TOT_PLOT2D_FITDATA"), myViewFrame, SLOT(onFitData()));
98   // curve type
99   QPopupMenu* curTypePopup = new QPopupMenu( thePopup );
100   myActionsMap[ CurvPointsId ]->addTo( curTypePopup );
101   myActionsMap[ CurvLinesId ]->addTo( curTypePopup );
102   myActionsMap[ CurvSplinesId ]->addTo( curTypePopup );
103   thePopup->insertItem( tr( "CURVE_TYPE_POPUP" ), curTypePopup );
104
105   // legend
106   myActionsMap[ LegendId ]->addTo(thePopup);
107   // settings
108   myActionsMap[ CurvSettingsId ]->addTo(thePopup);
109 }
110
111 /*!
112   Custom event filter
113 */
114 bool Plot2d_ViewWindow::eventFilter(QObject* watched, QEvent* e)
115 {
116   if (watched == myViewFrame) {
117     int aType = e->type();
118     switch(aType) {
119     case QEvent::MouseButtonPress:
120       emit mousePressed(this, (QMouseEvent*) e);
121       return true;
122
123     case QEvent::MouseButtonRelease:
124       emit mouseReleased(this, (QMouseEvent*) e);
125       return true;
126
127     case QEvent::MouseMove:
128       emit mouseMoving(this, (QMouseEvent*) e);
129       return true;
130
131     default:
132       break;
133     }
134   }
135   return SUIT_ViewWindow::eventFilter(watched, e);
136 }
137
138 /*!
139   Create actions for Plot2d view window
140 */
141 void Plot2d_ViewWindow::createActions()
142 {
143   if ( !myActionsMap.isEmpty() )
144     return;
145
146   QtxAction* aAction;
147   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
148
149   // Dump view
150   aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_DUMP" ) ),
151                            tr( "MNU_DUMP_VIEW" ), 0, this);
152   aAction->setStatusTip(tr("DSC_DUMP_VIEW"));
153   connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView()));
154   myActionsMap[ DumpId ] = aAction;
155
156   // FitAll
157   aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_ALL" ) ),
158                            tr( "MNU_FITALL" ), 0, this);
159   aAction->setStatusTip(tr("DSC_FITALL"));
160   connect(aAction, SIGNAL(activated()), this, SLOT(onFitAll()));
161   myActionsMap[ FitAllId ] = aAction;
162
163   // FitRect
164   aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_AREA" ) ),
165                            tr( "MNU_FITRECT" ), 0, this);
166   aAction->setStatusTip(tr("DSC_FITRECT"));
167   connect(aAction, SIGNAL(activated()), this, SLOT(onFitRect()));
168   myActionsMap[ FitRectId ] = aAction;
169
170   // Zoom
171   aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_ZOOM" ) ),
172                            tr( "MNU_ZOOM_VIEW" ), 0, this);
173   aAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
174   connect(aAction, SIGNAL(activated()), this, SLOT(onZoom()));
175   myActionsMap[ ZoomId ] = aAction;
176
177   // Panning
178   aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_PAN" ) ),
179                            tr( "MNU_PAN_VIEW" ), 0, this);
180   aAction->setStatusTip(tr("DSC_PAN_VIEW"));
181   connect(aAction, SIGNAL(activated()), this, SLOT(onPanning()));
182   myActionsMap[ PanId ] = aAction;
183
184   // Global Panning
185   aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_GLOBALPAN" ) ),
186                            tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
187   aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
188   connect(aAction, SIGNAL(activated()), this, SLOT(onGlobalPanning()));
189   myActionsMap[ GlobalPanId ] = aAction;
190
191   // Curve type - points
192   aAction = new QtxAction(tr("TOT_PLOT2D_CURVES_POINTS"),
193                 aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_CURVES_POINTS")),
194                 tr("MEN_PLOT2D_CURVES_POINTS"), 0, this);
195   aAction->setStatusTip(tr("PRP_PLOT2D_CURVES_POINTS"));
196   connect(aAction, SIGNAL(activated()), this, SLOT(onCurves()));
197   aAction->setToggleAction(true);
198   myActionsMap[ CurvPointsId ] = aAction;
199
200   // Curve type - lines
201   aAction = new QtxAction(tr("TOT_PLOT2D_CURVES_LINES"),
202                aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_CURVES_LINES")),
203                tr("MEN_PLOT2D_CURVES_LINES"), 0, this);
204   aAction->setStatusTip(tr("PRP_PLOT2D_CURVES_LINES"));
205   connect(aAction, SIGNAL(activated()), this, SLOT(onCurves()));
206   aAction->setToggleAction(true);
207   myActionsMap[ CurvLinesId ] = aAction;
208
209   // Curve type - splines
210   aAction = new QtxAction(tr("TOT_PLOT2D_CURVES_SPLINES"),
211                  aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_CURVES_SPLINES")),
212                  tr("MEN_PLOT2D_CURVES_SPLINES"), 0, this);
213   aAction->setStatusTip(tr("PRP_PLOT2D_CURVES_SPLINES"));
214   connect(aAction, SIGNAL(activated()), this, SLOT(onCurves()));
215   aAction->setToggleAction(true);
216   myActionsMap[ CurvSplinesId ] = aAction;
217
218   // Mode for X (linear or logarithmic)
219   aAction = new QtxAction(tr("TOT_PLOT2D_MODE_LINEAR_HOR"),
220                  aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_MODE_LINEAR_HOR")),
221                  tr("MEN_PLOT2D_MODE_LINEAR_HOR"), 0, this);
222   aAction->setStatusTip (tr("PRP_PLOT2D_MODE_LINEAR_HOR"));
223   connect(aAction, SIGNAL(activated()), this, SLOT(onViewHorMode()));
224   myActionsMap[ HorId ] = aAction;
225
226   // Mode for Y (linear or logarithmic)
227   aAction = new QtxAction(tr("TOT_PLOT2D_MODE_LINEAR_VER"),
228                  aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_MODE_LINEAR_VER")),
229                  tr("MEN_PLOT2D_MODE_LINEAR_VER" ), 0, this);
230   aAction->setStatusTip(tr("PRP_PLOT2D_MODE_LINEAR_VER"));
231   connect(aAction, SIGNAL(activated()), this, SLOT(onViewVerMode()));
232   myActionsMap[ VerId ] = aAction;
233
234   // Legend
235   aAction = new QtxAction(tr("TOT_PLOT2D_SHOW_LEGEND"),
236                 aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_SHOW_LEGEND")),
237                 tr("MEN_PLOT2D_SHOW_LEGEND"), 0, this);
238   aAction->setStatusTip(tr("PRP_PLOT2D_SHOW_LEGEND"));
239   connect(aAction, SIGNAL(activated()), this, SLOT(onLegend()));
240   aAction->setToggleAction(true);
241   myActionsMap[ LegendId ] = aAction;
242
243   // Settings
244   aAction = new QtxAction(tr( "TOT_PLOT2D_SETTINGS"),
245                 aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_SETTINGS")),
246                 tr("MEN_PLOT2D_SETTINGS"), 0, this);
247   aAction->setStatusTip(tr( "PRP_PLOT2D_SETTINGS"));
248   connect(aAction, SIGNAL(activated()), myViewFrame, SLOT(onSettings()));
249   myActionsMap[ CurvSettingsId ] = aAction;
250
251   // Clone
252   aAction = new QtxAction(tr("MNU_CLONE_VIEW"), aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CLONE_VIEW" ) ),
253                            tr( "MNU_CLONE_VIEW" ), 0, this);
254   aAction->setStatusTip(tr("DSC_CLONE_VIEW"));
255   connect(aAction, SIGNAL(activated()), this, SIGNAL(cloneView()));
256   myActionsMap[ CloneId ] = aAction;
257
258   /* Popup Actions */
259   /* Linear/logarithmic mode */
260   // Horizontal axis
261   aAction = new QtxAction(tr("TOT_PLOT2D_MODE_LINEAR_HOR"),
262                  aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_MODE_LINEAR_HOR")),
263                  tr("MEN_PLOT2D_MODE_LINEAR_HOR"), 0, this);
264   aAction->setStatusTip (tr("PRP_PLOT2D_MODE_LINEAR_HOR"));
265   aAction->setToggleAction(true);
266   myActionsMap[PModeXLinearId] = aAction;
267   connect(aAction, SIGNAL(activated()), this, SLOT(onViewHorMode()));
268
269   aAction = new QtxAction(tr("TOT_PLOT2D_MODE_LOGARITHMIC_HOR"),
270               aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_MODE_LOGARITHMIC_HOR")),
271               tr("MEN_PLOT2D_MODE_LOGARITHMIC_HOR"), 0, this);
272   aAction->setStatusTip(tr("PRP_PLOT2D_MODE_LOGARITHMIC_HOR"));
273   aAction->setToggleAction(true);
274   myActionsMap[PModeXLogarithmicId] = aAction;
275   connect(aAction, SIGNAL(activated()), this, SLOT(onViewHorMode()));
276
277   // Vertical axis
278   aAction = new QtxAction(tr("TOT_PLOT2D_MODE_LINEAR_VER"),
279                  aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_MODE_LINEAR_VER")),
280                  tr("MEN_PLOT2D_MODE_LINEAR_VER" ), 0, this);
281   aAction->setStatusTip(tr("PRP_PLOT2D_MODE_LINEAR_VER"));
282   aAction->setToggleAction(true);
283   myActionsMap[PModeYLinearId] = aAction;
284   connect(aAction, SIGNAL(activated()), this, SLOT(onViewVerMode()));
285
286   aAction = new QtxAction(tr("TOT_PLOT2D_MODE_LOGARITHMIC_VER"),
287                  aResMgr->loadPixmap("Plot2d", tr("ICON_PLOT2D_MODE_LOGARITHMIC_VER")),
288                  tr("MEN_PLOT2D_MODE_LOGARITHMIC_VER" ), 0, this);
289   aAction->setStatusTip(tr("PRP_PLOT2D_MODE_LOGARITHMIC_VER"));
290   aAction->setToggleAction(true);
291   myActionsMap[PModeYLogarithmicId] = aAction;
292   connect(aAction, SIGNAL(activated()), this, SLOT(onViewVerMode()));
293
294 }
295
296 /*!
297   Create toolbar for Plot2d view window
298 */
299 void Plot2d_ViewWindow::createToolBar()
300 {
301   myActionsMap[DumpId]->addTo(myToolBar);
302
303   SUIT_ToolButton* aScaleBtn = new SUIT_ToolButton(myToolBar);
304   aScaleBtn->AddAction(myActionsMap[FitAllId]);
305   aScaleBtn->AddAction(myActionsMap[FitRectId]);
306   aScaleBtn->AddAction(myActionsMap[ZoomId]);
307
308   SUIT_ToolButton* aPanBtn = new SUIT_ToolButton(myToolBar);
309   aPanBtn->AddAction(myActionsMap[PanId]);
310   aPanBtn->AddAction(myActionsMap[GlobalPanId]);
311
312   myCurveBtn = new SUIT_ToolButton(myToolBar);
313   myCurveBtn->AddAction(myActionsMap[CurvPointsId]);
314   myCurveBtn->AddAction(myActionsMap[CurvLinesId]);
315   myCurveBtn->AddAction(myActionsMap[CurvSplinesId]);
316   myActionsMap[CurvLinesId]->setOn(true);
317   onChangeCurveMode();
318
319   myActionsMap[HorId]->addTo(myToolBar);
320   onChangeHorMode();
321   myActionsMap[VerId]->addTo(myToolBar);
322   onChangeVerMode();
323
324   myActionsMap[LegendId]->addTo(myToolBar);
325   myActionsMap[CurvSettingsId]->addTo(myToolBar);
326   myActionsMap[CloneId]->addTo(myToolBar);
327   onChangeLegendMode();
328 }
329
330 /*!
331   SLOT: called if scale mode for horizontal axis is changed
332 */
333 void Plot2d_ViewWindow::onChangeHorMode()
334 {
335   bool aLinear = myViewFrame->isModeHorLinear();
336   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
337
338   myActionsMap[PModeXLinearId]->setOn( aLinear );
339   myActionsMap[PModeXLogarithmicId]->setOn( !aLinear );
340
341   QPixmap pix = aResMgr->loadPixmap( "Plot2d", tr( aLinear ? "ICON_PLOT2D_MODE_LOGARITHMIC_HOR" :
342                                                              "ICON_PLOT2D_MODE_LINEAR_HOR" ) );
343   myActionsMap[HorId]->setIconSet( pix );
344   myActionsMap[HorId]->setToolTip( tr( aLinear ? "TOT_PLOT2D_MODE_LOGARITHMIC_HOR" :
345                                                  "TOT_PLOT2D_MODE_LINEAR_HOR" ) );
346   myActionsMap[HorId]->setStatusTip( tr( aLinear ? "PRP_PLOT2D_MODE_LOGARITHMIC_HOR" :
347                                                    "PRP_PLOT2D_MODE_LINEAR_HOR" ) );
348
349   myActionsMap[GlobalPanId]->setEnabled( myViewFrame->isModeVerLinear() && myViewFrame->isModeHorLinear() );
350 }
351
352 /*!
353   SLOT: called if scale mode for vertical axis is changed
354 */
355 void Plot2d_ViewWindow::onChangeVerMode()
356 {
357   bool aLinear = myViewFrame->isModeVerLinear();
358   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
359
360   myActionsMap[PModeYLinearId]->setOn( aLinear );
361   myActionsMap[PModeYLogarithmicId]->setOn( !aLinear );
362
363   QPixmap pix = aResMgr->loadPixmap( "Plot2d", tr( aLinear ? "ICON_PLOT2D_MODE_LOGARITHMIC_VER" :
364                                                              "ICON_PLOT2D_MODE_LINEAR_VER" ) );
365   myActionsMap[VerId]->setIconSet( pix );
366   myActionsMap[VerId]->setToolTip( tr( aLinear ? "TOT_PLOT2D_MODE_LOGARITHMIC_VER" :
367                                                  "TOT_PLOT2D_MODE_LINEAR_VER" ) );
368   myActionsMap[VerId]->setStatusTip( tr( aLinear ? "PRP_PLOT2D_MODE_LOGARITHMIC_VER" :
369                                                    "PRP_PLOT2D_MODE_LINEAR_VER" ) );
370
371   myActionsMap[GlobalPanId]->setEnabled( myViewFrame->isModeVerLinear() && myViewFrame->isModeHorLinear() );
372 }
373
374 /*!
375   SLOT: called if curve type is changed
376 */
377 void Plot2d_ViewWindow::onChangeCurveMode()
378 {
379   int aCurveType = myViewFrame->getCurveType();
380   myCurveBtn->SetItem(aCurveType);
381
382   myActionsMap[CurvPointsId]->setOn(aCurveType == 0);
383   myActionsMap[CurvLinesId]->setOn(aCurveType == 1);
384   myActionsMap[CurvSplinesId]->setOn(aCurveType == 2);
385 }
386
387 /*!
388   SLOT: called if legend mode is changed
389 */
390 void Plot2d_ViewWindow::onChangeLegendMode()
391 {
392   myActionsMap[ LegendId ]->setOn(myViewFrame->isLegendShow());
393 }
394
395 /*!
396   SLOT: called if action "Fit all" is activated
397 */
398 void Plot2d_ViewWindow::onFitAll()
399 {
400   myViewFrame->onViewFitAll();
401 }
402
403 /*!
404   SLOT: called if action "Fit rect" is activated
405 */
406 void Plot2d_ViewWindow::onFitRect()
407 {
408   myViewFrame->onViewFitArea();
409 }
410
411 /*!
412   SLOT: called if action "Zoom" is activated
413 */
414 void Plot2d_ViewWindow::onZoom()
415 {
416   myViewFrame->onViewZoom();
417 }
418
419 /*!
420   SLOT: called if action "Panning" is activated
421 */
422 void Plot2d_ViewWindow::onPanning()
423 {
424   myViewFrame->onViewPan();
425 }
426
427 /*!
428   SLOT: called if action "Global panning" is activated
429 */
430 void Plot2d_ViewWindow::onGlobalPanning()
431 {
432   myViewFrame->onViewGlobalPan();
433 }
434
435 /*!
436   SLOT: called if action of scale mode for horizontal axis changing is activated
437 */
438 void Plot2d_ViewWindow::onViewHorMode()
439 {
440   if (myViewFrame->isModeHorLinear())
441     myViewFrame->setHorScaleMode(1);
442   else
443     myViewFrame->setHorScaleMode(0);
444 }
445
446 /*!
447   SLOT: called if action of scale mode for vertical axis changing is activated
448 */
449 void Plot2d_ViewWindow::onViewVerMode()
450 {
451   if (myViewFrame->isModeVerLinear())
452     myViewFrame->setVerScaleMode(1);
453   else
454     myViewFrame->setVerScaleMode(0);
455 }
456
457 /*!
458   SLOT: called if action "Show legend" is activated
459 */
460 void Plot2d_ViewWindow::onLegend()
461 {
462   myViewFrame->showLegend(!myViewFrame->isLegendShow());
463   onChangeLegendMode();
464 }
465
466 /*!
467   SLOT: called if action "Change curve type" is activated
468 */
469 void Plot2d_ViewWindow::onCurves()
470 {
471   QtxAction* aSender = (QtxAction*) sender();
472   if(aSender == myActionsMap[CurvPointsId])
473     myViewFrame->setCurveType(0);
474   else if(aSender == myActionsMap[CurvLinesId])
475     myViewFrame->setCurveType(1);
476   else if(aSender == myActionsMap[CurvSplinesId])
477     myViewFrame->setCurveType(2);
478 }
479  
480 /*!
481   SLOT: called if action "Dump view" is activated
482 */
483 void Plot2d_ViewWindow::onDumpView()
484 {
485   qApp->postEvent( myViewFrame, new QPaintEvent( QRect( 0, 0, myViewFrame->width(), myViewFrame->height() ), TRUE ) );
486   SUIT_ViewWindow::onDumpView();
487 }
488
489 /*!
490   \return QImage, containing all scene rendering in window
491 */
492 QImage Plot2d_ViewWindow::dumpView()
493 {
494   QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
495   return px.convertToImage();
496 }
497
498 /*!
499   Saves scene rendering in window to file
500   \param fileName - name of file
501   \param format - string contains name of format (for example, "BMP"(default) or "JPEG", "JPG")
502 */
503 bool Plot2d_ViewWindow::dumpViewToFormat( const QString& fileName, const QString& format )
504 {
505   bool res = myViewFrame ? myViewFrame->print( fileName, format ) : false;
506   if( !res )
507     res = SUIT_ViewWindow::dumpViewToFormat( fileName, format );
508
509   return res;
510 }
511
512 /*!
513   \return filter of image files
514 */
515 QString Plot2d_ViewWindow::filter() const
516 {
517   return SUIT_ViewWindow::filter() + ";;" + tr( "POSTSCRIPT_FILES" );
518 }
519
520 /*!
521   \return the visual parameters of this view as a formated string
522  */
523 QString Plot2d_ViewWindow::getVisualParameters()
524 {
525   return myViewFrame->getVisualParameters();
526 }
527
528 /*!
529   The method restors visual parameters of this view from a formated string
530 */
531 void Plot2d_ViewWindow::setVisualParameters( const QString& parameters )
532 {
533   myViewFrame->setVisualParameters( parameters );
534 }