Stream: Google Code-in

Topic: alternative GUI


view this post on Zulip caleb parks (Dec 26 2017 at 20:54):

where could I find documentation to use the c++ core interface?

view this post on Zulip Jeff Sieu (Dec 27 2017 at 05:08):

while im not sure whether there is documentation, i was able to figure it out by digging through the coreinterface .cpp and .h files

view this post on Zulip Jeff Sieu (Dec 27 2017 at 05:21):

You can go take a look at rt3/include/brlcad/ConstDatabase.h and rt3/include/brlcad/cicommon.h

view this post on Zulip Sean (Dec 27 2017 at 06:09):

the c++ coreInterface is documented in its header files. there's not separate docs or tutorials but there is example code and all of the implementation is available.

view this post on Zulip Daniel Rossberg (Dec 28 2017 at 17:22):

For an introduction in the C++ core interface you can look at http://brlcad.org/wiki/BRL-CAD%27s_core_C%2B%2B_interface

view this post on Zulip caleb parks (Dec 29 2017 at 01:39):

in the hit class in the constDatabase what is the difference between SurfaceNormalIn() and SurfaceNormalOut()?

view this post on Zulip Sean (Dec 29 2017 at 16:33):

@caleb parks when you shoot a ray at geometry, that ray hits the geometry and has a normal on the surface as it goes "into" the geometry (SurfaceNormalIn()) ... and then it comes out the back side when it goes "out" of the geometry (SurfaceNormalOut())

view this post on Zulip Daniel Rossberg (Dec 31 2017 at 17:41):

As some of you already finished the Alternative GUI 6 task: There will be new Qt GUI tasks in a few days (maybe tomorrow). I plan to create an amalgamate version from what you submitted to GCi. This version should be the base for the next tasks where you shall improve it together.

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 00:51):

The "BRL-CAD Alternative GUI 7" task is published.
The current state of the program is of course not perfect, but it is your task to improve it ...

view this post on Zulip Jeff Sieu (Jan 05 2018 at 03:34):

How is a ray trace performed in the combined GUI?

view this post on Zulip Sean (Jan 05 2018 at 04:01):

@Jeff Sieu you mean in archer?

view this post on Zulip Jeff Sieu (Jan 05 2018 at 04:01):

Nope, I'm referring to the newly added "QtGUI" in the rt^3 repo

view this post on Zulip Sean (Jan 05 2018 at 04:01):

ahh, that I don't know yet

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 14:50):

@Jeff Sieu What do you mean? Where in the code or what to do to see something? The "how" would be with rt_shootray().

view this post on Zulip Jeff Sieu (Jan 05 2018 at 14:54):

I mean in this

view this post on Zulip Jeff Sieu (Jan 05 2018 at 14:58):

But yeah, regarding that too, I am currently looking at trying to do appleseed #2, which requires the output of a raytrace into a PPM using something similar to rtexample.c right? I am wondering if I should separate the new .c file and create a CMakeLists.txt referencing the brlcad directory (currently trying this and having difficulty), or create the new .c file directly into /src/rt. Is it alright if I just do it in /src/rt and then submit the .c file only as the source code?

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:13):

Regarding "this": Open a .g file, select an element and hit "Reset".

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:14):

Oh, well that's rather unintuitive, never thought of actually clicking the only button available.

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:16):

I can't seem to see any output.

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:17):

Do you have a screen shot?

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:19):

here

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:21):

Is it ok if I submit a patch file with improvements to QtGUI to qt 7?

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:21):

Or will there possibly be a QT8 task for this?

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:23):

Did you hit Reset after selecting all.g?

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:23):

Yep I most definitely did.

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:24):

If hitting Reset resets the Projection Settings in order to raytrace, what is the purpose of Projection Settings?

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:24):

It doesn't look like that. The Zoom should be much smaller than 1.

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:25):

hmm thats weird, it resets to 1 for me

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:25):

Reset centers the model in the drawing area.

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:26):

Oh, so will changing the settings update the raytrace right away?

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:27):

A new ray-trace will be started then, right.

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:29):

I should look like this then:
screen shot

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:30):

What happens when you set the values on the right side by hand?

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:31):

What happens when you set the values on the right side by hand?

I just tried this with the values in your screenshot. It still shows a white screen.

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:32):

If the background of the raytrace here is blue, at least the background of mine should also turn blue, but it doesn't.

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:34):

