Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rofi-app: Add configuration editor prototype #75

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Sep 13, 2021

This is initial prototype of the configuration editor. It allows selecting module parts by clicking them and then changing their angles using a Qt widget. Currently, it works by replacing the corresponding part of the configuration text (user still needs to press the Show button).
Additionally, this fixes few small bugs and enables building with VTK 9.

Next, I plan to work on UI for adding new modules and connections, showing the changes in real-time and modifying the Configuration object directly.

Mostly just uncommenting already existing code and making use of conditional compilation.
Fixes the following warnings:

	Generic Warning: In /build/VTK-8.2.0/GUISupport/Qt/QVTKWidget.cxx, line 83
	QVTKWidget was deprecated for VTK 8.1 and will be removed in a future version.

	Generic Warning: In /build/VTK-8.2.0/GUISupport/Qt/QVTKPaintEngine.cxx, line 25
	QVTKPaintEngine was deprecated for VTK 8.1 and will be removed in a future version.

This is not really necessary for running on 8.2 but will be useful when fixing build on 9.0.
Also fixes the runtime warnings but not the CMake warnings since those are harder to work around.

I used QVTKOpenGLNativeWidget since unlike QVTKOpenGLStereoWidget (called QVTKOpenGLWidget in 8.2), it is called the same in 9.0 and it is also recommended. Though, to add to the confusion the native widget was actually called QVTKOpenGLWidget before 8.2 so maybe it was intended to be used in 08b7aee.
Render method should not be called on Renderer but RenderWindow according to VTK docs:

https://stackoverflow.com/a/48578781/160386
https://vtk.org/doc/release/7.1/html/classvtkRenderer.html#adc877bbb1ff9a92e36146f7e379815d5

This change fixes QVTKOpenGLWidget/QVTKOpenGLNativeWidget/QVTKOpenGLStereoWidget not rendering the loaded configuration until user interaction happened.
Actions are convenient as they are decoupled from the object that triggers them,
which will allow us to re-use them in a menu, for example.

The move to toolbar is to make space for editing widgets.
It might have been disabled by “Show sphere” action.
At the moment, it only highlights an actor when an actor is clicked and jumps to a corresponding place in the configuration text.

To remain compatible with VTK 7, we cannot use `vtkActor->GetProperty()->GetInformation()`,
`vtkActor->GetPropertyKeys()` works but we need to make sure the `vtkInformation` objects exists.
Does not support adding new connections yet and is quite inefficient.
It is already autoconnected by the code generated by Qt’s uic (QMetaObject::connectSlotsByName).
@yaqwsx
Copy link
Member

yaqwsx commented Oct 27, 2021

Hi, do you have any progress? Please, let me know when I can test it and review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants