Stream: brlcad

Topic: qged


view this post on Zulip starseeker (Jun 25 2020 at 13:07):

@Sadeep Darshana I finally got a Windows build of qged, and I can confirm I see the same errors. The _close bit is definitely coming from our config_win.h "#define close _close", so I need to track down where we're getting common.h into the mix.

view this post on Zulip Sadeep Darshana (Jun 25 2020 at 17:27):

Is it working in the current revision?

view this post on Zulip starseeker (Jun 25 2020 at 19:05):

No, not yet - I need to drill in a bit and figure out where the various problems are coming from.

view this post on Zulip starseeker (Jun 25 2020 at 19:06):

As an interim measure you might try setting up a small test application that just exercises the accordion widget in isolation

view this post on Zulip starseeker (Jun 25 2020 at 19:06):

It's not supposed to be tied to qged specifically, so if it is that'd be something to fix

view this post on Zulip starseeker (Jun 25 2020 at 19:31):

r76204 may help the qged build - it's not tested on Windows yet

view this post on Zulip Sadeep Darshana (Jun 25 2020 at 19:38):

I'll check.
Btw @starseeker what is qged? I'm curious because it might help the project I'm working on.

view this post on Zulip starseeker (Jun 25 2020 at 19:42):

It's an effort I made some years ago to frame out an Archer-like graphical interface in Qt. It was a relatively quick effort - ~2-3 weeks work all told. I had just taken a training course and wanted to apply what I'd learned while still fresh.

It doesn't have the most important piece - a display manager/framebuffer widget for the central view - but it has the beginnings of a tree view, a console widget, and tool palette buttons similar to those in in the GNU image manipulation program and similar tools which are intended to eventually offer up various interactive tool selection and control features.

view this post on Zulip starseeker (Jun 25 2020 at 19:43):

Can also display man pages in an html widget - "man search" will work, although the color scheme is a bit weird right now because I overrode the style sheets globally to get that grey look.

view this post on Zulip starseeker (Jun 25 2020 at 19:44):

Most of what's in there is "proof of concept" stage, and will need considerable refinement and polish to be truly useful.

view this post on Zulip starseeker (Jun 25 2020 at 19:45):

The console widget experiments with using html widgets to display output - it has a cute trick where search full path outputs (i.e. from "search /") can be clicked on to open and select the corresponding instances in the tree view.

view this post on Zulip Sadeep Darshana (Jun 25 2020 at 19:49):

Cool. Sounds like it will be helpful to me.

view this post on Zulip starseeker (Jun 25 2020 at 19:52):

The work I just committed to trunk is intended (among other things) to set the stage for a Qt based dm/fb backend plugin and widget that can form the central widget of the qged interface. There's not much Qt specific work as yet (and what is there probably doesn't work now, if it ever did) but the ground should now be prepared.

view this post on Zulip Sadeep Darshana (Jun 25 2020 at 20:14):

great, I will have a look. I was working on a qt based DM too.

view this post on Zulip Sadeep Darshana (Jun 25 2020 at 20:15):

What I have build so far is a lot simpler than what you'd find in a DM in libdm though

view this post on Zulip starseeker (Jun 25 2020 at 20:17):

Here's a quick visual demo of what's currently in qged (once it compiles - this is from a Linux machine)
https://brlcad.org/~starseeker/qged_demo.gif

view this post on Zulip Sadeep Darshana (Jun 25 2020 at 20:21):

Wow, that is great. I didn't know this existed

view this post on Zulip Sadeep Darshana (Jun 25 2020 at 20:22):

I just created a simple thing that displays the geometry image.png

view this post on Zulip Sadeep Darshana (Jun 25 2020 at 20:23):

can rotate zoom move

view this post on Zulip starseeker (Jun 25 2020 at 20:26):

Cool - maybe you can get that to embed as the central widget

view this post on Zulip Sadeep Darshana (Jun 25 2020 at 20:30):

yeah, I'll try to do that

view this post on Zulip starseeker (Jun 25 2020 at 20:49):

OK, I think I see - it's not the header order specifically, but simply the combination. Hmm...

view this post on Zulip starseeker (Jun 25 2020 at 21:31):

Just learned a useful trick for showing the include tree with MSVC: https://stackoverflow.com/a/1138045

view this post on Zulip Sean (Jun 25 2020 at 21:33):

+1

view this post on Zulip starseeker (Jun 25 2020 at 22:15):