Weird.
The blue thing isn't the background but the table. The background is always white.

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:34):

Wait, do you have moss.g opened in mged or archer in parallel?

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:35):

Nope

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:36):

I just tried with some other .g file that I've never opened before, and nothing shows up either.

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:39):

Seems like at least I can know for sure that the graphics view updates: it resizes to fit the window when I press reset or change any settings

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:41):

You work on a Mac?

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:41):

Ubuntu 16.04

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:52):

OK, I've a Debian 9 "stretch" with Qt 5.7.1 here.

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:54):

Mine is Qt 5.7.0, but I presume it shouldn't really matter much

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 15:56):

This is what I would have thought too ...

view this post on Zulip Jeff Sieu (Jan 05 2018 at 15:57):

But it seems rather peculiar that the coordinates and zoom are set to integers by default

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 16:08):

Not necessarily. It looks like the selection of all.g didn't worked for you. You could try to debug ObjectsTreeView::Activated(). Maybe the toUtf8() doesn't work for you?

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:11):

Ok, I'll do some debugging

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:29):

Seems like ObjectsTreeVIew::Activated() is not even called for me

view this post on Zulip caleb parks (Jan 05 2018 at 16:30):

I can confirm that the model is not rendering for me either. the signal QTreeView::activated did not get activated.

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:30):

I think maybe it's because QWidget* parentis null

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:31):

In MainWIndow::MainWIndow, calling std::cout << (parent == 0 ? " 0" : "1") << std::endl; prints 0

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 16:34):

The MainWindow's parent should be 0 because otherwise it wouldn't be the main window but its parent. This shouldn't be the issue. That Activated() won't be called is one.

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:34):

Yeah, actually no thats not the problem, I just tested with my original version and its parent is also 0

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 16:36):

Maybe it's a C++11 thing. The connect() statement in ObjectsTreeView's constructor uses a C++11 idiom.

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 16:37):

You could try to set set (CMAKE_CXX_STANDARD 11) in rt^3's main CMakelists.txt. (I wonder what happens then.)

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:38):

Oh

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:38):

Okay, it turns out that selecting it and then pressing enter works

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:39):

Seems like clicking it is not enough for it to be considered as "activated"

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:40):

http://doc.qt.io/qt-5/qabstractitemview.html#activated
"How to activate items depends on the platform; e.g., by single- or double-clicking the item"
I think it may be because our OS is different, the way to activate it is also different.

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 16:41):

Does a double-click work?

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:42):

Double-clicking goes into the renaming mode of that particular item

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 16:43):

Strange OS ;)

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:43):

What does double-clicking it do for you?

view this post on Zulip caleb parks (Jan 05 2018 at 16:45):

So It will work with single click when you connect the Activated slot to the clicked signal in the tree view

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 16:45):

Renaming too ;)
But, usually you have the choice in the systems settings if a single or a double click should select an element. Standard for Linux should be a single click.

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 16:48):

@caleb parks In principle yes, but is this what the user expects? If highlighting an entry without activating it makes sense it could be a problem. However, in this particular case ...

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:50):

Maybe something like adding a "raytrace" button will do for now?

view this post on Zulip Jeff Sieu (Jan 05 2018 at 16:51):

Or should it use something like http://doc.qt.io/qt-5/qitemselectionmodel.html#currentRowChanged

view this post on Zulip caleb parks (Jan 05 2018 at 16:51):

also it would be good to set the elements in the tree to were you can't edit the text inside

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 16:51):

The ray-trace will be always done, but in your case with an empty selection. Using the clicked() signal could be a solution for this.

view this post on Zulip Daniel Rossberg (Jan 05 2018 at 16:52):

... Whatever, there is something to improve ;)

view this post on Zulip Mahdi (Jan 06 2018 at 00:28):

Has everyone else been able to build the new GUI without any errors? I ran svn up on my rt^3 directory but I get "class QImage no member named 'setPixelColor (but it does)." I'm running on Ubuntu.

view this post on Zulip Mahdi (Jan 06 2018 at 00:54):

Okay turns out the function was introduced with qt 5.6 so it wont build with anything older

view this post on Zulip Tushar Mohan (Jan 06 2018 at 04:04):

Hey Everyone !! I'm participating in GCI and need some help

view this post on Zulip Jeff Sieu (Jan 06 2018 at 04:54):

Yep I've had this problem too

view this post on Zulip Jeff Sieu (Jan 06 2018 at 04:55):

