fstl-app / fstl

A fast STL file viewer
463 stars 106 forks source link

Menu item for common viewpoints #97

Closed pocomane closed 1 year ago

pocomane commented 1 year ago

This is a first implementation of the feature described in issue #94

DeveloperPaul123 commented 1 year ago

Overall, looks pretty good. I'm working on some minor changes and then this should be good to merge. The menu is a little cumbersome if you're changing views often. Maybe a popup menu like in solidworks or keyboard shortcuts would help in this regard. Any ideas?

DeveloperPaul123 commented 1 year ago

Maybe something like this image

DeveloperPaul123 commented 1 year ago

@pocomane I added some animations to polish the feel of the changing views. Give it a try and let me know what you think.

DeveloperPaul123 commented 1 year ago

@pocomane Have you had a chance to take a look at this?

pocomane commented 1 year ago

The nested menu, also if not very fast, let's me to align the view to the axis, that was absolutely impossible before. That was the sole issue I was trying to solve. Switching easily from one view to another is a different issue.

For the "Popup menu", do you mean a menu-bar + a popup and so on? I do not know if it matches the "Minimalist" philosophy of fstl. Rather I wold go for keyboard shortcuts, that will really speed-up the process, and they are still discoverable the first time from the menu.

About your changes @DeveloperPaul123 , I can not compile them. This is the first part of the complain by gcc:

media/data/devel/fstl/src/canvas.cpp: In member function ‘void Canvas::animate_properties_as_group(std::vector<std::tuple<QByteArray, QVariant, int> >)’:
/media/data/devel/fstl/src/canvas.cpp:52:53: error: no matching function for call to ‘get<QByteArray>(const std::tuple<QByteArray, QVariant, int>&)’
   52 |         const auto& prop_name = std::get<QByteArray>(value);
      |                                 ~~~~~~~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/12.2.0/utility:69,
                 from /usr/include/qt/QtCore/qglobal.h:47,
                 from /usr/include/qt/QtGui/qtguiglobal.h:43,
                 from /usr/include/qt/QtGui/qevent.h:43,
                 from /usr/include/qt/QtGui/QMouseEvent:1,
                 from /media/data/devel/fstl/src/canvas.cpp:1:
/usr/include/c++/12.2.0/bits/stl_pair.h:855:5: note: candidate: ‘template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(pair<_Tp1, _Tp2>&)’
  855 |     get(pair<_Tp1, _Tp2>& __in) noexcept
      |     ^~~
/usr/include/c++/12.2.0/bits/stl_pair.h:855:5: note:   template argument deduction/substitution failed:
DeveloperPaul123 commented 1 year ago

Hi @pocomane

Sounds good, I was mainly referring to the animation changes I made but I see you can't compile the changes. I will investigate.

DeveloperPaul123 commented 1 year ago

@pocomane Can you try out #110 and let me know if it works for you? I cherry picked your changes into a new branch so that I wouldn't have to push changes to your master branch and I could integrate the latest changes from fstl/master as I've merged in a couple other PRs.

DeveloperPaul123 commented 1 year ago

Merged as part of #110