@Sadeep Darshana OK - I haven't cleared the qmath.h warnings, but I think I've gotten the out-and-out errors - I managed to get a build on MSVC 2017 of qged with what should be an equivalent to r76208

view this post on Zulip starseeker (Jun 25 2020 at 23:30):

Actually, scratch that - I made those changes in trunk, not the branch. Blegh. Time to merge qged back into trunk - it won't do any harm behind BRLCAD_ENABLE_QT, and it'll save these merge issues...

view this post on Zulip starseeker (Jun 26 2020 at 01:08):

@Sadeep Darshana OK. If you check out the latest trunk, and configure with -DBRLCAD_ENABLE_QT=ON you should get qged to build. If you're still having problems I'll go another round with it, but we should be closing in.

The old Qt libdm/fb code was never working properly from what I can tell, and anyway it was an attempt to hybridize Tk and Qt which is definitely not what we want for this. There may be a couple useful bits in there somewhere, but I wouldn't worry too much about trying to work with it - a clean Qt only start would probably be more effective.

view this post on Zulip Sadeep Darshana (Jun 26 2020 at 07:38):

I built qged in the trunk on windows

view this post on Zulip Sadeep Darshana (Jun 26 2020 at 23:10):

@starseeker I'm adding the dm to qged. No major changes to the project. You should be able to replace easily later once you decide to work on the dm.

view this post on Zulip starseeker (Jun 26 2020 at 23:10):

@Sadeep Darshana excellent!

view this post on Zulip Sadeep Darshana (Jun 26 2020 at 23:11):

It should be working but some weird bugs came up. Something related to lists I guess. I'll fix this and let you know.

view this post on Zulip starseeker (Jun 26 2020 at 23:13):

Hmm... initialization failure. It may be that qged isn't doing an initialization step your stand-alone app did?

view this post on Zulip Sadeep Darshana (Jun 26 2020 at 23:14):

you mean BU_LIST_INIT(&vhead); right?

view this post on Zulip starseeker (Jun 26 2020 at 23:15):

that's the low level error - it cropped up in rt_arb_plot, which is presumably trying to write out its data to a plotting list. There are some global initialization that need to happen for that to work IIRC, but qged wouldn't have done any of them since it wasn't drawing anything

view this post on Zulip starseeker (Jun 26 2020 at 23:17):

Although if you're using a local vlist that should avoid the globals... hmm

view this post on Zulip starseeker (Jun 26 2020 at 23:17):

@Sadeep Darshana where's your code located?

view this post on Zulip Sadeep Darshana (Jun 26 2020 at 23:18):

Just my computer. I'm working on a the main repo, trunk, qged folder.

view this post on Zulip starseeker (Jun 26 2020 at 23:19):

Ah, OK. Was going to take a look, but that's not practical :-)

view this post on Zulip Sadeep Darshana (Jun 26 2020 at 23:19):

Is there an area I should look into?

view this post on Zulip Sadeep Darshana (Jun 26 2020 at 23:20):

is this global initialization thing not necessary for local lists?

view this post on Zulip starseeker (Jun 26 2020 at 23:20):

Worst case, follow a draw command from mged through libged to librt and see how the variables it uses are initialized. That's probably a bit extreme, but it'll work as a fallback

view this post on Zulip starseeker (Jun 26 2020 at 23:25):

bn_vlblock might be relevant here, actually.

view this post on Zulip Sadeep Darshana (Jun 26 2020 at 23:26):

I did just that. I compared how the same plot method works is my project vs my slightly changed implementation in qged. It crashes only in qged. However I couldn't go beyond arb8::rt_arb_plot::1185 since rest of it goes through C macros and not normal function calls.

I'll fix this and let you know. Just tell me if any global level initialization are necessary before using lists other than (BU_LIST_INIT(&vhead)).

view this post on Zulip starseeker (Jun 26 2020 at 23:26):

src/util/plot3-dm.c might be helpful

view this post on Zulip starseeker (Jun 26 2020 at 23:28):

@Sadeep Darshana if you can commit your code anywhere, I might be able to help a bit more... the drawing code is a bit obtuse, if I can get gdb on it that would be better...

view this post on Zulip starseeker (Jun 26 2020 at 23:32):

BU_LIST_INIT(&RTG.rtg_vlfree);

the above might be worth a shot - found a note about that in some similar code

view this post on Zulip starseeker (Jun 26 2020 at 23:33):