@Tushar Mohan Can you elaborate more on what you need help with?

view this post on Zulip Tushar Mohan (Jan 06 2018 at 06:11):

I am doing the BRL-CAD task which says to build the example program with MS Visual studio, how is that to be done ? as i have downloaded the MGED and Archer softwares through the link given but did't get any included example program

view this post on Zulip Sean (Jan 06 2018 at 06:17):

can you provide a link to your task?

view this post on Zulip Sean (Jan 06 2018 at 06:18):

if there's an example program mentioned, the task description will say where it's at (unless it's a follow-on task that assumes you did earlier tasks)

view this post on Zulip Mahdi (Jan 06 2018 at 16:11):

Hey, could I suggest adding QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); to the main before creating an application? It can resolve issues with larger screens

view this post on Zulip Daniel Rossberg (Jan 06 2018 at 16:22):

There is a task for such suggestions.

view this post on Zulip caleb parks (Jan 07 2018 at 21:47):

how do I make a patch file for for alternative GUI task 8.1?

view this post on Zulip Mahdi (Jan 07 2018 at 22:50):

You may wish to refer to this https://brlcad.org/wiki/Patches

view this post on Zulip Jeff Sieu (Jan 08 2018 at 01:02):

simply do

svn diff > <patch file name>

view this post on Zulip caleb parks (Jan 08 2018 at 21:22):

I don't know what I am doing wrong. when I try to select an element without unselecting all, the element is not selected but when I try to select elements after unselecting all it selects the element. I am working in the qtGui program in the rt^3 branch. here is my code:
Screen-Shot-2018-01-08-at-3.20.33-PM.png

view this post on Zulip Jeff Sieu (Jan 09 2018 at 10:40):

Yup, this problem is pretty for me as well.

view this post on Zulip Daniel Rossberg (Jan 10 2018 at 18:43):

@caleb parks When you say that you want to translate a point you must include which point (i.e. x_1, y_1, z_1, this can be described with formulas from given values) to which other point (x_2, y_2, z_2).

view this post on Zulip Jeff Sieu (Jan 10 2018 at 23:22):

this problem is there* oops. But maybe it's a beautiful problem too :stuck_out_tongue:

view this post on Zulip caleb parks (Jan 11 2018 at 13:52):

do matrixes apply operations on the vector you are mapping to in the reverse order you declare the operations?

view this post on Zulip Mahdi (Jan 13 2018 at 02:28):

Hey @Daniel Rossberg what do you think about adding a settings file to store the information of the user? That way the user can always have the file manager looking in the right directory, can save their work space locations, etc..

view this post on Zulip Daniel Rossberg (Jan 13 2018 at 14:31):

Done: GUI 8.7

view this post on Zulip Mahdi (Jan 15 2018 at 17:40):

@Daniel Rossberg Will we be able to contribute to the alternative GUI after the contest ends? If we can, must we use sourceforge? I keep having issues trying to sign in (probably because of their new website). I was working on a couple of features for the program but unfortunately ran out of time to send it in as a task.

view this post on Zulip Daniel Rossberg (Jan 15 2018 at 20:11):

@Mahdi Usually https://sourceforge.net/p/brlcad/patches/ would be the place to talk about patches. Have a look at the closed tickets to get an impression about how this looks like. If this don't work, you can open a thread in our developer mailing list.

view this post on Zulip Mahdi (Jan 15 2018 at 20:30):

okay thanks

view this post on Zulip Sean (Jan 16 2018 at 07:12):

the general practice with patches is after 2 that require no technical changes, you could actually be offered commit rights, which would let you work directly on the code with other devs

view this post on Zulip Sean (Jan 16 2018 at 07:12):

of course, depends on a lot of factors, but it's certainly happened before

view this post on Zulip Mahdi (Jan 21 2018 at 00:30):

Do you guys wanna list some ideas you've had for the QT gui? I'm planning on working on it over the next couple of months and would appreciate it if we any of the other students interested would give/receive feedback.

view this post on Zulip Jeff Sieu (Jan 21 2018 at 03:15):

I feel that adding Ctrl Drag to rotate like in most 3D modelling applications would be a neat functionality to add

view this post on Zulip Jeff Sieu (Jan 21 2018 at 03:17):

Or progressive ray tracing, not sure what it's called. It will be better if the updated ray trace can show up immediately, albeit not that clear, rather than waiting for the whole thing to finish then displaying it

