where could I find documentation to use the c++ core interface?
while im not sure whether there is documentation, i was able to figure it out by digging through the coreinterface .cpp and .h files
You can go take a look at rt3/include/brlcad/ConstDatabase.h
and rt3/include/brlcad/cicommon.h
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.
For an introduction in the C++ core interface you can look at http://brlcad.org/wiki/BRL-CAD%27s_core_C%2B%2B_interface
in the hit class in the constDatabase what is the difference between SurfaceNormalIn() and SurfaceNormalOut()?
@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())
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.
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 ...
How is a ray trace performed in the combined GUI?
@Jeff Sieu you mean in archer?
Nope, I'm referring to the newly added "QtGUI" in the rt^3 repo
ahh, that I don't know yet
@Jeff Sieu What do you mean? Where in the code or what to do to see something? The "how" would be with rt_shootray().
I mean in this
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?
Regarding "this": Open a .g file, select an element and hit "Reset".
Oh, well that's rather unintuitive, never thought of actually clicking the only button available.
I can't seem to see any output.
Do you have a screen shot?
Is it ok if I submit a patch file with improvements to QtGUI to qt 7?
Or will there possibly be a QT8 task for this?
Did you hit Reset after selecting all.g?
Yep I most definitely did.
If hitting Reset resets the Projection Settings in order to raytrace, what is the purpose of Projection Settings?
It doesn't look like that. The Zoom should be much smaller than 1.
hmm thats weird, it resets to 1 for me
Reset centers the model in the drawing area.
Oh, so will changing the settings update the raytrace right away?
A new ray-trace will be started then, right.
I should look like this then:
screen shot
What happens when you set the values on the right side by hand?
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.
If the background of the raytrace here is blue, at least the background of mine should also turn blue, but it doesn't.
Weird.
The blue thing isn't the background but the table. The background is always white.
Wait, do you have moss.g opened in mged or archer in parallel?
Nope
I just tried with some other .g file that I've never opened before, and nothing shows up either.
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
You work on a Mac?
Ubuntu 16.04
OK, I've a Debian 9 "stretch" with Qt 5.7.1 here.
Mine is Qt 5.7.0, but I presume it shouldn't really matter much
This is what I would have thought too ...
But it seems rather peculiar that the coordinates and zoom are set to integers by default
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?
Ok, I'll do some debugging
Seems like ObjectsTreeVIew::Activated()
is not even called for me
I can confirm that the model is not rendering for me either. the signal QTreeView::activated did not get activated.
I think maybe it's because QWidget* parent
is null
In MainWIndow::MainWIndow
, calling std::cout << (parent == 0 ? " 0" : "1") << std::endl;
prints 0
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.
Yeah, actually no thats not the problem, I just tested with my original version and its parent is also 0
Maybe it's a C++11 thing. The connect() statement in ObjectsTreeView's constructor uses a C++11 idiom.
You could try to set set (CMAKE_CXX_STANDARD 11)
in rt^3's main CMakelists.txt. (I wonder what happens then.)
Oh
Okay, it turns out that selecting it and then pressing enter works
Seems like clicking it is not enough for it to be considered as "activated"
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.
Does a double-click work?
Double-clicking goes into the renaming mode of that particular item
Strange OS ;)
What does double-clicking it do for you?
So It will work with single click when you connect the Activated slot to the clicked signal in the tree view
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.
@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 ...
Maybe something like adding a "raytrace" button will do for now?
Or should it use something like http://doc.qt.io/qt-5/qitemselectionmodel.html#currentRowChanged
also it would be good to set the elements in the tree to were you can't edit the text inside
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.
... Whatever, there is something to improve ;)
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.
Okay turns out the function was introduced with qt 5.6 so it wont build with anything older
Hey Everyone !! I'm participating in GCI and need some help
Yep I've had this problem too
@Tushar Mohan Can you elaborate more on what you need help with?
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
can you provide a link to your task?
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)
Hey, could I suggest adding QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
to the main before creating an application? It can resolve issues with larger screens
There is a task for such suggestions.
how do I make a patch file for for alternative GUI task 8.1?
You may wish to refer to this https://brlcad.org/wiki/Patches
simply do
svn diff > <patch file name>
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
Yup, this problem is pretty for me as well.
@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).
this problem is there* oops. But maybe it's a beautiful problem too :stuck_out_tongue:
do matrixes apply operations on the vector you are mapping to in the reverse order you declare the operations?
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..
Done: GUI 8.7
@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.
@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.
okay thanks
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
of course, depends on a lot of factors, but it's certainly happened before
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.
I feel that adding Ctrl Drag to rotate like in most 3D modelling applications would be a neat functionality to add
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
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.
@Sean @Daniel Rossberg revamp.patch
This patch adds persistent settings and allows for multiple files to be opened and closed
thanks, will check it out
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
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
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
It's either that or we have to create a buffer image
@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
there's no reason ray tracing can't be smooth -- I built a test interface just last week demonstrating it
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
so for now, it's probably more one of priorities of getting one thing working well, whatever that thing is
@Mahdi ragarding revamp.patch
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.
I would like to learn QT...how should i start?
start with a basic tutorial, like https://wiki.qt.io/Basic_Qt_Programming_Tutorial
then something a little more complicated like https://wiki.qt.io/Qt_for_Beginners
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 .
I'm gonna start learning QT
Should we use Gtk instead of Qt?
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.).
@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: Jan 10 2025 at 00:48 UTC