specifically mentions the ft_plot() functions, in fact

view this post on Zulip starseeker (Jun 26 2020 at 23:36):

Or it looks like you can call rt_vlblock_init and get back a struct bn_vlblock from RTG.

view this post on Zulip starseeker (Jun 26 2020 at 23:38):

@Sadeep Darshana Maybe something like:

struct bn_vlblock *vbp = rt_vlblock_init();
ip->idb_meth->ft_plot(vbp, ip, tsp->ts_ttol, tsp->ts_tol, 0)

view this post on Zulip Sadeep Darshana (Jun 26 2020 at 23:39):

thanks, I'll try them

view this post on Zulip Sadeep Darshana (Jun 26 2020 at 23:44):

starseeker said:

BU_LIST_INIT(&RTG.rtg_vlfree);

the above might be worth a shot - found a note about that in some similar code

Apparently this fixed it.

view this post on Zulip Sadeep Darshana (Jun 26 2020 at 23:46):

There is a global initializer before using lists. Who'd have thought that

view this post on Zulip starseeker (Jun 27 2020 at 00:18):

Well, drawing lists specifically. RTG is one of those warts we eventually want to get rid of, but it'll be a job to get it out. Lot of API will have to change to no longer assume a global.

view this post on Zulip Sadeep Darshana (Jun 27 2020 at 01:32):

added the DM to qged dm.gif

view this post on Zulip starseeker (Jun 27 2020 at 01:38):

That's AWESOME!!

view this post on Zulip Sean (Jun 27 2020 at 03:51):

Indeed, way cool @Sadeep Darshana -- What's something like havoc.g look like?

view this post on Zulip Sean (Jun 27 2020 at 04:02):

Sadeep Darshana said:

There is a global initializer before using lists. Who'd have thought that

Yeah, it's nutters. It was done for not insignificant performance reasons. Reasons unlikely as important today as they were years ago, but probably still giving a boost on big models. A bit of work to fix it.

view this post on Zulip Sadeep Darshana (Jun 27 2020 at 08:00):

Sean said:

What's something like havoc.g look like?

havoc.gif

I had the desired top object name hard coded into the dm in both cases since it has not been implemented to cooperate with the tree view

view this post on Zulip starseeker (Jun 27 2020 at 14:01):

@Sadeep Darshana can we get the code anywhere to try it ourselves?

view this post on Zulip Sadeep Darshana (Jun 27 2020 at 15:56):

shall I upload it to github?
or I can send you the svn diff files? @starseeker

view this post on Zulip starseeker (Jun 27 2020 at 16:31):

Either way - whatever's easier

view this post on Zulip starseeker (Jun 27 2020 at 16:32):

an svn diff I should be able to apply to trunk as a patch, which would make it easier to commit

view this post on Zulip starseeker (Jun 27 2020 at 22:30):

@Sadeep Darshana if the qged code is significantly different from the coreInterface code, an svn patch probably makes the most sense - for coreInterface git would be better

view this post on Zulip Sadeep Darshana (Jun 28 2020 at 14:59):

hey @starseeker just give me an hour, Im making some changes to make the code look more consistent with the current existing codes

view this post on Zulip starseeker (Jun 28 2020 at 15:47):

@Sadeep Darshana sounds good!

view this post on Zulip Sadeep Darshana (Jun 28 2020 at 16:02):

I'm using glm for camera. If we actually decide to go with my implementation, glm should ideally be place in src/other/. I'm placing it under qged directory for the moment.

view this post on Zulip starseeker (Jun 28 2020 at 16:22):

@Sadeep Darshana that should be fine

view this post on Zulip Sadeep Darshana (Jun 28 2020 at 22:32):

qged_display_manager_patch_r76220.patch

view this post on Zulip Sadeep Darshana (Jun 28 2020 at 22:33):

I had to make some changes

view this post on Zulip Sadeep Darshana (Jun 28 2020 at 22:33):

the patch is big because of glm

view this post on Zulip Sadeep Darshana (Jun 28 2020 at 22:35):

@starseeker let me know if you plan to integrate this into qged. I was using qtNaming.

view this post on Zulip starseeker (Jun 29 2020 at 02:06):

@Sadeep Darshana I'm trying it on Linux now - the code is tripping a few GCC warnings.

view this post on Zulip starseeker (Jun 29 2020 at 02:07):

