richelbilderbeek / ProjectRichelBilderbeek

Richel Bilderbeek's C++ work, before splitting it up
http://richelbilderbeek.nl/
6 stars 3 forks source link

Brainweaver: resolve CreateNewEdge error #190

Closed richelbilderbeek closed 9 years ago

richelbilderbeek commented 10 years ago

This bug sometimes happens:

TRACE '
"Random clicking"
' line 295 in file '../../Tools/ToolTestConceptMap/qttestconceptmapwidgetdialog.cpp': 'Random clicking'
ProjectBrainweaverDeveloper: ../../Classes/CppConceptMap/conceptmapwidget.cpp:164: boost::shared_ptr<ribi::cmap::Edge> ribi::cmap::Widget::CreateNewEdge(): Assertion `m_conceptmap->HasNode(to)' failed.
The program has unexpectedly finished.

Suggestions to resolve this: 1) Search for places where pvbd::Edge and pvdb::Node (and perhaps others) are put into an ordered set (e.g. std::set and std::map) by their memory location (e.g. std:setboost::shared_ptr<Edge m_edges) 2) Replace this by a set that does this ordering (e.g. std:setboost::shared_ptr<Edge,OrderBySomething m_egdes), an example can be found in the source code of the tool TestMeshCreator. Note: to prevent a lot of typing caused by this change in data type, replace that data type by the keyword 'auto'

richelbilderbeek commented 10 years ago

Marked with TODO_ISSUE_190, the cause is that the same node is selected twice.