view this post on Zulip caleb parks (Jan 21 2018 at 03:29):

you could also draw the objects not by raytracing but by getting the objects then drawing them using opengl, but honestly that would be a huge project by it's self because you would have to go through each type of object to get the vertices or use some other way to get the vertices in order to render.

view this post on Zulip Mahdi (Jan 21 2018 at 15:24):

@Sean @Daniel Rossberg revamp.patch

view this post on Zulip Mahdi (Jan 21 2018 at 15:24):

This patch adds persistent settings and allows for multiple files to be opened and closed

view this post on Zulip Sean (Jan 21 2018 at 15:24):

thanks, will check it out

view this post on Zulip Mahdi (Jan 21 2018 at 15:26):

I was talking about that back when GCI started and Daniel said that we might be able to use QT3D for a wire frame representation and then have a different option for raytracing @Jeff Sieu @caleb parks

view this post on Zulip Mahdi (Jan 21 2018 at 15:27):

Currently raytracing isn't a very smooth process so if we could have a wireframe representation and then another option for detailed raytracing that might be better

view this post on Zulip Mahdi (Jan 21 2018 at 15:29):

The QT3D framework has a bunch of convenience functions that will enable rotation and transformations so we won't have to implement all of that ourselves

view this post on Zulip Mahdi (Jan 21 2018 at 15:32):

It's either that or we have to create a buffer image

view this post on Zulip Mahdi (Jan 21 2018 at 15:35):

@Sean What do you think about using QT3D for the graphics view / area? If I can get confirmation that it would be applicable I'll attempt to work on it

view this post on Zulip Sean (Jan 21 2018 at 16:06):

there's no reason ray tracing can't be smooth -- I built a test interface just last week demonstrating it

view this post on Zulip Sean (Jan 21 2018 at 16:07):

i'd like to hear what @Daniel Rossberg has in mind, but I know both can work just fine and the long-term is likely a combination of both

view this post on Zulip Sean (Jan 21 2018 at 16:07):

so for now, it's probably more one of priorities of getting one thing working well, whatever that thing is

view this post on Zulip Daniel Rossberg (Jan 21 2018 at 16:59):

@Mahdi ragarding revamp.patch

view this post on Zulip Daniel Rossberg (Jan 21 2018 at 17:15):

I agree with @Sean : On the long term the GUI had to be able to handle both. But, still being in a state of missing basic functionality, it's better to stay with one use. You should aim for getting the ray-trace working well for now. With the current QtGUI you can draw ray-trace images, but it's still rough. There were some ideas of what could be improved here in this thread.

view this post on Zulip Mitesh (Jan 23 2018 at 15:52):

I would like to learn QT...how should i start?

view this post on Zulip Sean (Jan 24 2018 at 06:10):

start with a basic tutorial, like https://wiki.qt.io/Basic_Qt_Programming_Tutorial

view this post on Zulip Sean (Jan 24 2018 at 06:11):

then something a little more complicated like https://wiki.qt.io/Qt_for_Beginners

view this post on Zulip Daniel Rossberg (Jan 26 2018 at 18:52):

I went through the QtGUI sources and set up a build which links them to the brlcad.dll: https://github.com/drossberg/BrlCadQtGUI You hopefully only have to point it to your Qt installation and it should compile (on Windows). With my commercial build of the Qt libraries I got QtGUI.zip .

view this post on Zulip Siddharth (Jan 28 2018 at 06:12):

I'm gonna start learning QT

view this post on Zulip Naseef (Aug 12 2018 at 01:28):

Should we use Gtk instead of Qt?

view this post on Zulip Naseef (Aug 12 2018 at 01:32):

Gtk is the native GUI toolkit for most Linux distributions (except few that has KDE or LxQt). I think it's better to create the application with native tools instead of Qt. Gtk also works well on other platforms too, I've compiled Gtk apps for Windows, they run fine. We can also have a few lines of platform specific code to make things feel more native (like file management, notifications, etc.).

view this post on Zulip Sean (Aug 13 2018 at 18:39):

@Naseef I'm not a fan of Gtk's architectural design. gtk applications typically look very awkward on non-*nix platforms, and dependency-wise, gtk pulls in a crapton of dependencies. Qt on the other hand architecturally aims to preserve native appearance and behavior with minimal/no dependencies.


Last updated: Oct 09 2024 at 00:44 UTC