What I would suggest, if it's OK with you, is for me to get it building here, I'll commit it to trunk (crediting you in the commit message), and then have you make another pass to produce a second patch to fix any Windows issues I might have inadvertently introduced while working on it with Linux.

view this post on Zulip starseeker (Jun 29 2020 at 02:08):

I'll strip glm down somewhat - we'll only need the headers themselves and the license/readme files, we can skip the tests and such.

view this post on Zulip starseeker (Jun 29 2020 at 02:25):

@Sadeep Darshana What database should I open to test this? I got it to compile, and it opens a .g file and displays the axis, but it doesn't seem to draw the wireframes (or do I need to zoom to see them?)

view this post on Zulip Sadeep Darshana (Jun 29 2020 at 04:38):

starseeker said:

What I would suggest, if it's OK with you, is for me to get it building here, I'll commit it to trunk (crediting you in the commit message), and then have you make another pass to produce a second patch to fix any Windows issues I might have inadvertently introduced while working on it with Linux.

This is great

view this post on Zulip Sadeep Darshana (Jun 29 2020 at 04:39):

starseeker said:

Sadeep Darshana What database should I open to test this? I got it to compile, and it opens a .g file and displays the axis, but it doesn't seem to draw the wireframes (or do I need to zoom to see them?)

Did you zoom out and see? It does not have autoview yet.

view this post on Zulip Sadeep Darshana (Jun 29 2020 at 04:50):

You can use the controls in Display.h. For zooming its mouse wheel.

view this post on Zulip Sadeep Darshana (Jun 29 2020 at 04:52):

goliath.g works without zooming

view this post on Zulip starseeker (Jun 29 2020 at 13:34):

Huh. Odd. The axis draw, but none of the object wireframes do. @Sadeep Darshana I'll commit the current state to trunk - can you check whether, it works for you? I've tried to be minimal about the changes I've made - some of them have to be considered temporary, in fact - but I don't think I changed any of the significant logic...

view this post on Zulip Sadeep Darshana (Jun 29 2020 at 13:37):

sounds good

view this post on Zulip Sadeep Darshana (Jun 29 2020 at 13:40):

Let me know when I can get it on the trunk. Also do you think it is better if I change the naming convention to qged?

view this post on Zulip starseeker (Jun 29 2020 at 13:41):

It'll be in a few minutes - trying to commit now

view this post on Zulip starseeker (Jun 29 2020 at 13:41):

Not too worried about naming right now - functionality is most critical

view this post on Zulip Sadeep Darshana (Jun 29 2020 at 13:50):

also what is your environment?

view this post on Zulip starseeker (Jun 29 2020 at 14:04):

Ubuntu linux, gcc compiling

view this post on Zulip starseeker (Jun 29 2020 at 14:05):

It's committed to trunk now - r76234

view this post on Zulip starseeker (Jun 29 2020 at 14:06):

@Sadeep Darshana I've had decent luck setting up virtual machines with VirtualBox, if you want to give that a go and have the hard disk space for it...

view this post on Zulip Sadeep Darshana (Jun 29 2020 at 14:15):

I have ubuntu installed in the machine. I will download qt and setup.

view this post on Zulip starseeker (Jun 29 2020 at 14:58):

@Sadeep Darshana Sounds good. It's presumably something small, since the axis draw and zoom works (If I zoom out far enough the axis will shrink and vanish)

view this post on Zulip starseeker (Jun 29 2020 at 14:59):

I stepped through a debugger once and it did seem to be walking the tree and calling drawSolid, but I didn't get deeper than that.

view this post on Zulip Sadeep Darshana (Jun 29 2020 at 20:47):

I'm installing a VM since it is easier than switching OSes. Trunk's working fine in my windows machine. One distinction between axes and the wireframes is that axes are rendered with GL_LIGHTING off while the other with light.

view this post on Zulip starseeker (Jun 30 2020 at 02:35):

Removing GL_LIGHTING doesn't change anything here, as far as I can tell.

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 11:12):

l.png Can you tell me more about your setup? @starseeker
Trunk/qged on Ubuntu 20.04 on Virtual Box, Qt 5.14.2

GPU? Qt version, Ubuntu version?

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 11:12):

I'll setup everything as similar to you and test

view this post on Zulip starseeker (Jun 30 2020 at 12:38):

Weird. Maybe it's the NVIDIA GPU drivers.

view this post on Zulip starseeker (Jun 30 2020 at 12:38):

