-// SUPERV SUPERVGUI : GUI for Supervisor component
+// Copyright (C) 2003 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.
+//
+// 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
//
-// Copyright (C) 2003 OPEN CASCADE
+// SUPERV SUPERVGUI : GUI for Supervisor component
//
// File : SUPERVGUI_Ganvas.cxx
// Author : Natalia KOPNOVA
ihmList->removeRef(ihmNode); \
ihmNode->merge(); \
ihmNode = getNode(aCNodeEnd); \
- ihmList->removeRef(ihmNode); \
- ihmNode->merge(); \
+ if (ihmNode) { \
+ ihmList->removeRef(ihmNode); \
+ ihmNode->merge(); \
+ } \
} \
}
*/
void SUPERVGUI_Canvas::merge() {
if (SUPERV_isNull(myMain->getDataflow())) return;
-
+
SUPERVGUI_CanvasNode* ihmNode;
QObjectList* ihmList = queryList("SUPERVGUI_CanvasNode");
SUPERV_Nodes nodes = myMain->getDataflow()->Nodes();
UPDATECONTROLNODES(LNodes);
UPDATECONTROLNODES(SNodes);
+ /*
+ n = nodes->LNodes.length();
+ for (int i=0; i<n; i++) {
+ SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->LNodes[i]);
+ SUPERV_CNode aCNodeEnd = SUPERV::CNode::_narrow(nodes->LNodes[i]->Coupled());
+ ihmNode = getNode(aCNode);
+ SUPERVGUI_CanvasNode* ihmNodeEnd = getNode(aCNodeEnd);
+ if (ihmNode == NULL) {
+ myMain->addControlNode(aCNode, aCNodeEnd, false);
+ } else {
+ if (ihmNodeEnd) {
+ ihmNode->move(aCNode->X(), aCNode->Y());
+ ihmList->removeRef(ihmNode);
+ ihmNode->merge();
+ ihmNode = getNode(aCNodeEnd);
+ ihmList->removeRef(ihmNode);
+ ihmNode->merge();
+ }
+ }
+ }
+ n = nodes->SNodes.length();
+ for (int i=0; i<n; i++) {
+ SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->SNodes[i]);
+ SUPERV_CNode aCNodeEnd = SUPERV::CNode::_narrow(nodes->SNodes[i]->Coupled());
+ ihmNode = getNode(aCNode);
+ if (ihmNode == NULL) {
+ myMain->addControlNode(aCNode, aCNodeEnd, false);
+ } else {
+ ihmNode->move(aCNode->X(), aCNode->Y());
+ ihmList->removeRef(ihmNode);
+ ihmNode->merge();
+ ihmNode = getNode(aCNodeEnd);
+ ihmList->removeRef(ihmNode);
+ ihmNode->merge();
+ }
+ }
+ //*/
QObjectListIt it(*ihmList);
while ((ihmNode=(SUPERVGUI_CanvasNode*)it.current()) != 0) {