Too many items on my scene :/



  • Hello,
    new on this forum, I hope I will find a solution around here, for my problems :)

    Basically, using Qt environment with a c++ code for computational purposes (artificial neural networks + genetic algorithms). I have two major issues:

    • I use a lot of QGraphicsPolygonItems, mainly for collision detection, between many individual items and their environment. Thus, even if set to invisibles, they seem to overload the computational task when sorting the collidingitems for each "real" item that I need. For example, say that one individual organism has 10 sensors to track its environment ; those 10 sensors (angle, range, etc..) are 10 QPolygonF, but when I want to check possible collision, I do not need to loop over all the sensors' item from all the other organisms.. Right now it seems to be really time consuming :-/ Is there a nice solution for that?
    • Then, graphical stuff is finally mainly for visualisation purpose, but I do not really need it for computation. Is there an easy way to "pause" the scene (I mean, refreshing everything etc..) in order to accelerate the computation? And, of course, the way back to come back to graphical refreshing?

    Main architecture is :
    main => simulation.cpp (QgraphicsScene) which contains a slot and a QTimer => evolution algorithm (mainly computation, but a lot of QGraphicsItem for visualisation and collison detection)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.