Let me try in a VM myself - if it works there then it's my setup here.

view this post on Zulip starseeker (Jun 30 2020 at 12:43):

Qt is version 5.12.8, same Ubuntu version

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 12:54):

I implemented a not-well-optimized immediate mode (no display lists). Will send you a patch. Axes don't use display lists.

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 12:54):

before that let me try on nvidia, i was trying on intel graphics

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 12:57):

it works on nvidia graphics, windows
I did not try Ubuntu+nvidia combination, will try that.

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:00):

Feel free to implement a new DM if you are planning :smiley:

view this post on Zulip starseeker (Jun 30 2020 at 13:00):

Heh.

view this post on Zulip starseeker (Jun 30 2020 at 13:02):

@Sadeep Darshana I'd probably be looking at something like https://github.com/Pseudomanifold/QtOSG

view this post on Zulip starseeker (Jun 30 2020 at 13:02):

Which is probably a different rabbit hole altogether

view this post on Zulip Sumagna Das (Jun 30 2020 at 13:03):

Sadeep Darshana said:

Feel free to implement a new DM if you are planning :smiley:

What do you guys mean by DM?

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:03):

display manger, the whole thing about dispalying stuff

view this post on Zulip starseeker (Jun 30 2020 at 13:04):

a backend implementation of the primitive graphical drawing operations

view this post on Zulip Sumagna Das (Jun 30 2020 at 13:04):

ooh

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:04):

Display list generation happens inside a SLOT. could this be the case?

view this post on Zulip starseeker (Jun 30 2020 at 13:05):

Not sure - that's the problem with these sorts of failures, so many issues have the same symptom (drawing failure)

view this post on Zulip starseeker (Jun 30 2020 at 13:06):

And it's even worse when it happens sometimes but not always

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:11):

debugging.patch

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:12):

This is a patch on top of current revision. Can you apply that and see if it fixes?

view this post on Zulip starseeker (Jun 30 2020 at 13:13):

Get a wireframe now, all red

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:13):

that is expected

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:13):

also change GeometryRenderer::immediateMode and see what happens?

view this post on Zulip Sumagna Das (Jun 30 2020 at 13:14):

you are using qt, right?

view this post on Zulip starseeker (Jun 30 2020 at 13:14):

Yes

view this post on Zulip starseeker (Jun 30 2020 at 13:14):

change it in display/GeometryRenderer.h?

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:14):

yes

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:14):

in the header

view this post on Zulip starseeker (Jun 30 2020 at 13:15):

Still works, same result

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:15):

wow

view this post on Zulip starseeker (Jun 30 2020 at 13:15):

Feels a bit faster

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:15):

GeometryRenderer.cpp uncomment line 45 and see, //glEnable(GL_LIGHTING);

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:16):

starseeker said:

Feels a bit faster

this is with display lists

view this post on Zulip starseeker (Jun 30 2020 at 13:16):

Now works with color

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:16):

problem was with SLOTS

view this post on Zulip starseeker (Jun 30 2020 at 13:17):

Do you want me to commit the change?

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:17):

yes

view this post on Zulip starseeker (Jun 30 2020 at 13:17):

coming up

view this post on Zulip Sumagna Das (Jun 30 2020 at 13:17):

where is the code hosted?

view this post on Zulip starseeker (Jun 30 2020 at 13:17):

@Sumagna Das it's in the main brlcad svn repository - you enable it with -DBRLCAD_ENABLE_QT=ON

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:17):

apparently we can't call opengl methods inside SLOTS, even if we call makeCurrent()

view this post on Zulip starseeker (Jun 30 2020 at 13:18):

Ah. Yeah, OpenGL isn't good at multithreading - IIRC it was one of the motivations for Vulkan

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:18):

mmm.

view this post on Zulip Sumagna Das (Jun 30 2020 at 13:19):

starseeker said:

Sumagna Das it's in the main brlcad svn repository - you enable it with -DBRLCAD_ENABLE_QT=ON

you mean if i add the option then the older gui will not be available or will the qt one be there along with the older one?

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:19):

let me know when you've committed, the immediate mode is not optimized. It ft_plots every frame

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:20):

no @Sumagna Das you have to build the target qged

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:20):

you can build it only if -DBRLCAD_ENABLE_QT=ON

view this post on Zulip Sumagna Das (Jun 30 2020 at 13:20):

ohh

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:20):

qged is a seperate project from archer or mged

