Bug 304716 - Rocs removes nodes from the graph object when changing their type
Summary: Rocs removes nodes from the graph object when changing their type
Status: RESOLVED FIXED
Alias: None
Product: Rocs
Classification: Applications
Component: script engine (show other bugs)
Version: Git
Platform: unspecified Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Andreas Cord-Landwehr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-07 09:28 UTC by Frederik Gladhorn
Modified: 2012-08-07 10:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederik Gladhorn 2012-08-07 09:28:55 UTC
Run this script with an existing graph object g and two node types.

output("Length: " + g.list_nodes().length);
g.list_nodes()[0].set_type(1);
output("Length: " + g.list_nodes().length);

In rocs 1.6.95 I end up with one node less. I don't see an easy way to access the node again.

Reproducible: Always
Comment 1 Andreas Cord-Landwehr 2012-08-07 09:45:51 UTC
The problem is a missing accessor function for nodes of node type different than type 0, i.e. missing script accessor function: GraphStructure::list_nodes(DATA_TYPE)
Comment 2 Andreas Cord-Landwehr 2012-08-07 10:47:07 UTC
Git commit 6faf53744e89ee20ede6b952b72907cbf05baea9 by Andreas Cord-Landwehr.
Committed on 07/08/2012 at 12:02.
Pushed by cordlandwehr into branch 'master'.

Add script accessor functions for nodes/edges of different types.

Fix and extend node/edge script accessor function of Graph data
structure plugin:
* Fix behavior of GraphStructure::list_nodes():
  return nodes of all types
* Fix behavior of GraphStructure::list_edges():
  return edges of all types
* Add new method GraphStructure::list_nodes(int type):
  return only nodes of specified type
* Add new method GraphStructure::list_edges(int type):
  return only edges of specified type

M  +25   -2    src/Plugins/DataStructure/Graph/GraphStructure.cpp
M  +18   -2    src/Plugins/DataStructure/Graph/GraphStructure.h

http://commits.kde.org/rocs/6faf53744e89ee20ede6b952b72907cbf05baea9
Comment 3 Andreas Cord-Landwehr 2012-08-07 10:50:25 UTC
Git commit 579e3d9e28c603be867b57fbcc6291e964340df6 by Andreas Cord-Landwehr.
Committed on 07/08/2012 at 12:02.
Pushed by cordlandwehr into branch 'KDE/4.9'.

Add script accessor functions for nodes/edges of different types.

Fix and extend node/edge script accessor function of Graph data
structure plugin:
* Fix behavior of GraphStructure::list_nodes():
  return nodes of all types
* Fix behavior of GraphStructure::list_edges():
  return edges of all types
* Add new method GraphStructure::list_nodes(int type):
  return only nodes of specified type
* Add new method GraphStructure::list_edges(int type):
  return only edges of specified type
(cherry picked from commit 6faf53744e89ee20ede6b952b72907cbf05baea9)

M  +25   -2    src/Plugins/DataStructure/Graph/GraphStructure.cpp
M  +18   -2    src/Plugins/DataStructure/Graph/GraphStructure.h

http://commits.kde.org/rocs/579e3d9e28c603be867b57fbcc6291e964340df6