-// SUPERV SUPERVGUI : GUI for Supervisor component
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// Copyright (C) 2003 OPEN CASCADE
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// SUPERV SUPERVGUI : GUI for Supervisor component
// File : SUPERVGUI_CanvasNode.cxx
// Author : Natalia KOPNOVA
// Module : SUPERV
-
-using namespace std;
+//
#include "SUPERVGUI_CanvasNode.h"
#include "SUPERVGUI_CanvasNodePrs.h"
#include "SUPERVGUI_CanvasPort.h"
#include "SUPERVGUI_Information.h"
#include "SUPERVGUI_Library.h"
-#include "SalomeApp_NameDlg.h"
#include "SUIT_MessageBox.h"
#include "LogWindow.h"
#include "SUIT_Session.h"
+#include <qinputdialog.h>
-SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell):
+
+SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode( SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell):
QObject(theParent),
myMain(theMain),
myNode(theNode),
step(true),
trace(true),
verbose(true),
- myBrowseDlg(0)
+ myBrowseDlg(0),
+ myMgr( mgr )
{
Trace("SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode");
}
isIgnore = false;
+
+ // mkr : PAL8237
+ connect(this, SIGNAL(objectCreatedDeleted()), myMain, SLOT(onObjectCreatedDeleted()));
}
SUPERVGUI_CanvasNode::~SUPERVGUI_CanvasNode()
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasNode::createPrs() const
{
- return new SUPERVGUI_CanvasNodePrs(myMain->getCanvas(), (SUPERVGUI_CanvasNode*)this);
+ //
+ //SUPERVGUI_PrsNode* glNode = new SUPERVGUI_PrsNode( (SUPERVGUI_CanvasNode*)this );
+ //glNode->setFirstPoint( new GLViewer_Pnt( 10, 10 ) );
+ //glNode->compute();
+ //glNode->update();
+ //getGLContext()->insertObject( glNode, true /*false*/ );
+ //
+ return new SUPERVGUI_CanvasNodePrs( myMgr, myMain->getCanvas(), (SUPERVGUI_CanvasNode*)this);
}
void SUPERVGUI_CanvasNode::createPort(SUPERV::Port_ptr thePort)
if (aPort) {
connect(aPort, SIGNAL(destroyed(QObject*)), this, SLOT(onDestroyed(QObject*)));
if (!isIgnore) getPrs()->updatePorts();
+
+ emit objectCreatedDeleted(); // mkr : PAL8237
}
}
}
void SUPERVGUI_CanvasNode::rename() {
- QString aName = SalomeApp_NameDlg::getName( SUIT_Session::session()->activeApplication()->desktop(), myNode->Name() );
+ bool ok;
+ QString aName = QInputDialog::getText( tr( "Rename" ), tr( "Enter new name:" ), QLineEdit::Normal,
+ myNode->Name(), &ok, SUIT_Session::session()->activeApplication()->desktop() );
+
//mkr : modifications for fixing bug IPAL9972
- if (!aName.isEmpty() && aName.compare( myNode->Name() ) != 0) {
+ if( ok && !aName.isEmpty() && aName.compare( myNode->Name() ) != 0) {
setNodeName(aName);
}
}
SUPERVGUI_Canvas* aCanvas = myMain->getCanvas();
setDestroyed();
myNode->destroy();
+
+ emit objectCreatedDeleted(); // mkr : PAL8237
+
delete this;
aCanvas->update();
}
else
SUIT_MessageBox::error1( SUIT_Session::session()->activeApplication()->desktop(), tr( "ERROR" ), tr( "MSG_BAD_INODE" ), tr( "OK" ) );
}
+
+QString SUPERVGUI_CanvasNode::getToolTipText() const {
+ if ( myNode->IsFactory() )
+ return QString("Name : ") + SUPERV::FNode::_narrow(myNode)->Name() +
+ QString("\nContainer : ") + SUPERV::FNode::_narrow(myNode)->GetContainer() +
+ QString("\nComponentName : ") + SUPERV::FNode::_narrow(myNode)->GetComponentName() +
+ QString("\nInterfaceName : ") + SUPERV::FNode::_narrow(myNode)->GetInterfaceName();
+ return QString("Name : ") + myNode->Name() + '\n' + getLabelText();
+}