view this post on Zulip starseeker (Jun 30 2020 at 13:22):

@Sadeep Darshana committed - I left the immediate mode off and the lighting on, let me know if you want that changed

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:23):

that's how it should be

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:24):

what needs to be changed now? maybe the camera has to be changed to something standard. I just coded the thing up.

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:28):

@starseeker do you have -Werror off somehow, I couldn't build it with gcc because child() is deprecated if (cnt && !idx.child(cnt-1, 0).isValid()) { (cadattributes.cpp:249)

had to change the lines

view this post on Zulip starseeker (Jun 30 2020 at 13:33):

@Sadeep Darshana Probably a different compiler version. What did you change it to? If you want to send me a patch I can commit it and credit you

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:34):

I just set the whole thing to false :sweat_smile:

view this post on Zulip starseeker (Jun 30 2020 at 13:36):

@Sadeep Darshana The next things that jump immediately to mind are:

  1. translate the old ogre/qt gui Camera implementation into something we can apply to this widget (that will let users switch between different camera modes easily, sort of like how freecad works)

  2. get autoview to work

  3. Enable the "draw" and "erase" commands

view this post on Zulip starseeker (Jun 30 2020 at 13:39):

@Sadeep Darshana Looks like the problem is this issue: https://doc.qt.io/qt-5/qmodelindex-obsolete.html

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:39):

I'll look at the ogre camera thing. We'll have to reimplement the logic, don't we? It's not like we can use ogre (same thing as https://www.ogre3d.org/ ??)

view this post on Zulip starseeker (Jun 30 2020 at 13:40):

@Sadeep Darshana I'll comment out for now, don't have time to dig into what we were doing there and why right now

view this post on Zulip starseeker (Jun 30 2020 at 13:40):

@Sadeep Darshana Correct. The trick is to extract the camera behaviors and translate them to what is needed for your widget

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:40):

no need, I'm using windows. I only needed to compile in gcc to look into the issue.

view this post on Zulip starseeker (Jun 30 2020 at 13:42):

Yes, many years ago there was an attempt to display Qt inside Ogre. We ended up going a different direction, but there was some nice work done to implement camera controls - we're hoping it can be used to guide a new implementation (small pieces may even be reusable, not sure)

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:43):

I will look into this

view this post on Zulip starseeker (Jun 30 2020 at 13:45):

Since it's based on the Ogre camera that part obviously won't be usable, but the methods implemented will define behaviors - those are what we want to capture in the new setup

view this post on Zulip starseeker (Jun 30 2020 at 13:48):

For example, https://sourceforge.net/p/brlcad/code/HEAD/tree/rt%5E3/trunk/src/g3d/CameraModeBlender.cxx has an injectKeyPressed method that identifies what to do with the -, +, Enter, etc. keys as far as manipulating the scene. We have no Ogre camera to control, but the Qt widget you've created can execute its equivalent operations in response to those same Qt actions.

view this post on Zulip starseeker (Jun 30 2020 at 13:49):

Eventually I'd like to have a toolbar control in one of the panels on the right that lets the user toggle between camera modes as an option, but first we need the camera controls themselves :-)

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:51):

I looked into these codes and tried to understand them earlier

view this post on Zulip starseeker (Jun 30 2020 at 13:51):

In the longer term it would also be nice to allow the user to define their own custom bindings (the way games do) to be saved and reloaded as their personal configuration. That's a more complex GUI and not worth trying right now, but I mention it as something to keep in mind when designing the implementation - allowing for pre-backed binding configurations and (eventually) custom configurations defined by users as well.

view this post on Zulip starseeker (Jun 30 2020 at 13:51):

If you feel it would be better to start from scratch that's fine - the key is to capture the behaviors

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:52):

it is better to implement the logic in those cameras

view this post on Zulip starseeker (Jun 30 2020 at 13:52):

Sounds good

view this post on Zulip starseeker (Jun 30 2020 at 13:54):

One additional quirk - if you drag the display window out of the main application (i.e. turn it into a floating window) the geometry disappears

view this post on Zulip starseeker (Jun 30 2020 at 13:55):

I can create an animation to demonstrate if that would be helpful

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:55):

lemme check

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:58):

I could reproduce this.

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 13:58):

are we planning to support multiple docs?

view this post on Zulip starseeker (Jun 30 2020 at 13:59):

Well, multiple views. If you run Archer you'll see an option for Multiview in one of the menus, for example

