Back to index

salome-gui  6.5.0
QxScene_ViewManager.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #include "QxScene_ViewManager.h"
00021 #include "QxScene_ViewWindow.h"
00022 
00023 //#define _DEVDEBUG_
00024 #include "DebTrace.hxx"
00025 
00029 QxScene_ViewManager::QxScene_ViewManager( SUIT_Study* theStudy, 
00030                                           SUIT_Desktop* theDesktop, 
00031                                           SUIT_ViewModel* theViewModel )
00032   : SUIT_ViewManager( theStudy, theDesktop, theViewModel )
00033 {
00034   DEBTRACE("QxScene_ViewManager::QxScene_ViewManager");
00035   setTitle( tr( "QXSCENE_VIEW_TITLE" ) );
00036 }
00037 
00041 QxScene_ViewManager::~QxScene_ViewManager()
00042 {
00043   DEBTRACE("QxScene_ViewManager::~QxScene_ViewManager");
00044 }
00045 
00046 
00051 bool QxScene_ViewManager::insertView( SUIT_ViewWindow* theView )
00052 {
00053   DEBTRACE("QxScene_ViewManager::insertView");
00054   bool res = SUIT_ViewManager::insertView( theView );
00055   return res;
00056 }
00057 
00061 void QxScene_ViewManager::createView()
00062 {
00063   DEBTRACE("QxScene_ViewManager::createView");
00064   createViewWindow();
00065 }
00066 
00072 void QxScene_ViewManager::closeView(SUIT_ViewWindow* theView)
00073 {
00074   DEBTRACE("QxScene_ViewManager::closeView");
00075   QxScene_ViewWindow *qxview = dynamic_cast<QxScene_ViewWindow*>(theView);
00076   bool OKToClose = true;
00077   if (!qxview)
00078     OKToClose = true;
00079   else
00080     OKToClose = qxview->closeRequested();
00081    if (OKToClose)
00082      {
00083        DEBTRACE("SUIT View to close");
00084        SUIT_ViewManager::closeView(theView);
00085        DEBTRACE("SUIT View closed");
00086      }
00087 }