RoboJackets / rrt

C++ RRT (Rapidly-exploring Random Tree) Implementation
Other
253 stars 84 forks source link

Saving and loading of obstacles #87

Closed joshhting closed 6 years ago

joshhting commented 6 years ago

Partially addresses #86 and #74

joshhting commented 6 years ago

Do you know how to fix the margin things on the rrt viewer that this commit messed up

chachmu commented 6 years ago

My screen is a weird resolution so @jgkamat is going to fix it for normal people's screens.

joshhting commented 6 years ago

The gui is a little off sync from the margin change, do you know how to call the qml properties from this line (I'd rather not hard code these values)

chachmu commented 6 years ago

@joshhting I think you can call setMinimumSize(200, 200) for example but I don't know how that interacts with the seperate QML stylesheet, it may not actually change anything.

joshhting commented 6 years ago

I mean do you know how to change the hardcoded values in the line I linked above to point to whatever the QML's values are

chachmu commented 6 years ago

@joshhting have you tried size()? https://doc.qt.io/qt-5.10/qwidget.html#size-prop

joshhting commented 6 years ago

Is the rrt still on qt4? The RRTWidget doesn't seem to have a size()...

jgkamat commented 6 years ago

RRTWidget is a subclass of QQuickPaintedItem, which you can use 'width' and 'height' on. It dosen't seem to be available right away in the constructor though, but it seems to be correct in the paint method.

joshhting commented 6 years ago

Yeah I was confused as to why it wasn't working in the constructor

joshhting commented 6 years ago

Working around the bug/feature where the dimensions are not available in the constructor seems too complicated for my level of Qt experience, so I'll leave it as a low priority issue for a more capable person. We could refactor it so that the part of the constructor that requires the width & height is called in some separate setupRRT() function that is called after the RRTWidget is initialized so that width() and height() work as expected, but I'm not sure how to reference the RRTWidget from the QMLApplicationEngine.

joshhting commented 6 years ago

I'm going to merge this in on Wednesday if there are no complaints

jgkamat commented 6 years ago

Yay, :D