view this post on Zulip starseeker (Jun 30 2020 at 13:59):

In MGED you can "attach" multiple display windows

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 14:01):

is that many views (top, front, I have seen this in 3dmax) for the same database or multiple databases?

view this post on Zulip starseeker (Jun 30 2020 at 14:02):

many views for the same database (at least for now)

view this post on Zulip starseeker (Jun 30 2020 at 14:03):

We've got some work on the backend to do before we're really ready for multiple databases open at once - it's done in a few cases, but things like that librt global variable make it a tricky business.

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 14:05):

starseeker said:

One additional quirk - if you drag the display window out of the main application (i.e. turn it into a floating window) the geometry disappears

My first impression for this was due to the Display instance being destroyed and a new instance takes its place. But this is not the case I just debugged, it is the same. Apperently OpenGL context resets (displaylists are saved when db open)

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 14:06):

I'll fix this and post a patch

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 20:40):

I fixed this bug. Now there is another bug. When I dock the window back, sometimes it displays full black until the next paintGL event. (which happens when you click mouse inside the display / resize the screen / minimise / maximize).

I'll fix this and post both in a patch

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 20:51):

bug_fix.patch
Fixes the first bug. Pls check if it works and merge. Have to look at ads to fix the next

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 20:55):

@starseeker fwiw the -Werror thing also exists in cadtreemodel.cpp:803 (idx.child) same line as cadattributes.cpp which you have fixed and committed.

view this post on Zulip starseeker (Jun 30 2020 at 20:59):

Well, commented out and committed - need to check what the original intent was.

view this post on Zulip starseeker (Jun 30 2020 at 20:59):

bug_fix.patch is committed

view this post on Zulip starseeker (Jun 30 2020 at 21:00):

commented out the second one as well

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 21:02):

can you commit the other files in the patch too :slight_smile:

view this post on Zulip starseeker (Jun 30 2020 at 21:03):

They didn't look like they'd changed other than the timestamp - are you using that to keep track of what's changed?

view this post on Zulip starseeker (Jun 30 2020 at 21:04):

Oh, nevermind - removed it. My bad.

view this post on Zulip starseeker (Jun 30 2020 at 21:05):

One sec...

view this post on Zulip starseeker (Jun 30 2020 at 21:05):

Heh, sorry - there we go

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 21:05):

thanks

view this post on Zulip starseeker (Jun 30 2020 at 21:06):

Nice work, by the way - that detachable feature is going to make a very cool demo video once you're done!

view this post on Zulip Sadeep Darshana (Jun 30 2020 at 21:06):

ah

view this post on Zulip starseeker (Jun 30 2020 at 21:07):

If we end up using the advanced docking system long term, there are a couple things I'd like to try to get it to do it doesn't right now, but on the whole it looks like a significant improvement over the old Qt-included version.

view this post on Zulip starseeker (Jun 30 2020 at 21:53):

@Sadeep Darshana any thoughts on how we might do a "HUD" visual (heads-up display) in the Qt window? In MGED and Archer these would be the faceplate elements and the embedded framebuffer.

view this post on Zulip starseeker (Jun 30 2020 at 21:54):

(No problem if you've not considered such issues yet - seeing qged with a wireframe visualization is exciting, and gets me thinking about possibilities...)

view this post on Zulip Sadeep Darshana (Jul 01 2020 at 06:01):

you mean for things like scale, and viewing parameters?

view this post on Zulip starseeker (Jul 01 2020 at 13:24):

@Sadeep Darshana the embedded framebuffer (at least as currently implemented) doesn't scale - it's just invalidated and needs to be re-rendered if the view changes in any way. I was thinking more about how to present the rendered image in the dm window, the way we do in Archer via the toolbar buttons.

view this post on Zulip starseeker (Jul 01 2020 at 13:25):

Nevermind, more important right now to get the current pieces working.

view this post on Zulip starseeker (Jul 01 2020 at 13:27):

@Sadeep Darshana If you're having to delve deep into the qtads code, there are a couple improvements that it might make sense to make at the same time you're chasing down that black-window-on-redocking issue. If you're interested let me know and I can explain in more detail.

view this post on Zulip Sean (Jul 01 2020 at 21:15):

@Sadeep Darshana here's a page showing a screenshot of the input controls I mentioned: https://brlcad.org/wiki/User:Ralith


Last updated: Oct 09 2024 at 00:44 UTC