Stream: Google Summer of Code

Topic: New BRL-CAD GUI


view this post on Zulip Daniel Rossberg (Mar 14 2019 at 17:26):

@Sagen Soren

Thank You for the helpful response, looking into the project options I am hugely influenced by https://github.com/opencax/GSoC/issues/27 . I needed a head start in working with the codebase, since I am working for the first time with a huge code base

Supposing you already master to build BRL-CAD from source code, I recommend to have a look at the QtGUI: https://sourceforge.net/p/brlcad/code/HEAD/tree/rt%5E3/trunk/src/QtGUI/

This was a project of second last GCi. It was programmed by high-school students in a few days and demonstrates how a Qt based GUI can be programmed on top of the C++ core interface. This program and the C++ interface are rather clear, and could be used as a starting point for own experiments.

To build this program you have to check out the rt^3 trunk branch side-by-side with the brlcad trunk.

view this post on Zulip Sagen Soren (Mar 20 2019 at 02:36):

While using BRL-CAD I faced a problem. After a design when I am typing mged>rt it should have produced a 3D lighted solid model of the wireframe model. But instead the dialogue box opened, is full white and no solid model is shown. Can anyone help me out here by explaining why is this happening?

view this post on Zulip Sean (Mar 20 2019 at 02:42):

@Sagen Soren screenshot? from the sound of it, you're simply in unfamiliar territory -- if it's white, you're probably looking at some geometry that is filling the window. If you run the "autoview" command, it will auto-resize based on what is drawn. If you run the "who" command, you'll see a list of what objects are drawn.

view this post on Zulip Sagen Soren (Mar 20 2019 at 02:49):

Ohk. I will check it out.

view this post on Zulip Chetan Shinde (Mar 24 2019 at 13:53):

Guys reporting a bug.

Error-on-doxygen-module.png

While exploring the doxygen module i came across this bug.
Link to the bug.

http://brlcad.org/docs/doxygen-r64112/files.xhtml

view this post on Zulip Sean (Mar 25 2019 at 04:42):

@Chetan Shinde Thanks. Though I caution that the uploaded doxygen you're looking at there is r64112 ... and current sources are at r72738

Better to get an SVN checkout and browse the sources directly (and ask questions of course)

view this post on Zulip Daniel Rossberg (Apr 19 2019 at 13:37):

To the students who are interested in the New BRL-CAD GUI project: This task is about writing a new graphical user interface from scratch. As reference for what we think at, there is a link to high-school students CAD GUI designs created during Google Code-in the project idea description text.

We recommend to use Qt for the GUI elements. If you want to use something different, you need a very good reason to do so, and need to convince us.

There is already a Qt GUI for BRL-CAD, which was created during a number of Google Code-in tasks by high-school students: src/QtGUI in the rt^3 repository branch. I recommend to have a look at this and use it as a template for your own ideas because it solves three issues already: Integration into the CMake build, establishing the connections to the Qt and BRL-CAD (here: C++ coreInterface) libraries.

view this post on Zulip Sadeep Darshana (Apr 24 2019 at 17:11):

ui1.png

I want to open (or create) a .g file and display it inside this(qt app i created) application and do a very basic thing like making a sphere.

Any advises on how I should start? @Daniel Rossberg @Sean

view this post on Zulip Sadeep Darshana (Apr 24 2019 at 17:46):

how to add these features and build the basic scaffolding?

view this post on Zulip Daniel Rossberg (Apr 24 2019 at 19:22):

Again, I recommend to have a look at the src/QtGUI program in the rt^3 sub-repository. This demonstrates how to do a Qt based GUI inside BRL-CAD's CMake build system, and how to connect to a BRL-CAD library, here the C++ core interface.

view this post on Zulip Daniel Rossberg (Apr 24 2019 at 19:26):

With this C++ interface you can do very much everything you wrote about. For example, creating a new .g database can be done via opening a file-database with a yet not existing file or by saving an in-memory-database to a not yet existing file.

view this post on Zulip Sadeep Darshana (Apr 25 2019 at 07:48):

Where can I find coreinterface ?
/usr/bin/ld: cannot find -lcoreinterface

building QtGUI

view this post on Zulip Sadeep Darshana (Apr 25 2019 at 07:49):

@Daniel Rossberg

view this post on Zulip Daniel Rossberg (Apr 25 2019 at 13:40):

You have to check-out the rt^3 subrepository. See https://brlcad.org/wiki/SVN. The module is rt^3. Therefore the SVN URL is https://svn.code.sourceforge.net/p/brlcad/code/rt^3/trunk.

Check it out into a directory (usually named rt^3) parallel to your BRL-CAD brlcad checkout.

view this post on Zulip Daniel Rossberg (Apr 25 2019 at 13:41):

The coreinterface is included in the src directory there.

view this post on Zulip Sadeep Darshana (Apr 25 2019 at 16:56):

i have already put main brlcad and rt^3 in place preserving the directory hierarchy in a (root dir in my computer being 'code')
Main brlcad is working properly. Also installed it as mentioned in http://svn.code.sourceforge.net/p/brlcad/code/rt%5e3/trunk/README

In rt^3,
cmake works fine
Only when I try to build it gives

"[ 22%] Linking CXX executable ../../bin/QtGUI
/usr/bin/ld: cannot find -lcoreinterface
collect2: error: ld returned 1 exit status" @Daniel Rossberg

view this post on Zulip Sadeep Darshana (Apr 25 2019 at 16:59):

Linking with coreinterface is where it goes wrong

view this post on Zulip Sadeep Darshana (Apr 25 2019 at 18:33):

I managed to fix this, QTGUI is running

view this post on Zulip Sadeep Darshana (Apr 25 2019 at 18:54):

Within the GSoC period I'll be improving QtGui in rt^3 into a GUI that is fit to be shipped as a replacement to Archer and MGED, by adding the necessary features and giving it the look and feel of the Qt application I have already created (look screenshot in above the chat)

I am sending a proposal that will describe what I plan to do in detail, alone with the timeframe.

@Daniel Rossberg @Sean

view this post on Zulip Daniel Rossberg (Apr 25 2019 at 21:02):

@Sadeep Darshana You can copy the QtGUI directory to, for example, MyGUI and include this in your CMake build to do your experiments.

view this post on Zulip Daniel Rossberg (May 01 2019 at 13:01):

@Sadeep Darshana Please, read the comments for the methods in the header files. Object* BRLCAD::ConstDatabase::Get(const char* objectName) returns a copy of the objects. void BRLCAD::Database::Get(const char* objectName, ObjectCallback& callback) is intended for changing object properties.

How the process of creation, adjusting properties, and linking to a combination of an object can be implemented with the core interface can be seen here: https://brlcad.org/wiki/CoreInterface_Hallo_World_Example (on the example of a half space).

Forget the realtime rendering. Evaluating if this is even a theoretical option would be a GSoC project of its own. The closest one could do is to tessellate the model in triangle meshes and display them e.g. with OpenGL. The C++ interface provides the Facetize() method to get a triangulated boundary representation of the objects.
In addition, you could expect that the ray-trace provided by the C++ interface is the fastest available in the actual hardware and software environment.

Also, I wouldn't think about having a command window in the new GUI. @Sean may however have another opinion here.
The BRL-CAD command lines are in fact TCL shells, and TCL is a Moloch. One could argue that BRL-CAD users are used to the command line interface, but what else could they use to create the models?
Some commercial CAD programs provide a command line interface as well, but these are intended for plugins and automating tasks.

view this post on Zulip Sean (May 02 2019 at 17:30):

There doesn't need to be a command window (or panel or similar dedicated space) with a new GUI. I think we will eventually want to expose libged commands in some form, but that can be trivially added later -- we have a couple applications already showing how easy that is. Definitely not something needed right away, but also not something we are going to abandon.

As a point of clarity, while BRL-CAD's command line is exposed via a Tcl shell in mged and archer, the two are not interlinked. You can issue commands without Tcl. One can easily expose BRL-CAD's commands via any interpreting environment like zsh, bash, python, lisp, perl, etc., or without a shell too, run a la carte (e.g., src/gools/gsh.cxx and src/gootls/gex.cpp).

Any command interface shouldn't be a substitute for good GUI design, which I think we all agree is the focus.

view this post on Zulip Sadeep Darshana (May 03 2019 at 19:34):

I'll send a revised proposal today.

Something I have always been wondering is at which point I should work on integrating the wireframe graphical display instead of the rendering and refresh image thing that is there now.

Do you think implementing that earlier in the project can help with development, or can it be easily embedded later towards the end of the project?

Also does the Qt Display Manager take care of Mouse inputs? Or does it have to be implemented?

view this post on Zulip Sadeep Darshana (May 03 2019 at 19:40):

Where can I find the code for Qt Display Manager?

view this post on Zulip Sean (May 04 2019 at 02:08):

@Sadeep Darshana Look forward to seeing the update. I'd certainly encourage you to take a look at integrating the wireframe, just to not get too distracted with it just yet. The code is in src/libdm/dm-qt.cpp, enabled when Qt is detected and enabled during CMake. So you'll want to install Qt and make sure CMake finds it (and says so in the summary), which might take some tweaking or minor code updates.

So it's a double-edged sword -- IF you can get a (libdm) display manager integrated and working in a Qt GUI, you will get nearly instant access to (shaded) triangle mesh and wireframe drawing like you see in mged automatically. That said, the libdm code is typically hard code to comprehend and debug, so there's a learning curve and you very well might make faster progress doing something new using Qt3D, but then having to replicate some of the code in libdm for getting geometry representations. As Daniel mentioned, coreInterface has an API for getting triangles, though, so you could simply start with that if you like the clean slate approach. Start with libdm if you want the more featureful but harder approach.

For your proposal, I suggest you keep it as simple as possible, low risk, modular, so things can be updated/replaced if desired later, but always functional. For exploring the code and getting familiarized, I think you should check out as much as possible. ;)

view this post on Zulip Sean (May 04 2019 at 02:14):

Be sure you're read http://brlcad.org/wiki/User:Vladbogolin/GSoC2013/Logs if you haven't, follow his links, read his code. Then there's the qtged branch which has a working hierarchical object view, which is pretty essential to graphical geometry navigation. No documentation, but you can reach the original developer @starseeker as needed if you have questions (he's also on IRC). Lastly, you could take a look at Ralith's 2008/2009 project -- http://brlcad.org/wiki/User:Ralith

view this post on Zulip Sean (May 04 2019 at 02:19):

Ralith's project was a failure, but he got exceptional mouse navigation controls working with binding profiles implemented that matched MGED, Blender, and a standard Orbital camera.

In the best of all worlds, you'd be able to glue that all together with the Window and hierarchy from starseeker's qtged, the context from Vladbogolin's dm-qt, and Ralith's mouse controls on top of coreInterface and libged. Simple. ;)

view this post on Zulip Sadeep Darshana (May 04 2019 at 05:04):

Enabled Qt in the main brlcad project and In MGED selected Modes->DisplayManager->Qt
The application crashed.
Daniel had told me this would lead the application to crash.

view this post on Zulip Sadeep Darshana (May 04 2019 at 05:19):

Also I do not understand the need there was for a Qt Display Manager, since by the time Qt DM was implemented the OpenGl DM was already there and OpenGl is cross platform. Why was a Qt DM implemented?

view this post on Zulip Sean (May 04 2019 at 15:22):

@Sadeep Darshana how you access OpenGL is not cross-platform. On Linux, one typically uses GLX, on Windows it's WGL, on MacOSX it can be GLX or Aqua, each being a different set of code to support them. With a Qt DM, there's just one code.

view this post on Zulip Sean (May 04 2019 at 15:25):

Once you have an OpenGL context, you're right in that the OpenGL calls themselves are the same API, same code, but that's not what is being referred to here -- it's the creation and management of the drawing surface being used by OpenGL that is the issue and for that, there's the low-level methods (e.g. GLX and WGL) and higher-level methods (e.g., Qt3D, GLUT, GLFW, etc).

view this post on Zulip Sean (May 04 2019 at 15:26):

we've had the low level interface since before OpenGL existed, but now we want to make it go through a higher-level interface: Qt3D ;)

view this post on Zulip Sadeep Darshana (May 04 2019 at 16:28):

I understand. I assume dm-glx & dm-wgl are the corresponding src files for those platforms.

I'm trying to find the best way to design the toolbox (only primitive create tools)

1) RHC & RPC look different from Cylinders and Cones for an end user. Should we put them under a new category? (in case we are going for a design that categorizes). What about Elliptical Paraboloid being under ellipsoids?

2) Is starting A,B,Cs being at 2:1:1 the the only thing special about ell1 from its generic type ell ?

3) Regarding our discussion about wireframes/rendering.
Without implementing this it is impossible to implement any editing. (other than property changes through properties panel). Even position/rotation changing will have to be delayed. Anyway in the proposal I'm putting the wireframe thing and everything that depends on it towards the later weeks.

4) In dm-qt.cpp
Is the only reason tk and tcl stuff are in the code, because the whole rectangular graphics window is placed inside a Tk window?

view this post on Zulip Sean (May 05 2019 at 02:43):

Thanks @Sadeep Darshana. Update received.

I understand. I assume dm-glx & dm-wgl are the corresponding src files for those platforms.

Yes.

I'm trying to find the best way to design the toolbox (only primitive create tools)

Lots of viable ways and feel free to argue otherwise, but I'd keep it familiar and simple -- Photoshop (PS) pretty much nailed this. Have a panel of tool icons. When one is selected, you're presented with its options (e.g, upper toolbar in PS).

That's pattern is inherently modular should we want to change appearance or behavior (e.g., swap out a tool for another or change displayed options) and maps to existing capabilities very directly.

1) RHC & RPC look different from Cylinders and Cones for an end user. Should we put them under a new category? (in case we are going for a design that categorizes). What about Elliptical Paraboloid being under ellipsoids?

Keep it simple. Wouldn't do anything to depict categories yet.

2) Is starting A,B,Cs being at 2:1:1 the the only thing special about ell1 from its generic type ell ?

No. If you know OOP, it's like a different C++ constructor for the same class. You'll see this directly if you run the "in" command. It will prompt you for each parameter based on the type of object you try to make.

ELL is created via three vectors. ELL1 is created with 1 vector and a radius. Both result in an ELL object, only difference is how they were created.

What this does raise is there possibly needing to be some way to have alternative ways for specifying parameters later, but it's out of scope for you.

3) Regarding our discussion about wireframes/rendering.
Without implementing this it is impossible to implement any editing. (other than property changes through properties panel). Even position/rotation changing will have to be delayed. Anyway in the proposal I'm putting the wireframe thing and everything that depends on it towards the later weeks.

Having some visual representation of geometry is kind of central to a GUI, more important than editing. It's okay to defer or have a placeholder for "draw geometry here" at first, but once there are buttons and panels that will quickly be a necessity to ensure everything is getting wired up correctly.

4) In dm-qt.cpp
Is the only reason tk and tcl stuff are in the code, because the whole rectangular graphics window is placed inside a Tk window?

Yes. As it is a Tk window, Tk also handles that window's key and mouse events. In a pure Qt context, that is all bypassed (qt_open_existing()).

By the way, check out http://brlcad.org/design/gui/ if you haven't already. Particularly like Alexander's work. Folder has lots of big-picture concepts and examples of other CAD GUIs (good and bad).

view this post on Zulip Sean (May 05 2019 at 03:02):

This is a particular bit of inspiration I just wanted to share, only remotely relevant as it's not a CAD GUI but is one of the most astounding examples of massive and localized option management: NoWindows.png

You can think of the upper tabs as being tools (e.g., "Text" is a tool). The options for that tab display when the tool's icon is selected. Of course, tabs as tools won't work if there are lots of tools, but the notion is the same even if you put all those tab icons into a panel on the left and leave the options at the top (which is essentially what PS does).

view this post on Zulip Sean (May 05 2019 at 04:00):

While I'm at it, might as well show one of the newest CAD GUIs that is taking off big in popularity, from OnShape: e9ab5754-af10-4c2d-8936-afc487499881.png

view this post on Zulip Sadeep Darshana (May 05 2019 at 07:31):

(deleted)

view this post on Zulip Sadeep Darshana (May 05 2019 at 07:33):

Proposal here refers to "BRL-CAD Proposal V3.pdf" I send via email seven hours ago.

When one is selected, you're presented with its options (e.g, upper toolbar in PS).
but the notion is the same even if you put all those tab icons into a panel on the left and leave the options at the top

Please find the the last paragraph and the sentence before the last paragraph in 3.2.1. I have described the problem with this approach.
To proceed with this approach we have to change the event on which object is created to some mouse event on the graphics window (from mouse click on the toolbar icon now).

Having some visual representation of geometry is kind of central to a GUI, more important than editing. It's okay to defer or have a placeholder for "draw geometry here" at first

We already have a way implemented in QtGui to display the geometry. It raytraces and updates the image.
pasted image
This is sufficient for viewing in development.

view this post on Zulip Sadeep Darshana (May 06 2019 at 19:27):

How do I get the Qt DM running on mged without the application being crashed. Daniel told some special settings have to be made for Tcl/tk. I'm trying to embed the qt dm before the coding period officially begins.
(I enabled qt, now the menu item shows, but crash when selected)

@Daniel Rossberg

view this post on Zulip Daniel Rossberg (May 07 2019 at 08:38):

@Sadeep Darshana

How do I get the Qt DM running on mged without the application being crashed. Daniel told some special settings have to be made for Tcl/tk. I'm trying to embed the qt dm before the coding period officially begins.
(I enabled qt, now the menu item shows, but crash when selected)

I debugged a bit and found the following in the Qt documentation of QApplication::QApplication(int &argc, char **argv):

Warning: The data referred to by argc and argv must stay valid for the entire lifetime of the QApplication object. In addition, argc must be greater than zero and argv must contain at least one valid character string.

And now you ;)

view this post on Zulip Daniel Rossberg (May 07 2019 at 18:03):

While it's good to know the Qt display manager (and with the above hint you should be able to fix its crash), the project aims for a new GUI with a new concept for user interactions (which means new for BRL-CAD). This is a step-wise process.

The first step would be to find a name for the new GUI. You need it as directory name for your source code, for example. You could throw some possible names here and ask for comments.

view this post on Zulip Inder Singh (May 11 2019 at 08:48):

Hi @Sadeep Darshana I am co-mentor for "New UI for BRL-CAD" project. Congratulations for getting selected in GSoC 2019. I will try to help you with the design side of things and do my best to make this summer of code a successful experience for us.

view this post on Zulip Sadeep Darshana (May 11 2019 at 18:39):

hi @pooh (inder)
I sent you my proposal to your email. Please have a look at it.

view this post on Zulip Inder Singh (May 12 2019 at 06:42):

hi pooh (inder)
I sent you my proposal to your email. Please have a look at it.

Hey @Sadeep Darshana thank you for that. I have read your proposal when you submitted. :) It's a good one. Anything specific you want my attention on?

view this post on Zulip Sean (May 13 2019 at 01:36):

hi pooh (inder)
I sent you my proposal to your email. Please have a look at it.

@Sadeep Darshana Please don't use private e-mails to discuss technical matters. You can send proposals here on Zulip or link to them on IRC or post them to the brlcad-devel mailing list for feedback. Private e-mail should only be for personal situations and even then you should CC more than one person (e.g., CC the program admin).

view this post on Zulip Sadeep Darshana (May 16 2019 at 06:29):

https://drive.google.com/open?id=1neRDaiPuKw48aq7KYNAAthhBSw3vMiR8zY1RibsmQdw

This is what I sent him through email.

Integrating the DM seems a little hard I'm trying to do the basic UI stuff first. There are several aspects I talked about when it comes to the design of UI toolbars etc. Also Sean did suggest ways. Which way do you think I should choose?

view this post on Zulip Daniel Rossberg (May 16 2019 at 14:56):

Integrating the DM seems a little hard I'm trying to do the basic UI stuff first. There are several aspects I talked about when it comes to the design of UI toolbars etc. Also Sean did suggest ways. Which way do you think I should choose?

We are looking for a new user interface with a look and feel similar to the "usual" CADs. For the start, you may want to take one or two designs from the GCi tasks or compile an own as template, and implement it in Qt. (Please share your choice with us before you start implementing it.)
When you implement it, you shouldn't try to trick Qt but use its widgets as intended. Furthermore, connecting the GUI with the BRL-CAD functions has no priority when you implement your first design.

view this post on Zulip Daniel Rossberg (May 16 2019 at 15:05):

@Sadeep Darshana Even if you don't use the current display managers for the new GUI (which is OK because we want a different "user experience" there), you should consider to provide a patch for the bug which prevents the current Qt display manager from working. See my considerations in https://brlcad.zulipchat.com/#narrow/stream/111975-Google-Summer.20of.20Code/topic/New.20BRL-CAD.20GUI/near/165052853. It's a Qt issue, which taught me something about Qt.

view this post on Zulip Inder Singh (May 17 2019 at 17:54):

@Sadeep Darshana are you writing a daily diary? If yes, can you please give me the link here? If not, it's a good idea to set it up before the coding period begins.

view this post on Zulip Sean (May 17 2019 at 22:05):

Sadeep Darshana are you writing a daily diary? If yes, can you please give me the link here? If not, it's a good idea to set it up before the coding period begins.

It's not just a good idea -- it's required as per the checklist. Please speak up if you have questions about setting something up.

view this post on Zulip Sadeep Darshana (May 20 2019 at 19:14):

Followed the checklist
http://brlcad.org/wiki/User:Sadeep/DevLog-NewGui (It does not have new things that are not in my proposal, also only in an abstract manner for now)

My Milestones
1. Ability to create several primitives by GUI
2. Editing
3. Integrating Qt DM
(added Milestones section to the end of my proposal)

I read and accept this https://brlcad.org/wiki/Summer_of_Code/Acceptance
Read https://brlcad.org/wiki/Summer_of_Code/Expectations
Filled profile

https://sourceforge.net/u/sadeep/profile
http://brlcad.org/wiki/User:Sadeep (empty)

The university academic period and exams ending only on June 17. They are like 2 weeks behind the schedules due to the terrorist attacks. (I mentioned this might happen in the Proposal V3 I sent Daniel and Sean). I won't be able to fully commit towards the project till then.
But I hope I will be able to complete Milestone 1 by the 1st evaluation since I have already been familiar with the Rt^3 project and done some slight modifications to it.

@pooh (inder) @Sean @Daniel Rossberg

view this post on Zulip Sean (May 20 2019 at 20:19):

@Sadeep Darshana Thank you for giving this priority attention. Please e-mail me for #9. Have you talked with your mentor yet about an interaction schedule?

view this post on Zulip Sadeep Darshana (May 22 2019 at 06:08):

@pooh (inder) @Daniel Rossberg Can you make a suggetion about the interaction schedule?

view this post on Zulip Daniel Rossberg (May 22 2019 at 18:56):

My Milestones
1. Ability to create several primitives by GUI
2. Editing
3. Integrating Qt DM

Why do you want to integrate the Qt display manager in the new GUI? I consider this as unsuited.

Do you know what steps are necessary to create a GUI which can create and edit objects?

view this post on Zulip Daniel Rossberg (May 22 2019 at 18:57):

pooh (inder) Daniel Rossberg Can you make a suggetion about the interaction schedule?

Daily development log? Zulip?

view this post on Zulip Inder Singh (May 24 2019 at 10:16):

pooh (inder) Daniel Rossberg Can you make a suggetion about the interaction schedule?

view this post on Zulip Quentin Paden (May 25 2019 at 11:41):

Thanks for that advice!

To be more transparent with deveopment progress I am thinking of creating gifs using GeForce Experience for screen recording bugs/UI interaction and then using Giphy to create some good gifs from the recorded video of important development progress. @pooh (inder)

view this post on Zulip Sadeep Darshana (May 25 2019 at 15:54):

@Daniel Rossberg

Do you know what steps are necessary to create a GUI which can create and edit objects?

I'm studying on this. I really appreciate if you could guide me on what I should look into.

view this post on Zulip Sadeep Darshana (May 25 2019 at 19:18):

Also which DM is used when building and running on Ubuntu64bit? dm-X.c?

view this post on Zulip Sadeep Darshana (May 25 2019 at 21:26):

Please ignore above question

Displaying geometry seems to be difficult. A lot of files are involved. Without all this complexity, is there a way to display a database in a Qt component in a simple way only for the development purposes. (it's better content being displayed when I'm working on other UI related things)

view this post on Zulip Daniel Rossberg (May 26 2019 at 16:32):

Do you know what steps are necessary to create a GUI which can create and edit objects?

I'm studying on this. I really appreciate if you could guide me on what I should look into.

OK, I'll first explain what it's not, exemplified by the sphere: Click the create sphere icon, then a dialog opens where you have to type in the name, center, and radius, and at the end you hit the OK button.

What's wrong with it? The GUI doesn't support the creation of the sphere! You could do the same with mged in nu mode, maybe even faster, because you don't have to change between keyboard and mouse. From a CAD GUI you can expect that it helps you to determine the center and radius (and the name) of the sphere. For example, to do the goblet in the tutorial you want to place the spheres for the stem by clicking on the places where you want to create them on the screen.

Which are the steps one had to do for this? I recommend to go this way:
* Creation of a mock-up GUI: It shows the intended layout and functioning, but it isn't connected to any BRL-CAD core function yet.
* Opening, saving, and closing of BRL-CAD database files: Here starts the connection with BRL-CAD functions. It should be easy to implement, but already arise a question about the GUIs behavior.
* Displaying the geometry on the screen: This is one of the big points, which requires some work. I'm thinking at a wire-frame depiction here. The lines could be taken from the tessellation or the plot functions (I would prefer the plot functions). Did you thought of having GUI elements for shifting, rotating, and zooming the view in the first step?
* Determining model points under screen points: When the user clicks on the screen, which point does they mean?
* Creation of a sphere: After having all the above done, this shouldn't be so complicated any more.
* A preview of the sphere during its creation: When the center of the new sphere is determined, a circle which moves with the mouse should help the user to imagine how this new sphere looks like with the other geometric elements.

Well, if you are able to create a sphere with your GUI at the end of GSoC you are good :wink:

view this post on Zulip Sadeep Darshana (May 26 2019 at 20:37):

Thank you @Daniel Rossberg . It was really helpful and clarifies a lot of doubts. This sort of reaffirms what I had in my mind.

But I'm sorry I misunderstood this.

Do you know what steps are necessary to create a GUI which can create and edit objects?

What I really wanted to know was how do I create the GUI that displays/edits the geometry? (THE GRAPHICS WINDOW)

I looked at the sources to understand the process but it is too hard to understand without help.
For instance when I look at the mged there are a lot of source files involved. The DMs, mged_dm.h, the tcl scripts, dm-generic.

1. Can someone give me a brief idea about in which source file each stage related to displaying geometry on screen happens?
I want to get the abstract idea of how DisplayManagers, OpenGl, Tk(in mged/archer), and anything else related connects and what they do.
For example, what decides the positions of the lines displayed for a sphere, what decides the pixels needed to color to draw it on screen. What draws it on screen. Which widget(ex:togl) in Tk has been used to display geometry
2. Any tips on how I might create this on Qt?
I want to get the geometry displayed on the screen as soon as possible since all the development depends on it.

@Sean @pooh (inder) @Daniel Rossberg

view this post on Zulip Daniel Rossberg (May 27 2019 at 15:52):

How to display the geometry in the GUI? That's easy: With a QWidget! It is as trivial as it sounds. Look for example at rt^3/src/QtGUI/GraphicView.

Well, for a real nice CAD display there is something more to do, but this is the start.

To understand the mged display managers you might want to have a look at the null dm (brlcad/src/libdm/dm_Null.*). There you see that the display managers are mainly different implementations of functions declared in the struct dm_internal. This are functions for draw management, setting the transformation matrix, setting the color, drawing simple objects, handling display lists, etc.. And all this can be done in a X Window, OpenGL window, QWidget, etc., depending on which implementation of these functions you use.

view this post on Zulip Sadeep Darshana (May 27 2019 at 17:37):

i had studied the displaying in QtGUI. It simply raytraces the objects everytime something happens and draws the output image in the QWidget. I believe this would be more troublesome

view this post on Zulip Daniel Rossberg (May 27 2019 at 17:42):

Not necessarily. You get out a wire-frame description from the model and draw it with the corresponding Qt functions.

view this post on Zulip Sadeep Darshana (May 27 2019 at 17:47):

so for this I can use the dm-qt?

view this post on Zulip Daniel Rossberg (May 27 2019 at 17:58):

so for this I can use the dm-qt?

NO. You don't work on mged or archer but on a new GUI with new behavior.

view this post on Zulip Daniel Rossberg (May 27 2019 at 18:11):

The point with the mged display manager is, that it should give you an idea what's expected from the graphic engine, and it can be implemented with Qt or OpenGL. But, we don't expect you to copy them to the new GUI.

view this post on Zulip Sadeep Darshana (May 29 2019 at 22:18):

why does dm-tk use Xlib?

view this post on Zulip Sadeep Darshana (May 30 2019 at 00:10):

I believe a DM based on OpenGL should be implemented for this since Display Managers based on window systems like Tk or Qt use a 2D plane and we have to do the converting. In opengl we are dealing with a 3D environment. This is better especially when we want to display objects other than wireframes. Also we are given the abstraction of a 3D environment with a lot of other features like lighting which are not available if we used a Window System based DM. People might not want to work with wireframes since almost all other CAD software display solid
In Qt the way to implement an open gl based DM would be to use QOpenGLWidget and implement new-dm_drawVList function to draw on that widget. I believe this function would be almost identical to osgl_drawVList, ogl_drawVListor wgl_drawVList

@Daniel Rossberg @pooh (inder) @Sean

view this post on Zulip Sadeep Darshana (May 30 2019 at 00:22):

I do understand how the Vlist is displayed on the screen by different DMs. Now I need to look at how Vlists are created from the db. I will start implementing hopefully tomorrow.

view this post on Zulip Sadeep Darshana (May 30 2019 at 00:39):

Why are display lists used?

view this post on Zulip Daniel Rossberg (May 30 2019 at 15:46):

why does dm-tk use Xlib?

Because the Tk graphics window uses X Window features? The would mean that it works with a X Window environment only, of course. You can find it out by either looking for xlib functions in the code or removing the xlib includes and see what is broken after that.

view this post on Zulip Daniel Rossberg (May 30 2019 at 15:52):

I do understand how the Vlist is displayed on the screen by different DMs. Now I need to look at how Vlists are created from the db.

ft_plot() (the rt_~_plot() functions)

I will start implementing hopefully tomorrow.

Do the mock-up first.

view this post on Zulip Daniel Rossberg (May 30 2019 at 16:22):

I believe a DM based on OpenGL should be implemented for this since Display Managers based on window systems like Tk or Qt use a 2D plane and we have to do the converting. In opengl we are dealing with a 3D environment. This is better especially when we want to display objects other than wireframes. Also we are given the abstraction of a 3D environment with a lot of other features like lighting which are not available if we used a Window System based DM. People might not want to work with wireframes since almost all other CAD software display solid

I'm afraid this isn't a good idea. My doubts start with your argumentation with the "2D Qt plane" and 3D OpenGL environment". Maybe, you don't know what OpenGL does: Computing 2D raster images from 3D input data. I.e., you need to consider the 2D display plane there as well. What complicates it is, that you need to translate the BRL-CAD transformation an display logic into the OpenGL "language". This isn't trivial, see the annotation bug thread here for example.

If you know what you are doing and how to say it in OpenGL, it can be a powerful tool to accelerate the graphic routines, because a good OpenGL driver will do many of the computations on the graphic card.

Lightning, textures, etc. are another issue, were OpenGL is hard to use, because BRL-CAD has its own renderer with algorithmic generated textures, for example. Shifting this to the graphic card is far behind the scope of your project (and would probably be hidden behind the BRL-CAD interface).

BTW, people are forced to work with wire-frames, because solids cover what's behind them ;)

view this post on Zulip Daniel Rossberg (May 30 2019 at 16:34):

Why are display lists used?

:grinning: Therefore: Whats's a display list? As already mentioned, graphic libraries as OpenGL take their power from shifting a large part of the computational work to the video card. To be effective, as much data as possible hast to be stored there too. You may have heard that there is memory for textures on a video card. The display lists are chunks of the model or CAD data, reduced to simple primitives (often triangles), which can be stored on the video card and used there without bothering the CPU or RAM again.

For example, for the wire-frame view, you could put all the edges from the BRL-CAD model in a huge edge list as a display list, and store it on the video card. If you zoom, shift, or rotate the view now, you have to readjust the camera only and send the command for redrawing the stored display list.

view this post on Zulip Inder Singh (May 30 2019 at 19:09):

Hey @Sadeep Darshana were you able to create a daily dev log somewhere? If so, can you please share the link with me?

view this post on Zulip Inder Singh (May 30 2019 at 19:10):

I am getting a gist of what you do daily from this zulip chat. It's just that all of that progress written in your own words at one place will help you and me see the trajectory and velocity of the progress. :)

view this post on Zulip Sadeep Darshana (May 31 2019 at 20:26):

I did update the progress. Exams and the academic timetables (were supposed to over now) have been delayed due to reasons I could not predict when I applied. So I'm struggling to allocate as much time on this as possible.
@Sean @pooh (inder)

Some questions I have been having

1) Doesn't rt in librt stand for RayTrace? If so why are things like db open and vlist generation in it?
2) 'RT^3' what does this mean?
3) Was coreinterfaces and qt gui developed as parts of the same project?

view this post on Zulip Sean (May 31 2019 at 20:50):

I did update the progress.

Thank you. The information looks good, but try to keep things separated with an entry per day going forward, not ranges of days.

Exams and the academic timetables (were supposed to over now) have been delayed due to reasons I could not predict when I applied. So I'm struggling to allocate as much time on this as possible.

This is understandable and will certainly be a challenge for you. In particular, it's going to be a time management challenge until at least the 17th. I suggest you dedicate some part of your day at a specific schedule, like 4 hours a day from 9am-11am and 6-8pm 4-5 days a week, something like that instead of trying to burst a whole 8-10 hours one day and then nothing for 2-3 days because you're now behind on studying for some exam. If we see you making even a little bit of activity and actual progress every day, that will be reassuring. Then you can adjust your schedule after exams are over to make up lost time (e.g., 50-60 hour weeks for 3-4 weeks). What doesn't work and gets you on a trouble radar is when you do nothing for 3+ days.

1) Doesn't rt in librt stand for RayTrace? If so why are things like db open and vlist generation in it?

It does stand for ray tracing. Originally the database functions were actually colocated in librt for low-level performance reasons. Those reasons, however, no longer matter so there are plans to extract them into their own "libg" for the .g file format. As for vlist generation, that's a property of objects, which also belongs to the individual primitives (they must describe themselves in a wireframe form, in textual form, in raytrace form, etc).

2) 'RT^3' what does this mean?

"RT cubed" is simply the name of the repository holding some "next generation" plans for BRL-CAD. In mathematical terms, to cube something is to multiply it three times (e.g., 8^3 = 8 * 8 * 8 = 512). Other than a fun mathematical project name, it has no other implication.

3) Was coreinterfaces and qt gui developed as parts of the same project?

They were developed independently but added to the rt^3 repository as that's where "next generation" code projects have been worked on.

view this post on Zulip Sadeep Darshana (May 31 2019 at 22:01):

What is the square root of 50 + 14?

view this post on Zulip Sadeep Darshana (May 31 2019 at 22:01):

or 100 - 51

view this post on Zulip Sadeep Darshana (May 31 2019 at 22:02):

it's broken apparently

view this post on Zulip Sadeep Darshana (May 31 2019 at 22:23):

I obtained vlist for 1 object in RT^3, QtGui project. using ft_plot. Thanks @Daniel Rossberg for pointing in this direction. Was a big time saver. My next task is to display wireframe in a widget in qt.

1. For this I need to study, Camera angle and distance setup like things. And other things that might be needed for rendering a wireframe scene.
2. Also I noticed something called ft_adaptive_plot. some optimizing thing?
3. Will I be needing displaylists or can I straight away display wireframes. (i.e. is it essential or just an optimize thing)
@Daniel Rossberg @Sean

view this post on Zulip Sadeep Darshana (May 31 2019 at 22:29):

Hey Sadeep Darshana were you able to create a daily dev log somewhere? If so, can you please share the link with me?

@pooh (inder) http://brlcad.org/wiki/User:Sadeep/DevLog-NewGui. I could not update the log today. because What is the square root of 1000 - 100?

view this post on Zulip Inder Singh (Jun 01 2019 at 01:03):

Hey Sadeep Darshana were you able to create a daily dev log somewhere? If so, can you please share the link with me?

pooh (inder) http://brlcad.org/wiki/User:Sadeep/DevLog-NewGui. I could not update the log today. because What is the square root of 1000 - 100?

Perfect! Thank you so much. I would just advice to add at-least single line at end of every day, like even if you didn't work on anything just say it. I remember Sean saying me when I was a student "If you spent the day on the beach, just write it down" :D (something along that line, not exact words)

view this post on Zulip Sadeep Darshana (Jun 01 2019 at 05:05):

I cannot edit a brlcad wiki page (my dev log) from my laptop (ubuntu, chrome). It says "Error: Incorrect or missing CAPTCHA." every time.Apparently it works on mobile. Anyone experienced similar issues?

view this post on Zulip Sean (Jun 01 2019 at 05:10):

What is the square root of 50 + 14?

what do you think the answer is? the captcha is working for me

view this post on Zulip Sadeep Darshana (Jun 01 2019 at 05:11):

8?

view this post on Zulip Sadeep Darshana (Jun 01 2019 at 05:11):

(without the question mark)

view this post on Zulip Sean (Jun 01 2019 at 05:12):

yes, so if you entered that and it didn't work, something is awry but hard to say what's wrong. are you hitting enter or clicking the submit button?

view this post on Zulip Sean (Jun 01 2019 at 05:13):

if you log in, it will not prompt the captcha

view this post on Zulip Sadeep Darshana (Jun 01 2019 at 05:16):

Something wrong with the cookies it seems. Says
"There seems to be a problem with your login session; this action has been canceled as a precaution against session hijacking. Please resubmit the form."
when I try to login. Works well on incognito mode

view this post on Zulip Sean (Jun 01 2019 at 05:18):

perhaps try deleting your cookies for brlcad.org?

view this post on Zulip Sadeep Darshana (Jun 01 2019 at 05:20):

Didn't work. Maybe user of the default header sent from the normal mode suspected as trying to hijack or something. Doesn't matter I can manage this with incognito mode or mobile. Thanks

view this post on Zulip Sean (Jun 01 2019 at 05:29):

are you unable to log in?

view this post on Zulip Sadeep Darshana (Jun 01 2019 at 06:18):

I can log in using firefox

view this post on Zulip Sadeep Darshana (Jun 01 2019 at 19:59):

I'm implementing displaying in both QOpenGLWidget using OpenGLand QWidget using window system functions. Working on the OpenGL method today.

view this post on Zulip Sadeep Darshana (Jun 01 2019 at 21:36):

Added QOpenGLWidget to the application. Line creation is not straight-forward like in the earlier OpenGL version which existing OpenGL DMs use in BRL-CAD. glBegin and glEnd are have been deprecated and now removed. Studying the new method. This means I will have to change the code in the existing vlist_draw functions to suit the modern opengl.

view this post on Zulip Sean (Jun 01 2019 at 22:08):

They're not removed yet, and won't likely be removed anytime soon. So using new or old OpenGL should be fine. That said, the new is better but I wouldn't get too caught up on the details other than what you need to do basic drawing of lines and/or triangles.

view this post on Zulip Sadeep Darshana (Jun 02 2019 at 06:51):

I'm using the legacy component QGLWidget (old opengl) instead of QOpenGLWidget (no glbegin) since it will be easy to use and the main emphasis of the project should be on creating the application UI than the display manager

view this post on Zulip Sadeep Darshana (Jun 02 2019 at 14:21):

bu_lists are very weird. Iterations crashes when iterating inside GraphicsViewOpenGL::paintGL() method. Iterating works well when used inside methods I define. Does it have anything that could cause unexpected behaviors? like threading?

view this post on Zulip Sadeep Darshana (Jun 02 2019 at 16:03):

IGNORE THE ABOVE MESSAGE !! IGNORE THE ABOVE MESSAGE !! IGNORE THE ABOVE MESSAGE !!!
Got this solved after struggling few hours.
C++ erases local variable objects even though you set a global level reference to point that after declaring it. Java is a lot easier.

view this post on Zulip Sadeep Darshana (Jun 02 2019 at 21:11):

pasted image
Wireframe displaying implemented to display wireframes of 2 objects that I name in the scene.

view this post on Zulip Sadeep Darshana (Jun 02 2019 at 21:17):

intern.idb_meth->ft_plot(&vhead,&intern,m_wdbp->wdb_initial_tree_state.ts_ttol,m_wdbp->wdb_initial_tree_state.ts_tol,&info);
This crashes when plotting combinations. Any idea why?

view this post on Zulip Sadeep Darshana (Jun 02 2019 at 21:18):

Is it not possible to plot combinations using ft_plot?

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

pasted image
Would be great if we can have these. Will this be hard to implement with openGL?

view this post on Zulip Sean (Jun 03 2019 at 11:57):

intern.idb_meth->ft_plot(&vhead,&intern,m_wdbp->wdb_initial_tree_state.ts_ttol,m_wdbp->wdb_initial_tree_state.ts_tol,&info);
This crashes when plotting combinations. Any idea why?

Do you know how to use a debugger like GDB or LLDB? If not, this would be a great time to do a little tutorial from the web. Basically, you can run as you usually do, and then when it crashes, you can examine the backtrace which will tell you exactly where it crashed and what the variables were at that time.

If you did in this instance, you'd find that intern.idb_meth->ft_plot is NULL, and that's why it crashes.

view this post on Zulip Sean (Jun 03 2019 at 12:01):

So you're right in that you can't currently plot combinations using ft_plot() -- they don't know how to plot themselves (see src/librt/primitives/table.cpp for all callbacks and src/librt/comb for implementation). The logic for how combinations get plotted is quite complex for mged and archer, and it's not yet been cleaned up enough to be a simple callback. You can see the combination plotting logic in src/libged/draw.c

view this post on Zulip Sean (Jun 03 2019 at 23:47):

@Sadeep Darshana That all said, I'm a little surprised you're working with low-level OpenGL code and directly calling into librt for plot lists. What is your first project milestone? If it doesn't entail OpenGL, then you will want to refocus on the milestone -- there's not much time in your schedule for distraction (like implementing those coordinate axes). As the plan is for the gui to go through coreInterface, you should be getting plot information from it instead of via ft_plot() too.

view this post on Zulip Sean (Jun 03 2019 at 23:53):

Reading your project plan, looks like the first milestone is opening and closing a geometry database -- if you can do that already, you should have submitted code for review. If you have not, that is what you should be working on now. :)

view this post on Zulip Sadeep Darshana (Jun 04 2019 at 08:49):

Sadeep Darshana That all said, I'm a little surprised you're working with low-level OpenGL code and directly calling into librt for plot lists. What is your first project milestone? If it doesn't entail OpenGL, then you will want to refocus on the milestone -- there's not much time in your schedule for distraction (like implementing those coordinate axes). As the plan is for the gui to go through coreInterface, you should be getting plot information from it instead of via ft_plot() too.

@Sean
1. How do I obtain plot list through CoreInterfaces? Is a function that does the functionality of ft_plot() already implemented in CoreInterfaces?
2. DM had to be implemented because without it I won't be able to develop other required things like creating a sphere on the canvas with the mouse. Or editing. Btw I won't be focusing on those coordinate axes (they are object rotate/scale/translate handlers) or will do them at the end if time permits.

view this post on Zulip Daniel Rossberg (Jun 04 2019 at 15:57):

@Sadeep Darshana

Sean
1. How do I obtain plot list through CoreInterfaces? Is a function that does the functionality of ft_plot() already implemented in CoreInterfaces?

You can use the database Facetize() method to get a triangle mesh boundary representation of the geometry. The edges of these triangles create a wireframe.

There will be likely be a plot-like method in future, but all you need for the beginning is a set of edges, which you can obtain via Facetize().

2. DM had to be implemented because without it I won't be able to develop other required things like creating a sphere on the canvas with the mouse. Or editing. Btw I won't be focusing on those coordinate axes (they are object rotate/scale/translate handlers) or will do them at the end if time permits.

You can't have a DM without a window, which you don't have. You still work with the QtGUI from GCi, which is far away from what we expect a CAD GUI should look. We clarified the priorities for your project here, but you haven't started with the first of them yet.

view this post on Zulip Daniel Rossberg (Jun 04 2019 at 16:15):

Metaphorically speaking, you are talking about the mountains you are seeing at the horizon, but you haven't start going there. Then, you have heard that a cable car is a good way to go up a hill, but you have no idea what it means to build one. You'll have to climb up the mountain first and find a path.

We, the mentors, can guide you there. This has to be done however step by step. It isn't useful to philosophize about things which look a bit different when you are standing in front of them, then you might think now.

view this post on Zulip Daniel Rossberg (Jun 04 2019 at 16:23):

The creation of a complete functional CAD GUI is far behind the scope of your project. You should feel more like an explorer, who tries to come as close as possible to the desired software in the short time of this GSoC. You'll find many things which are missing or having a to bad (time)cost-benefit ratio to be done here. That's OK. This should be noted for the future.

view this post on Zulip Sadeep Darshana (Jun 04 2019 at 16:47):

Okay, I'll work on the UI next

view this post on Zulip Inder Singh (Jun 08 2019 at 15:22):

Hi @Sadeep Darshana I see that you have not updated your dev log from couple of days, is everything fine? Do you need any help?

view this post on Zulip Sadeep Darshana (Jun 09 2019 at 07:56):

I did not do anything significant during the period. My exams are not over yet. I will do my best to find time to work on this.

view this post on Zulip Daniel Rossberg (Jun 09 2019 at 14:49):

I did not do anything significant during the period. My exams are not over yet. I will do my best to find time to work on this.

Hmm, that's bad.

view this post on Zulip Inder Singh (Jun 09 2019 at 19:14):

@Sadeep Darshana It would really help you and your mentors if you keep the communication running. So even on days when you havent done anything significant, inform us (through dev log and otherwise) about any non-significant thing you did, or even when you didnt do anything at all. Not communicating in my humble opinion is always worse than not working. I know its hard, I used to miss my dev log too, but I promise you this habit of daily updating will help you in successful completion of GSoC as well as in your future endeavors as a professional in tech industry.

view this post on Zulip Sadeep Darshana (Jun 09 2019 at 21:59):

thanks @pooh (inder)

I didn't start working on the UI yet. When I start should I make improvements to the QtGui project or start it fresh?

view this post on Zulip Sean (Jun 10 2019 at 14:43):

@Sadeep Darshana I will be sending an e-mail regarding your dev log. While you did let us know about your exams (through the 17th right?), I believe I also reiterated the importance of time management and still making some progress. Going 6 days without activity is not acceptable even with exams.

view this post on Zulip Sadeep Darshana (Jun 13 2019 at 19:35):

I have done some improvements on the QtGUI
Is it prefered to start a new project or do things on top of the rt^3 QtGUI project?
@Daniel Rossberg

view this post on Zulip Sadeep Darshana (Jun 13 2019 at 19:36):

@Sean

view this post on Zulip Daniel Rossberg (Jun 13 2019 at 19:55):

Create a new project parallel to QtGUI.

view this post on Zulip Sean (Jun 19 2019 at 12:57):

I'm fine with either approach, merits to both, downsides to both. ;)

view this post on Zulip Sadeep Darshana (Jun 22 2019 at 19:01):

@Sean @Daniel Rossberg @pooh (inder) I hope you received my email. I'm implementing the toolbar.

view this post on Zulip Sadeep Darshana (Jun 25 2019 at 18:55):

placed our OpenGL view as the central widget. im trying to make it possible to create a sphere through ui

view this post on Zulip Daniel Rossberg (Jun 26 2019 at 06:31):

placed our OpenGL view as the central widget. im trying to make it possible to create a sphere through ui

Where is the code?

view this post on Zulip Sadeep Darshana (Jun 27 2019 at 15:50):

Where is the code?
Daniel Rossberg SHould I upload to github and send link? cant push to svn since a new project.

view this post on Zulip Sean (Jun 27 2019 at 15:53):

GitHub or tarball to our patches tracker on sourceforge or tarball posted somewhere else...anywhere is better than nowhere. ;)

view this post on Zulip Sean (Jun 28 2019 at 02:42):

@Sadeep Darshana do you have it up anywhere yet? we really need it as soon as possible...

view this post on Zulip Sadeep Darshana (Jun 28 2019 at 03:23):

Sadeep Darshana do you have it up anywhere yet? we really need it as soon as possible...

Give me 30 mins @Sean

view this post on Zulip Sadeep Darshana (Jun 28 2019 at 04:02):

@Sean @Daniel Rossberg @pooh (inder)
Here is everything you can do with the application I have created so far,

Open a DB
move around with the keys (has to be improved, also mouse support to drag/zoom viewport needed)
Create a sphere using the sphere tool (this has to be improved to support drawing with mouse)
save the database

the UI is far from what will be created ultimately, a lot of features when creating geometry also have to be pre set. also I will talk to the mentors and finalize on the positioning of components

Please have a look at the demo video,
Demo Video

https://github.com/sadeepdarshana/QtNewGUI

view this post on Zulip Sadeep Darshana (May 05 2020 at 13:31):

https://brlcad.org/wiki/User:Sadeep/DevLog-2020

view this post on Zulip Daniel Rossberg (May 05 2020 at 13:54):

The current BRL-CAD trunk may be a bit bumpy. Revision 75083 works for me with Visual Studio 2019.

view this post on Zulip Sadeep Darshana (May 05 2020 at 14:07):

Could be the case. It gave an error msg saying some -Ot build option was invalid. I will try out that revision

view this post on Zulip Sean (May 05 2020 at 17:49):

Can include actual cmake or build output (can attach a log or paste code snippet in between two ~~~ lines), easier than guessing the context of an error, often helpful.

view this post on Zulip Sadeep Darshana (May 15 2020 at 18:16):

What should I focus on implementing in the beginning?

view this post on Zulip Sadeep Darshana (May 15 2020 at 18:17):

@Sean I hope my patch is also sufficient

view this post on Zulip Sadeep Darshana (May 15 2020 at 18:18):

I am reusing the display manager I implemented last year. That would be sufficient for developing the UI for the moment.

view this post on Zulip Sean (May 15 2020 at 19:54):

@Sadeep Darshana I haven't looked into the code yet, but the feature your patch implements looks fantastic! and you did that so quickly!

view this post on Zulip Sean (May 15 2020 at 19:57):

As for where to start, this is a complex issue of prioritization and you're going to get different priorities depending on who you ask and what the near-term goal is.

view this post on Zulip Sean (May 15 2020 at 19:57):

what would you like to do first?

view this post on Zulip Sadeep Darshana (May 16 2020 at 06:19):

I want to build the most basic editor, yet functional

view this post on Zulip Sean (May 16 2020 at 21:04):

@Sadeep Darshana you need to be way more specific. that could be almost anything. it also doesn't imply what the GUI itself will require.

view this post on Zulip Daniel Rossberg (May 18 2020 at 17:11):

Sadeep Darshana said:

I am reusing the display manager I implemented last year. That would be sufficient for developing the UI for the moment.

Did you tested it with the current BRL-CAD trunk revision?

view this post on Zulip Inder Singh (May 20 2020 at 03:56):

Hey @Sadeep Darshana

How are you doing? I just wanted to check-in and understand how you are approaching the flow for new GUI. I would love to help you, especially on the UI part of things. Let me know if you need anything.

view this post on Zulip Sadeep Darshana (May 21 2020 at 17:38):

@Daniel Rossberg it is working with the current version

view this post on Zulip Sadeep Darshana (May 21 2020 at 17:44):

@pooh (Inderpreet Singh) It's great to hear from you. There are several Google Code In designs that I looked into. Also the UI of vectary.com seems interesting. I'm using CMake instead of qt's qmake to be consistent.

view this post on Zulip Daniel Rossberg (May 22 2020 at 06:30):

OK. Next, you should remove all in the build process generated files from the repository, e.g. the moc_ files.

view this post on Zulip Inder Singh (May 26 2020 at 14:36):

@Sadeep Darshana Awesome, it would still make sense to have a wireframe which is based on our favorite UIs (from gci, vectary etc). I wont block you with this wireframe task right now, as its more important for us to get properly set up and make some progress on the core coding side. So keep doing what you are already doing but soon enough we should consolidate our UI ideas. :innocent: So excited to see your progress.

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

I started a new repository. Implemented basic save/open functions. Integrated the DM from my previous years works.

I accessed rt_i* m_rtip and resource* m_resp from ConstDatabase.h and rt_wdb* m_wdbp from Database.h (which are not public without changing coreinterfaces code) for rendering.

view this post on Zulip Daniel Rossberg (Jun 02 2020 at 11:50):

@Sadeep Darshana Nice to hear that you started working. Where can I find your new repository? What do you plan for the next days?

view this post on Zulip Sadeep Darshana (Jun 04 2020 at 12:06):

I added everything I did for the last few days to this repository. https://github.com/sadeepdarshana/arbalest
Will be pushing daily to this repo.

This is where I am now. image.png

My dev log https://brlcad.org/wiki/User:Sadeep/DevLog-2020

view this post on Zulip Sadeep Darshana (Jun 04 2020 at 12:07):

@Daniel Rossberg

view this post on Zulip Sadeep Darshana (Jun 04 2020 at 12:20):

My immediate focus is on,
1) Making the code a little more cleaner in places where I have imported last year's code.
2) Adding drawable items toolbar to the UI. (support drawing 1 or 2 object types)
3) Implement adding new objects to a MemoryDatabase (to be used with drawing toolbar). (support drawing 1 or 2 object types)

I hope to complete these tasks within today and tomorrow. Anything else I should be focusing on?

view this post on Zulip Daniel Rossberg (Jun 04 2020 at 12:29):

Hi @Sadeep Darshana, thanks for the link to your code. You chose an interesting name for your program :)

You can find code for generating a tree view of the database objects here: https://github.com/drossberg/BrlCadGUI/blob/master/src/MainWindow.cpp#L179

Would this vlist interfacing class help for the graphics output?

view this post on Zulip Sadeep Darshana (Jun 04 2020 at 12:49):

@Daniel Rossberg This will likely help. I can make use of this and change my display manager not to use vlist directly. From my last year's experience I think I dived too much into the rendering part and lost focusing on the UI (which is the core goal of the project. (is it?)). So what I thought was to use last years code for rendering and make improvements to it only after focusing on UI (since we already can display stuff in screen).

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

What do you suggest?

view this post on Zulip Daniel Rossberg (Jun 04 2020 at 12:56):

Sadeep Darshana said:

What do you suggest?

I'm fine with your focus on the user-interface part. This should indeed be the main emphasis of your work. However, you'll gain profit from your last years rendering implementation.

view this post on Zulip Daniel Rossberg (Jun 04 2020 at 12:57):

Sadeep Darshana said:

Daniel Rossberg This will likely help. I can make use of this and change my display manager not to use vlist directly.

I'll backport the VectorList class to the rt^3 repository then.

view this post on Zulip Daniel Rossberg (Jun 04 2020 at 15:50):

Done.
It compiles with Linux, will test on Windows tomorrow. If it works, I don't know. We'll see.

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

great

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

is the code available in the latest revision of rt^3?

view this post on Zulip Daniel Rossberg (Jun 05 2020 at 06:36):

Yes, with revision 76022.

view this post on Zulip Daniel Rossberg (Jun 05 2020 at 06:38):

The Windows build seems to have an issue with the inline constructors of DLL-exported classes. It builds, but complains about them. I don't know how serious it is.

view this post on Zulip Sean (Jun 05 2020 at 07:17):

It could result in version incompatibility if, for example, a DLL were updated but not the application. Code in the application would likely call the inline'd version whereas other libraries Dll-importing the symbol would get the different updated version. This could result in badness, but not a major concern nor is it likely.

view this post on Zulip Daniel Rossberg (Jun 05 2020 at 10:53):

The warnings were abut a member variable of Vector3D type, which is not exported by the DLL. The declaration is fully inline. It looks like the compiler is "worried" that the declaration is different inside and outside the DLL, like it can happen with STL.

Maybe, having not inline constructors will make MSVC happy.

view this post on Zulip Sadeep Darshana (Jun 05 2020 at 11:36):

@Daniel Rossberg I'll use this in the DM. thanks

view this post on Zulip Daniel Rossberg (Jun 05 2020 at 15:08):

I investigated the build warnings a bit more, and decided to not touch them for the moment. It looks like suppressing them would be the best I could do in my case (https://www.cnblogs.com/zhangyz/articles/6238841.html).

The warning is about classes which have non-inline (i.e. real) member functions, which could probably not be present on the client's side. However, Vector3D is a very primitive class with only simple pure inline functions.

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

I implemented creating new geometry and adding to db. (create sphere only with hardcoded parameters, no ui toolbar). Will look at this vlist thing next @Daniel Rossberg

view this post on Zulip Sadeep Darshana (Jun 06 2020 at 17:29):

Qt's using thisCase for method names. Core interfaces is using ThisCase. I only noticed the difference now. So far the code I did follow Qt's convention. Should I switch?

view this post on Zulip Daniel Rossberg (Jun 07 2020 at 13:57):

You don't need to switch.

BTW, having the same naming conventions as somebody else's library, which you use in your own code, can make it hard to distinguish between yours and alien types, functions, etc.. This depends on the definition of "own" and "alien" too.

view this post on Zulip Daniel Rossberg (Jun 07 2020 at 15:40):

Sadeep Darshana said:

I implemented creating new geometry and adding to db. (create sphere only with hardcoded parameters, no ui toolbar).

Did you committed it?

view this post on Zulip Sadeep Darshana (Jun 07 2020 at 16:32):

I implemented creating new geometry and adding to db. (create sphere only with hardcoded parameters, no ui toolbar).

Did you committed it?

https://github.com/sadeepdarshana/arbalest/blob/master/GeometryOperationsManager.cpp

view this post on Zulip Sadeep Darshana (Jun 07 2020 at 16:34):

image.png The generated file name is in lower case. Is this not the case for Linux?

view this post on Zulip Daniel Rossberg (Jun 08 2020 at 11:45):

Sadeep Darshana said:

Did you committed it?
https://github.com/sadeepdarshana/arbalest/blob/master/GeometryOperationsManager.cpp

If you call it explicitly a sphere I recommend to use the Sphere class. There is a primitive with ID_SPH (src/librt/primitives/sph).

view this post on Zulip Daniel Rossberg (Jun 08 2020 at 11:47):

Sadeep Darshana said:

The generated file name is in lower case. Is this not the case for Linux?

No. It's the same as the source file. MSVS has a tendency to change file names to lower case.
However, my patch should work for both now.

view this post on Zulip Sadeep Darshana (Jun 08 2020 at 14:35):

No. It's the same as the source file. MSVS has a tendency to change file names to lower case.
However, my patch should work for both now.

merged it

view this post on Zulip Sadeep Darshana (Jun 08 2020 at 14:40):

If you call it explicitly a sphere I recommend to use the Sphere class. There is a primitive with ID_SPH (src/librt/primitives/sph).

I should have called that Ellipsoid. I just implemented the method to see if it working. Not finalized. I'm working on display manager.

view this post on Zulip Daniel Rossberg (Jun 10 2020 at 16:57):

@Sadeep Darshana How is your progress?

You should commit to your Github repository at least once each working day. And your development log needs an update as well.

view this post on Zulip Sadeep Darshana (Jun 10 2020 at 18:42):

Will commit the changes and give update the log. I was working on DM. Here is what I did.

  1. Rotating with mouse. Currently configured to rotate by dragging with middle mouse button.
  2. Moving (perpendicular to the camera direction) with mouse. Currently configured to move by dragging with right mouse button
  3. Moving forward /backward (camera looking direction) with mouse wheel.
    Configured so that cursor jumps to the other edge when it passes the boundary of opengl display while doing 1. or 2.

  4. Grid lines

I had to spend some time to learn the stuff needed to implement the Camera and did a lot of experimenting to come up with the final solution. Studied representing rotation, creating modelview/projection matrices and using them to render the scene.

view this post on Zulip Sadeep Darshana (Jun 10 2020 at 18:44):

The working code contains a lot of stuff I added to debug since the Camera is still WIP. So I did not commit. Will update the log.

view this post on Zulip Sadeep Darshana (Jun 10 2020 at 18:53):

Also the keyboard shortcuts for 2 and 3

view this post on Zulip starseeker (Jun 10 2020 at 22:44):

@Sadeep Darshana Is the Camera code here of any help/use? https://sourceforge.net/p/brlcad/code/HEAD/tree/rt%5E3/trunk/src/g3d/

view this post on Zulip Sadeep Darshana (Jun 11 2020 at 05:01):

Thanks. I will check this @starseeker .

view this post on Zulip Sadeep Darshana (Jun 11 2020 at 18:52):

From zulip thread general -> coreInterfaces
Daniel Rossberg said:

It is possible to create a list of copies from the elements, but I decided no not explicitly support it (e.g. by providing a Clone() method), because this is not how this list should be used. It would slow down the process. Instead, you should move the corresponding drawing functions to a call-back class:

class ElementOpenGL : public BRLCAD::VectorList::ConstElementCallback {
public:
    virtual bool operator()(const Element* element) {
        switch (element->Type()) {
        case BRLCAD::VectorList::Element::PointDraw:
            BRLCAD::VectorList::PointDraw* pointDraw = static_cast<BRLCAD::VectorList::PointDraw*>(element);
            // put your OpenGL code here
            break;

        case BRLCAD::VectorList::Element::PointSize:
             BRLCAD::VectorList::PointSize* pointSize = static_cast<BRLCAD::VectorList::PointSize*>(element);
            // put your OpenGL code here
            break;
        // ...
       }
    }
};

void DrawVectorList(const VectorList& vectorList) {
    ElementOpenGL elementOpenGL;
    vectorList.Iterate(elementOpenGL);
}

This code demonstrates the principle only. It doesn't contain all necessary methods, checks, etc..

But @Daniel Rossberg , would this not slow things down instead of making things faster?
I had actually considered doing this but then decided against it due to the following reason. Think of the 2 scenarios.

Case 1 - We call opengl methods inside Iterate()
Each time the opengl scene is redrawn we need to call Iterate. In each call all elements in m_vlist are used to build C++ class instances. A single call to Iterate costs approximately the time taken to clone a list (if implemented) that contains all the Elements.
Each time the geometry is changed we need to call Plot. In this call m_vlist is built.

Total cost in a session = (# OpenGL redraws * costs for Iterate) + (# geometry edits * cost for Plot)

Case 2 - We generate and save the list of all elements when Plot is called and keep using that same list for drawing until geometry is changed again.

Total cost in a session = # geometry edits * (cost for Plot + costs for Iterate+ cost to clone the list)

Cost to clone the list can be avoided if supported by coreinterfaces (e.g allocated on heap)

The big difference between the cost happens in the way it is used in practice. (# OpenGL redraws) is hugely higher than (# geometry edits). This is because most of the time users navigate the 3d space. Even when a user rotates opengl camera by 90 degrees, if it goes smoothly there will be 100 frames for that move itself. But for an entire 30 minutes session he would only do less than 100 edits to the geometry. Putting the overhead of generating C++ instances from m_vlist to every opengl draw frame IMO is more costly since it is roughly the cost to clone the list.

Maybe we can optimize case 2 further by doing m_vlist > c++ classes conversion only for changes geometry .

Not sure I understood stuff correctly.
@Daniel Rossberg

view this post on Zulip Sadeep Darshana (Jun 11 2020 at 18:53):

I implemented multiple document support to the application today. Now we can open and work with several databases.

view this post on Zulip Sadeep Darshana (Jun 11 2020 at 19:00):

The grid is very ugly. I need to make it fade away with the distance to the camera. Otherwise everything in far horizon looks like a highly concentrated mess of lines. But this might require shaders. Not sure if I should prioritize on something else.

view this post on Zulip Daniel Rossberg (Jun 11 2020 at 19:04):

Calling Iterate() is cheap. It does, what the usual iteration over a bn_vlist does: It uses BU_LIST_FOR() and has switch/case. The Element classes it constructs are cheap too: They need only a minimal amount of stack memory (no memory allocation on the heap at all) and all methods necessary to construct them are inline. This can be optimized to almost nothing. The whole procedure is very close to what is done with the bn_vlist in mged/archer.

view this post on Zulip Sadeep Darshana (Jun 11 2020 at 19:09):

I'll proceed with that way. Is there a place I can download .g models?. I searched in the internet. I couldn't find any.

view this post on Zulip Daniel Rossberg (Jun 11 2020 at 19:14):

They did some efforts to optimize the time consumed by handling vlists in BRL-CAD. If they did it well, the coreInterface should gain profit from it too by not using std::vector or std::list and not using heap memory - but using the original structs and algorithms.

view this post on Zulip Sadeep Darshana (Jun 11 2020 at 19:14):

  1. Should I plot for each object or each object in root level in the tree? (i.e does ploting an object recursively plots its children too?)
  2. Does BRLCAD::ConstDatabase::TopObjectIterator return all objects or all objects in root level?

view this post on Zulip Daniel Rossberg (Jun 11 2020 at 19:14):

You can find .g's in your BRL-CAD installation at share/db.

view this post on Zulip Sadeep Darshana (Jun 11 2020 at 19:16):

Daniel Rossberg said:

They did some efforts to optimize the time consumed by handling vlists in BRL-CAD. If they did it well, the coreInterface should gain profit from it too by not using std::vector or std::list and not using heap memory - but using the original structs and algorithms.

I thought recreating C++ classes might be time consuming compared to reuse.

view this post on Zulip Sadeep Darshana (Jun 11 2020 at 19:17):

I had forgotten to account for the stuff happening in std classes like vector

view this post on Zulip Daniel Rossberg (Jun 11 2020 at 19:18):

  1. Should I plot for each object or each object in root level in the tree? (i.e does ploting an object recursively plots its children too?)

Plotting is recursive. You should plot whatever was selected from the objets' tree.

  1. Does BRLCAD::ConstDatabase::TopObjectIterator return all objects or all objects in root level?

Only the ones at root level. See https://github.com/drossberg/BrlCadGUI/blob/master/src/MainWindow.cpp#L179 for an algorithm to walk down the objects tree if you know the roots.

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

Thanks. I will implement the DM and commit everything I did in the past days.

Also what do you think about (not) committing WIP code? I have a lot of log statements and code I write just for experimenting without implementing the real thing in a solid manner. How should I deal with this (in the future)?

view this post on Zulip Daniel Rossberg (Jun 11 2020 at 19:24):

Sadeep Darshana said:

I thought recreating C++ classes might be time consuming compared to reuse.

Yes, might be time consuming.

BTW, did you know that struct and class are almost the same in C++? The only difference is, that for a struct the default visibility is public, but for a class it's private. I.e., if your class is the same as a struct with with 3 doubles and a trivial, inline constructor - and a pointer to a virtual function table.

view this post on Zulip Daniel Rossberg (Jun 11 2020 at 19:30):

Sadeep Darshana said:

Also what do you think about (not) committing WIP code? I have a lot of log statements and code I write just for experimenting without implementing the real thing in a solid manner. How should I deal with this (in the future)?

If it compiles, commit it. This gives yourself check points too, where you can follow your progress. You may reject some of them while your development progresses, but you can always look back and have a rethink.

And your mentors can see if you run in avoidable trouble and help you.

view this post on Zulip Daniel Rossberg (Jun 11 2020 at 19:34):

All in all, it sounds promising what you are doing. And I know that the display manager stuff is hard. This isn't a 3 days thing. I expect you to work on it the whole summer. Every time you implement a new feature, you may need to adapt something in the DM.

view this post on Zulip Sadeep Darshana (Jun 11 2020 at 19:48):

It compiles. I committed it and pushed.

view this post on Zulip Inder Singh (Jun 12 2020 at 19:03):

Hi @Sadeep DarshanaCongratulations on getting started with the coding part. Just a suggestion, it would be really helpful to add some description and a very quick readme file to the project. :) If we keep our documentation maintained from now onwards, it won't be difficult at the end. We don't need crazy docs for now, just couple of lines on what this project is, may be some instructions on how to set it up etc.\

view this post on Zulip Sadeep Darshana (Jun 12 2020 at 19:56):

@pooh (Inderpreet Singh) https://github.com/sadeepdarshana/arbalest/blob/master/README.md

view this post on Zulip Inder Singh (Jun 12 2020 at 20:12):

Awesome, thanks! @Sadeep Darshana

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

@Daniel Rossberg
from dm-wgl.c

int
wgl_drawVList(dm *dmp, struct bn_vlist *vp)
{
    struct bn_vlist *tvp;
    register int    first;
    register int mflag = 1;
    float black[4] = {0.0, 0.0, 0.0, 0.0};
    GLfloat originalPointSize, originalLineWidth;
    GLdouble m[16];
    GLdouble mt[16];
    GLdouble tlate[3];

    glGetFloatv(GL_POINT_SIZE, &originalPointSize);
    glGetFloatv(GL_LINE_WIDTH, &originalLineWidth);

    if (dmp->dm_debugLevel)
    bu_log("wgl_drawVList()\n");

    /* Viewing region is from -1.0 to +1.0 */
    first = 1;
    for (BU_LIST_FOR(tvp, bn_vlist, &vp->l)) {
    register int    i;
    register int    nused = tvp->nused;
    register int    *cmd = tvp->cmd;
    register point_t *pt = tvp->pt;
    GLdouble glpt[3];

Some of the variables here (corresponding ones in our implementation) will be used across multiple Elements. I can declare them static in the class or declare them in the header outside any class. I believe this won't have any performance impact though they aren't declared in stack.

view this post on Zulip Daniel Rossberg (Jun 13 2020 at 08:58):

These would be member variables of class ElementOpenGL in my example.

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

I am trying to getting the DM into working. It doesn't display stuff correctly. And opengl is not updating.

Also please check this. https://sourceforge.net/p/brlcad/patches/544/ @Daniel Rossberg

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

DM working now.

  1. What's the thing with objects having different colors in archer and mged? Are the colors a property of these objects? (as opposed to they being an indicator). Where is it implemented (the 17 commands of vlist don't seem to have a setColor)

  2. This is slower than archer or mged (smoothness when rotating camera). It's hardly noticeable. But noticeable if you specifically try to notice that.
    Could this be since I'm using perspective projection? I'm in the mid of implementing Orthographic btw)

view this post on Zulip Daniel Rossberg (Jun 13 2020 at 17:21):

Sadeep Darshana said:

Also please check this. https://sourceforge.net/p/brlcad/patches/544/ Daniel Rossberg

Looks reasonable. I may need some days to commit it, when I've more time.

view this post on Zulip Daniel Rossberg (Jun 13 2020 at 17:24):

Sadeep Darshana said:

  1. This is slower than archer or mged (smoothness when rotating camera). It's hardly noticeable. But noticeable if you specifically try to notice that.
    Could this be since I'm using perspective projection? I'm in the mid of implementing Orthographic btw)

It should be a bit slower because of the C++ interface overhead.

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

I think I need to change the way of rotating and moving camera.
Should I look into how it is done in Archer?
Also does archer set initial zoom level / how close based on the size of the model?
Should I only focus on orthographc?

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

Also what about that color thing?

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

What's the thing with objects having different colors in archer and mged? Are the colors a property of these objects? (as opposed to they being an indicator). Where is it implemented (the 17 commands of vlist don't seem to have a setColor) @Sean

view this post on Zulip Sean (Jun 15 2020 at 14:57):

Sadeep Darshana said:

I think I need to change the way of rotating and moving camera.
Should I look into how it is done in Archer?
Also does archer set initial zoom level / how close based on the size of the model?
Should I only focus on orthographc?

Did you check out the g3d repo starseeker mentioned? It has three working camera implementations in there including one that works the same as Archer, another that works like Blender, and another that works like a lot of games.

view this post on Zulip Sean (Jun 15 2020 at 14:57):

The initial zoom level is based on the overall bounding box of the geometry when it's displayed. This is calculated pretty quickly.

view this post on Zulip Sean (Jun 15 2020 at 15:07):

Sadeep Darshana said:

What's the thing with objects having different colors in archer and mged? Are the colors a property of these objects? (as opposed to they being an indicator). Where is it implemented (the 17 commands of vlist don't seem to have a setColor) Sean

Colors are actually a bit of a complicated subject. Yes, they are a property of geometry. There are a variety of rules for how colors work. The summary is that there are essentially three ways an object gets a color.

First and most simple is an object can have a color specified directly on that object. This is stored as an attribute on the object.

Second, an object can inherit a color from a parent object. For example, say you have some "engine" object and way down the hierarchy there is a "bolt". We can set a color on engine and bolt can inherit the color when it's displayed in the context of an engine. In this manner, bolt will not have a color if it's displayed by itself (i.e., NOT in context of an engine).

Third, an object's color may come from a global color table. For regions and object belonging to a region, they have a numeric identifier set on them as an attribute (e.g., regionID is "1000"). The color table can specify all objects 1000-3000, for example, are rgb 255/0/0.

There is not a succinct function to get an object's color, but you can find the core logic in a few places throughout the code. The cleanest appears to be in src/libged/display_list.c, start with the color_soltab() function.

view this post on Zulip Sadeep Darshana (Jun 15 2020 at 16:59):

Did you check out the g3d repo starseeker mentioned? It has three working camera implementations in there including one that works the same as Archer, another that works like Blender, and another that works like a lot of games.

I did look at this. I could not get it built since it required some Orge to build. So I gave up on that. I will look at the camera code in it.

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

I'm trying to get rid of the windows title bar. It's just a waste of space, ugly and almost all apps in 2020 (VS, all jetbrains products, adobe all, chrome) use their own. There is no straight forward way to do this in qt it seems.

view this post on Zulip Daniel Rossberg (Jun 17 2020 at 17:47):

You can try to set the flags parameter of the QMainWindow constructor appropriately.

BTW, I don't like it if an application doesn't has it ;)

view this post on Zulip Sadeep Darshana (Jun 17 2020 at 18:38):

That of course is the first thing I tried. Qt::FramelessWindowHint and Qt::CustomizeWindowHint exist. But when those flags are set the OS (at least Windows) do not treat the window as a normal window. No resizing possible. Clicking the taskbar icon doesn't minimize the application. No moving. No Aero Snap.

Community seems to be using this https://github.com/dfct/TrueFramelessWindow. It uses native win32 calls and do stuff. Problem with this is you can't select close by moving cursor to the top right corner (because there is like 1px border around the button, I'm trying to figure out where this comes from). So you need to move a very small amount towards center from corner which is inconvenient.

view this post on Zulip Sadeep Darshana (Jun 17 2020 at 21:52):

@Daniel Rossberg I implemented rendering directly from bn_vlist too. Now we can choose between using VectorList and bn_vlist.
(change bool ArbalestSettings::useLegacyVlists)

I did this mostly to evaluate the performance differences. For share/db/goliath.g, bn_vlist renderer works seamlessly (similar to Archer/MGED). VectorList renderer is noticeably slower.

Did we consider the potential overhead of creating a function stack for each element? I think that might be more expensive than class instantiating. Also I had to dynamic_cast Elements, I believe this does not cost much.

Btw im accessing the underlying C list from VectorList for bn_vlist renderer. Are we going to continue having support for both methods? (will have to create a getter for VectorList::m_vlist if so)

view this post on Zulip Sadeep Darshana (Jun 17 2020 at 21:58):

Also check if I'm doing anything incorrectly when using VectorList (resulting in bad performance)

view this post on Zulip Daniel Rossberg (Jun 18 2020 at 17:54):

Sadeep Darshana said:

That of course is the first thing I tried. Qt::FramelessWindowHint and Qt::CustomizeWindowHint exist. But...

Or Qt::WindowFlags() | Qt::CustomizeWindowHint. But, this only removes the standard decoration. I.e., you have to draw your own one by hand now, give it a frame, put the minimize, maximize, and close buttons in the menu bar, etc. - I think. I haven't tried it by myself yet.

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

I've been studying libged and tclcad. It is doing a lot underneath before generating vlists. Without this we are losing all the colors and other effects.

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

I did not do any new implementations. Trying to understand the code in the BRLCAD repo. Now I have a better understanding of how libged, display_lists and dm (I was only familiar with drawVList method) works.
Even the lists are weird :speechless:

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

@Sean @Daniel Rossberg @pooh (Inderpreet Singh) The amount of things we need to do to re-implement the geometry displaying as it is done in the 2 existing editors code is huge. So far I was just displaying the vlist obtained from ft_plot (generated for the whole tree at once by passing all the leaf nodes, therefore all solids are same style/color, I'm using ConstDatabase::Plot for this). I'm passing this vlist to my drawVList() implementation (I have not implement other methods in dm). But when I study the code for Archer, I realize that in archer the logic is lot more complex than this.
I have been studying the methods in libdm, libged and libtclcad. I see several choices here,

  1. Reuse libged, my application would create an instance and communicate via the command interface of ged just like tcl does.
  2. Implement a minimal amount of the features needed to save n reuse display lists and differentiate colors
  3. ignore this issue and work on a different area like create some toolbars (we can already display geometry in one color)

If going with 1, should I put the implementation under coreinterfaces?
If going with 2, do you recommend implementing a minimal subset of feature in C++ or linking libdm, libged and libtclcad?
If going with 3, single color wireplots don't look pretty

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

Although I talked mainly about color enabling color and display_lists, in archer it does a lot more than that in addition to displaying wireframes. Likely it will take too long to integrate that all. My preference is 2. implementing the minimal features in C++ without using the libraries. (if using libraries we'll have to deal with BU_LISTS etc)

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

Until they respond, I have a smaller but potentially helpful/useful task: the qged code in the branch qtged SVN branch:

https://sourceforge.net/p/brlcad/code/HEAD/tree/brlcad/branches/qtged/src/qged/

has an accordion widget: https://sourceforge.net/p/brlcad/code/HEAD/tree/brlcad/branches/qtged/src/qged/QAccordionWidget.cxx

This widget needs some behavioral refinements - in particular, if all the accordion panels are closed, the spacing of the widget gets strange and it loses it's prior width. This widget will likely be useful in the future, and should be fairly "stand-alone" to work on.

The qged code itself can be built with -DBRLCAD_ENABLE_QT=ON set for CMake - there is no display code, but if you open a .g file (share/db/pinewood.g is the one I usually used) you should be able to do a variety of GUI manipulations.

There are other widgets there that need some work - the tree widget, for example, has graphical elements that don't quite line up properly when the tree is expanded - if you get through the accordion widget quickly.

view this post on Zulip Sadeep Darshana (Jun 21 2020 at 15:55):

I'll look at this @starseeker thanks

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

Another challenge - the CADTreeView horizontal scrollbar doesn't seem to be working correctly - it is present, but doesn't calibrate correctly to the tree contents.

view this post on Zulip starseeker (Jun 21 2020 at 18:14):

https://stackoverflow.com/questions/6625188/qtreeview-horizontal-scrollbar-problems might be a place to start, but it's been to long and I don't know if what they're discussing there is relevant to our code...

view this post on Zulip starseeker (Jun 21 2020 at 18:15):

equally likely (or even more likely) that some calculation in our code is off...

view this post on Zulip Daniel Rossberg (Jun 21 2020 at 18:41):

@Sadeep Darshana These are good questions. They show, that you made progress.

At first, you should be aware that you won't be able to program a complete CAD GUI in 3 months. I.e., you have to set priorities for yourself.

I personally wouldn't support the idea of using libged functions, because I'm afraid of not being able to extend them with new CAD features, if they are not implemented with the GUI code. You project is not about writing a new mged or archer, but a new generation graphical user interface, like someone would expect it from AutoCAD, for example. Maybe, the other mentors have a slightly different opinion here.

And, I don't see such a big problem with the colors. I have a model, where mged displays black edges on a dark-blue background (because the objects are black). This would be impossible for a CAD. There, it is important to have a good contrast.

To work on different things can be good to keep the code flowing and wait for inspiration on the areas where you got stuck.

view this post on Zulip Sadeep Darshana (Jun 22 2020 at 19:55):

I'm making support for displaylists in C++ code. (this does solve the issue with the colors too)

view this post on Zulip Sean (Jun 25 2020 at 22:00):

@Sadeep Darshana I also agree that those are/were fantastic questions. I think any of the three would be perfectly reasonable next steps to work on. That said, I wouldn't put colors on the priority list. I think we'll get far more mileage and usefulness if you keep working on other aspects.

I agree with Daniel in that I wouldn't think it a great approach to use libged for aspects of GUI drawing. That said, I do think it would be awesome to be able to call some GED commands on opened geometry (e.g., call the search command or ls command or l command to introspect, etc). How to go about is up for interpretation.

view this post on Zulip Sean (Jun 25 2020 at 22:03):

I'd think you'd probably get the most mileage merging the features of qtged and getting other basic aspects of the GUI sorted out (e.g., full screen, windowed, drag-n-drop, etc.). Then, maybe work on getting triangle display lists working as an alternative to wireframes (similar to ft_plot, uses ft_tess).

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

FWIW, qged can already run ls and search on a .g file...

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

@Sadeep Darshana Also, since you are already working on display lists, please keep in mind that it's perfectly viable to add new/additional functions not only to MOOSE but to the other low-level libraries as well as well. for example, there's no reason you can't add a new function to librt or libwdb or [insert lib] so long as it's within scope of the library. for example, the code you wrote for ft_plot traversal would easily make sense as a general function somewhere: given an object, get its wireframe.

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

only difference is moose should be pure/clean c++. the low-level libs can be implemented in c++, but their public API need to get marshaled via C data types.

view this post on Zulip Inder Singh (Jun 26 2020 at 12:43):

Hey @Sadeep Darshana what time zone are you in? Nothing major, I was just looking through your dev log and found entries for 27th June already :D so was confused.

view this post on Zulip Inder Singh (Jun 26 2020 at 12:47):

Sadeep Darshana said:

Thanks. I will implement the DM and commit everything I did in the past days.

Also what do you think about (not) committing WIP code? I have a lot of log statements and code I write just for experimenting without implementing the real thing in a solid manner. How should I deal with this (in the future)?

The unofficial official motto of open source dev is "commit small, commit often" - and I would go to length and say, whenever you leave your computer for a break, make a commit (as daniel said if it compiles, its good enough to commit). Also, those commits would be really helpful in your evaluations. It's just another way of communicating progress and showcasing your workflow.

You can use the branch -> Pull Request workflow to keep things organized. I would suggest you keep committing in a feature branch, and then send a PR to the dev branch and once the code is reviewed by someone, it can be merged in to the main codebase/ master branch.

@Sean should we move/clone sadeep's code in the official GitHub org we have?

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

pooh (Inderpreet Singh) said:

Hey Sadeep Darshana what time zone are you in? Nothing major, I was just looking through your dev log and found entries for 27th June already :D so was confused.

Not sure what you are saying about
image.png
image.png

https://brlcad.org/w/index.php?title=User:Sadeep/DevLog-2020&action=history
@pooh (Inderpreet Singh)

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

Feature branch sounds like a good idea.

view this post on Zulip Sean (Jun 26 2020 at 17:07):

@Sadeep Darshana so curious, did you compare the performance of vlist with VectorList?

view this post on Zulip Sean (Jun 26 2020 at 17:11):

pooh (Inderpreet Singh) said:

Sean should we move/clone sadeep's code in the official GitHub org we have?

Yes, I would think it could have even started there, but no worries. It would be good to get it all together in one place.

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

I did. VectorList is noticeably slower. Can feel the difference when rotating the camera with mouse. I did not do any time measuring (can do it if required)
But this does not matter anymore since I'm using displaylists and drawVList is not called every frame. So I deleted the vlist implementation (should be there in the older commits).

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

@Sean I implemented color and style (DM_DASHED_LINE) to displaylist. I wonder why everything is so complex in the old libs. Is the underlying logic behind them really that complex?

view this post on Zulip Sean (Jun 26 2020 at 17:35):

It's not required. Just curious about the performance, and good to know. We should try some models with a more typical level of detail, thousands of objects and instances.

view this post on Zulip Sean (Jun 26 2020 at 17:37):

The underlying logic is pretty complicated. It's almost guaranteed that your wireframe colors will not match the actual ray tracing colors. A lot of the complexity is also accumulation of optimizations, feature creep, and complexity of procedural code.

view this post on Zulip Sean (Jun 26 2020 at 17:39):

@Sadeep Darshana Instances add a fair bit of complexity, for example. Say you have a bolt on a truck. It keeps track of one copy of that bolt as it might be used 10,000 times around the vehicle and you don't want 10,000 copies of it in memory.

view this post on Zulip Sean (Jun 26 2020 at 17:40):

Yet while you might have only 1 copy of the bolt, the instances of the bolt might be different colors .. which has to be kept track of separately.

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

I did not think of any of these. This is my whole color / styling logic

    if (tsp->ts_mater.ma_color_valid) {
        gr->setFGColor(tsp->ts_mater.ma_color[0], tsp->ts_mater.ma_color[1], tsp->ts_mater.ma_color[2], 1);
    }
    else {
        gr->setFGColor(gr->defaultWireColor[0], gr->defaultWireColor[1], gr->defaultWireColor[2], 1);
    }

    gr->setLineAttr(-1,tsp->ts_sofar & (TS_SOFAR_MINUS|TS_SOFAR_INTER));

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

There were few cases I had noticed but not yet implemented like the DM options for overriding solid's colors

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

@Sadeep Darshana did anything come of the camera modes from the old OGRE code?

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

@starseeker I created my own implementation since I couldn't anyway use g3d as it is. I did not study g3d a lot.

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

@Sean In my implementations I have used the C methods like db tree walk, also in the above code if you notice. How do I deal with this? My implementations are certainly not worth to be put among the old C libs since the functionalities are a subset of what's already there. SHould I use them through a coreinterface interface?

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

my specific need here is db_walk_tree. Do I need to wrap it?

view this post on Zulip Sean (Jun 26 2020 at 19:35):

you should -- I believe it's called elsewhere wrapped

view this post on Zulip Sadeep Darshana (Jul 02 2020 at 19:41):

Do I need to implement immediate mode (no display lists). I created this partially for debugging qged. But it is very badly optimized (ft_plot everyframe). Need to make some changes if keeping it as a feature. Do we need to support it? @Sean

view this post on Zulip Sadeep Darshana (Jul 02 2020 at 19:42):

I can remove it thing alternatively

view this post on Zulip Sean (Jul 02 2020 at 22:18):

Immediate mode is dead.

view this post on Zulip Sean (Jul 02 2020 at 22:20):

Any new code should be using "the new way" via opengl 4, vulkan, or a lib that wraps one of them.

view this post on Zulip Sadeep Darshana (Jul 03 2020 at 05:48):

What about fixed function pipeline?
The new way is to use shaders for everything. Yet everything is done in the BRL-CAD with the old way. Everywhere in the internet they say FFP is deprecated and should not be used.
Just asking, updating to this would need a radical change from the existing code.

view this post on Zulip Sean (Jul 03 2020 at 05:50):

The new way is not so different from what is already used in BRL-CAD for display lists.

view this post on Zulip Sean (Jul 03 2020 at 05:51):

The data can be just filled into a vertex buffer + glDrawArrays(), e.g., https://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_05

view this post on Zulip Sean (Jul 03 2020 at 05:52):

at least it's that simple for drawing points, wireframes, and polygons

view this post on Zulip Erik (Jul 03 2020 at 13:16):

probably might be worth thinking about changing glColor stuff to fragment shaders some day if it's still there O.o ffp is dead, yo

view this post on Zulip Daniel Rossberg (Jul 03 2020 at 13:22):

I'm in doubt if it is reasonable to put much effort in tweaking the OpenGL code. There is a new Qt 3D API in development https://doc.qt.io/qt-5/qt3d-index.html which puts an abstraction layer above the rendering engine. Especially on Windows the performance of Direct3D is usually better than OpenGL. In addition, OpenGL don't run everywhere.

Instead, you shouldn't forget the other aspects of the GUI. For example the creation and modification of database objects, or an undo/redo feature. You can't implement everything in these 3 months, but you should aim for creating a framework where the biggest issues are already addressed (not necessarily solved!).

view this post on Zulip Erik (Jul 03 2020 at 13:24):

fair. :)

view this post on Zulip Erik (Jul 03 2020 at 13:24):

undo/redo tree would be... nice.

view this post on Zulip Sean (Jul 03 2020 at 13:37):

Qt3D is definitely the way to go. I meant more that you shouldn't need to be modifying existing code radically either way, not to suggest working on OpenGL makes sense beyond just getting/keeping the demonstration working.

view this post on Zulip Sadeep Darshana (Jul 03 2020 at 14:38):

How do I wrap db_walk_tree? It contains complex structs (which themselves consist of more structs) like db_tree_state, db_full_path, rt_db_internal, bg_tess_tol, bn_tol.

view this post on Zulip Sadeep Darshana (Jul 03 2020 at 20:07):

Is std::vector<std::string> preferred over char** to pass a list of names? (when developing on top of coreinterfaces)

view this post on Zulip Sadeep Darshana (Jul 03 2020 at 22:13):

@Daniel Rossberg
Please review this https://sourceforge.net/p/brlcad/patches/546/ and let me know if/how this can be improved.
It wraps db_walk_tree.

For your convenience, this is how it is accessed from the outside,
https://github.com/sadeepdarshana/arbalest/blob/9188c17c074da7355579d26ee83933fa06199d0f/src/display/GeometryRenderer.cpp: line 63 and void GeometryRenderer::drawSolid method (line 73 onwards)

view this post on Zulip Sadeep Darshana (Jul 03 2020 at 22:25):

@Daniel Rossberg @Sean What is the criteria for making the wireframe lines dashed (I have already implemented this).
What do these mean TS_SOFAR_MINUS, TS_SOFAR_INTER? SOFAR as in "so far as we traverse in the db"?
Need to implement an accessor to tsp->ts_sofar in coreinterface (TreeLeaf) with a meaningful name

view this post on Zulip Sadeep Darshana (Jul 03 2020 at 22:27):

Now the codebase fully depends on coreinterfaces. No access to low level code.

view this post on Zulip Erik (Jul 04 2020 at 13:45):

@Sadeep Darshana take a moment to read about serialization, these are the same challenges as db_walk_tree

view this post on Zulip Sadeep Darshana (Jul 04 2020 at 13:50):

@Erik thanks, I will. Btw I'm not reimplementing the feature. I want to wrap the C method in coreinterface and give a more convenient interface to the outside.

view this post on Zulip Erik (Jul 04 2020 at 13:53):

Yeah, it should follow python idiomatic design, the recursive serialization pattern shows what you will need to worry about as you bridge the two paradigms :)

view this post on Zulip Erik (Jul 04 2020 at 13:54):

Eh, python or qt or whatever, it's how to get all the right data to shove it in another system

view this post on Zulip Daniel Rossberg (Jul 04 2020 at 16:49):

Sadeep Darshana said:

How do I wrap db_walk_tree? It contains complex structs (which themselves consist of more structs) like db_tree_state, db_full_path, rt_db_internal, bg_tess_tol, bn_tol.

Why do you want to do this? The C++ core interface has already a tree walking mechanism. I pointed you to an example where this mechanism is used to create an object tree widget in Qt.

view this post on Zulip Daniel Rossberg (Jul 04 2020 at 17:03):

BTW, it looks like you abuse the auto specifier. You use it mainly (only?) at places, where you could write the concrete type as well. Whereas it's less typing, it makes it harder to understand the code (because you don't name the types) and find the places where a class is used.

view this post on Zulip Sadeep Darshana (Jul 04 2020 at 17:10):

I didn't know that the functionality already existed. I thought that was only for top object. I'll change the code to use the existing implementation.

view this post on Zulip Daniel Rossberg (Jul 04 2020 at 17:18):

Well, it's a combination of FirstTopObject() with TopObjectIterator and Get() with ObjectCallback().

view this post on Zulip Daniel Rossberg (Jul 04 2020 at 17:18):

Look at the Qt object tree example.

view this post on Zulip Daniel Rossberg (Jul 04 2020 at 17:19):

For the Plot() you have to play with Select() and UnSelectAll().

view this post on Zulip Daniel Rossberg (Jul 04 2020 at 17:23):

And remember hat there is a difference between comm_shifter_box.r and all/Shifter/comm_shifter_box.r.

view this post on Zulip Sadeep Darshana (Jul 11 2020 at 20:27):

image.png

view this post on Zulip starseeker (Jul 11 2020 at 20:32):

Neat!

view this post on Zulip starseeker (Jul 11 2020 at 21:01):

@Sadeep Darshana did the docking stuff end up being too complicated to tangle with?

view this post on Zulip Sadeep Darshana (Jul 11 2020 at 21:10):

No, I only have one (object tree) of them yet.

view this post on Zulip Daniel Rossberg (Jul 12 2020 at 15:10):

Just looking at your code: You are using brlcad/vmath.h there. Did you considered to use QMatrix4x4 and QVector3D?

view this post on Zulip Sadeep Darshana (Jul 12 2020 at 15:28):

I am thinking about changing that. It doesn't compile on linux due to brlcad/vmath.h. Also in windows I have to build twice after every CMake reload. In the first attempt it says can't find vmath.h. Works well after running build again.

If that is an alternative I'll use it.

view this post on Zulip Daniel Rossberg (Jul 12 2020 at 17:32):

Try #include <vmath.h>.

The C++ core interface contains intentionally no vector functions, because it's expected that the project using it already has them. For example, a large framework like Qt has already types for matrices and vectors, and the basic algorithms like computing the inverse are build in. There is no need to mess with an additional library.

view this post on Zulip Daniel Rossberg (Jul 12 2020 at 17:34):

BTW, the wireframe drawing works well on my computer :)

view this post on Zulip Sadeep Darshana (Jul 12 2020 at 19:38):

Replaced the vmath.h with QMatrix4x4 and QVector3D. What is your platform? How well does the window work without the title bar?

view this post on Zulip Sadeep Darshana (Jul 12 2020 at 19:56):

BTW daniel, did you look at my implementation of the traversing the tree for drawing (GeometryRenderer::DatabaseWalker)?
I was using std::string to pass the path as it traversed through the db. Is there a better way to access the objects than using the entire path?

I can have a single big (enough to hold the longest object path I might encounter) char array and append characters if creating an entire new string each time we go to a new db object is not fast enough.

view this post on Zulip Sadeep Darshana (Jul 12 2020 at 20:00):

What was that thing about Select and UnSelectAll in ConstDatabase? I only used FirstTopObject() TopObjectIterator Get() ObjectCallback() for plotting.

view this post on Zulip Sadeep Darshana (Jul 12 2020 at 20:02):

I couldn't understand the meaning by reading the doc. What is an active set?

view this post on Zulip Daniel Rossberg (Jul 13 2020 at 15:29):

Sadeep Darshana said:

What is your platform?

I use Windows and Linux.

How well does the window work without the title bar?

I don't know. I like the title bar.

view this post on Zulip Daniel Rossberg (Jul 13 2020 at 15:44):

Sadeep Darshana said:

BTW daniel, did you look at my implementation of the traversing the tree for drawing (GeometryRenderer::DatabaseWalker)?
I was using std::string to pass the path as it traversed through the db. Is there a better way to access the objects than using the entire path?

I can have a single big (enough to hold the longest object path I might encounter) char array and append characters if creating an entire new string each time we go to a new db object is not fast enough.

There is nothing wrong with using std::string. It encapsulate the necessary memory management for the creation of object paths in a class. That's fine.

If there are better ways to access the objects depends on which information do you want to get and how much do you want to compute by yourself. With the Combination object you have access to all available information. It contains the complete Boolean tree with the operations and transformations. I.e., if you walk through the trees like you did in ObjectsTreeView and evaluate the transformations in addition, you get everything what's there.

view this post on Zulip Sadeep Darshana (Jul 13 2020 at 15:48):

I don't know. I like the title bar.

You mean you like the native title bar? or the one that I implemented? When I said "How well does the window work without the title bar?" I meant does it look buggy without the native title bar?
Because it should. Some features like resize and " drag to top to maximize are not working". I have implemented dragging only out of the missing features
.

view this post on Zulip Daniel Rossberg (Jul 13 2020 at 15:49):

Sadeep Darshana said:

What was that thing about Select and UnSelectAll in ConstDatabase? I only used FirstTopObject() TopObjectIterator Get() ObjectCallback() for plotting.

Okay, I see. Indeed, plotting is a database operation, but it doesn't depend on Select() but gets the object name as parameter.

BTW, this Select() and UnSelectAll() is the equivalent to "e" or "draw" and "Z" in mged.

view this post on Zulip Sadeep Darshana (Jul 13 2020 at 15:50):

So I won't need to use Select() and UnSelectAll()?

view this post on Zulip Sadeep Darshana (Jul 13 2020 at 15:57):

I was working on UI and stylsheet processing.
I'm implementing object properties widget now.

As I understand I will have to determine the type of the object selected in the tree (Ellipsoid / Cone / Combination). Then look for the properties of the type in the corresponding coreinterface class. And display all of them.

What are the properties I cannot find this way?
Ex: Color
Where can I find a list of other such properties.

view this post on Zulip Daniel Rossberg (Jul 13 2020 at 15:58):

Sadeep Darshana said:

So I want need to use Select() and UnSelectAll()?

They shouldn't be necessary. Your database->Plot(name,vectorList); seems to work. However, they are necessary for the ray-trace.

view this post on Zulip Daniel Rossberg (Jul 13 2020 at 16:00):

You need to create a properties widget for every object type.

view this post on Zulip Daniel Rossberg (Jul 13 2020 at 16:00):

The color is a property of Combination.

view this post on Zulip Sadeep Darshana (Jul 13 2020 at 16:02):

When I look at QGED i see things like region, material id, aircode. I don't fully understand them. Maybe I should start using brlcad before developing.

view this post on Zulip Sadeep Darshana (Jul 13 2020 at 16:03):

I'll follow the tutorial

view this post on Zulip Daniel Rossberg (Jul 13 2020 at 16:04):

from Combination.h

        FastgenType           FastgenRegion(void) const;
        void                  SetFastgenRegion(FastgenType value);
        int                   RegionId(void) const;
        void                  SetRegionId(int value);
        int                   Aircode(void) const;
        void                  SetAircode(int value);
        int                   GiftMaterial(void) const;
        void                  SetGiftMaterial(int value);
        int                   LineOfSight(void) const;
        void                  SetLineOfSight(int value);
        bool                  HasColor(void) const;
        void                  SetHasColor(bool value);
        double                Red(void) const;
        void                  SetRed(double value);
        double                Green(void) const;
        void                  SetGreen(double value);
        double                Blue(void) const;
        void                  SetBlue(double value);
        const char*           Shader(void) const;
        void                  SetShader(const char* value);
        bool                  Inherit(void) const; ///< override lower nodes color and shader
        void                  SetInherit(bool value);
        const char*           Material(void) const;
        void                  SetMaterial(const char* value);
        double                Temperature(void) const;
        void                  SetTemperature(double value);

view this post on Zulip Daniel Rossberg (Jul 13 2020 at 16:05):

Sadeep Darshana said:

Maybe I should start using brlcad before developing.

Maybe :wink:

view this post on Zulip Daniel Rossberg (Jul 13 2020 at 16:06):

And

        bool                  IsRegion(void) const;
        void                  SetIsRegion(bool value);

view this post on Zulip Daniel Rossberg (Jul 13 2020 at 16:09):

Sadeep Darshana said:

I don't know. I like the title bar.

You mean you like the native title bar? or the one that I implemented? When I said "How well does the window work without the title bar?" I meant does it look buggy without the native title bar?
Because it should. Some features like resize and " drag to top to maximize are not working". I have implemented dragging only out of the missing features
.

You main window seems to work well. I can resize it and move it around. (Debian buster Linux)

view this post on Zulip Sean (Jul 13 2020 at 20:13):

/me wonders why the Gift terminology was preserved... should probably just be GetMaterialID and SetMaterialID

view this post on Zulip Sadeep Darshana (Jul 14 2020 at 05:17):

@Sean What is Gift terminology? the properties under Combination?

view this post on Zulip Daniel Rossberg (Jul 14 2020 at 06:22):

Sean said:

/me wonders why the Gift terminology was preserved... should probably just be GetMaterialID and SetMaterialID

You have both a legacy integer GIFT material (rt_comb_internal.GIFTmater) and a general string material (rt_comb_internal.material).

view this post on Zulip Sean (Jul 14 2020 at 06:24):

I mean actual usage of the word GIFT .... nobody else knows what that means :)

view this post on Zulip Sean (Jul 14 2020 at 06:24):

it's just an id number

view this post on Zulip Sean (Jul 14 2020 at 06:34):

also, I believe the "material" string ... is a carryover from v4. I think it presently is only set to gift%d on v4 databases and not actually used by anything. the number is just the material ID. I think our intention should be to eliminate GIFTmaterial field and let material actually refer to a material object name (akin to shaders) when they get implemented. this has been a growing priority of late.

view this post on Zulip Daniel Rossberg (Jul 14 2020 at 06:43):

Well, I'm still working with GIFT because one of the UniVeMo modules (programmed by another company) uses it. In general, programs like these don't need a designated material field. They have higher requirements on the material specification, which can better supported by universal attributes.

view this post on Zulip Sean (Jul 14 2020 at 06:44):

conceptually, it's just an integer index to a name and a density value.

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

🧐

view this post on Zulip Sean (Jul 14 2020 at 06:46):

that certainly has a place, imho. it's the basis for massprops calculations. as a field, it's undeniably a fast index if it ever needed to be fast (which it almost certainly doesn't or couldn't be made automatic during prep)

view this post on Zulip Sean (Jul 14 2020 at 06:48):

the fact that the value originated in gift isn't relevant or useful. it's not like it's a broad standard that conveys meaning. it's an index and one must have the accompanying table of names+densities (which are now embedded in the .g too). if all we ever wanted to support was density, it wouldn't exactly be a bad way.

view this post on Zulip Sean (Jul 14 2020 at 06:52):

gqa / rtweight use the ID mapping for calculating mass, centroids, and moments of inertia. that alone gives the ID itself merit until there's an alternative.

view this post on Zulip Inder Singh (Jul 16 2020 at 06:40):

Hi @Sadeep Darshana I see that your dev log has not been updated since 9th July. Just a gentle reminder, to update the dev log preferably daily.

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

Sorry, I will update the log. I have been developing daily and committed daily to the github.

view this post on Zulip Sadeep Darshana (Jul 20 2020 at 15:08):

  1. My current plan is,
    Once I change an object which is not a combination, I will search the object tree for all paths ending with that object's name. Then remove each displaylist corresponding to each of such paths. Plot only such paths again and add each as a new displaylist.

view this post on Zulip Sadeep Darshana (Jul 20 2020 at 15:09):

  1. When Ploting a single object I will have to traverse its entire path to find color info etc?

view this post on Zulip Daniel Rossberg (Jul 21 2020 at 07:17):

Sadeep Darshana said:

  1. My current plan is,
    Once I change an object which is not a combination, I will search the object tree for all paths ending with that object's name. Then remove each displaylist corresponding to each of such paths. Plot only such paths again and add each as a new displaylist.

If this is feasible? It sounds much more complicated than I had originally in mind. But, much better too.

view this post on Zulip Daniel Rossberg (Jul 21 2020 at 07:19):

Sadeep Darshana said:

  1. When Ploting a single object I will have to traverse its entire path to find color info etc?

In principle, yes. You need to consider HasColor() and Inherit() there too.

view this post on Zulip Sadeep Darshana (Jul 21 2020 at 07:22):

Refreshing the whole database is by no means affordable. We can't do things like dragging. At least not with something like goliath.g. It takes between 1 to 2 seconds for the model to load.

view this post on Zulip Sadeep Darshana (Jul 21 2020 at 07:23):

We might be able to reduce this if using the C methods like archer does though. Archer is significantly faster at loading the database.

view this post on Zulip Sadeep Darshana (Jul 21 2020 at 09:02):

Sadeep Darshana said:

Refreshing the whole database is by no means affordable. We can't do things like dragging. At least not with something like goliath.g. It takes between 1 to 2 seconds for the model to load.

I meant load and draw vlist

view this post on Zulip Daniel Rossberg (Jul 21 2020 at 09:41):

There is so much to do with this GUI and the project just started that you are free to set your priorities.

view this post on Zulip Sadeep Darshana (Jul 21 2020 at 15:31):

image.png

view this post on Zulip Sean (Jul 21 2020 at 20:47):

That's awesome @Sadeep Darshana, looking good. How'd you ultimately go about handling colors? And what's next?

view this post on Zulip Sadeep Darshana (Jul 21 2020 at 21:03):

@Sean I implemented editing geometry. Now implementing some handlers for textboxes that can be used to change the numbers.

view this post on Zulip Sadeep Darshana (Jul 21 2020 at 21:04):

You mean wireframe colors?
I'm using the tree and getting the color inherited down from the ancestor Combination objects

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

Right, but how are you getting the color from the ancestors?

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

just curious what exact mechanism is being used given there's three color systems (direct color rgb values, inherited/overridden values, and based on the region_id)

view this post on Zulip Sadeep Darshana (Jul 21 2020 at 21:53):

void GeometryRenderer::DatabaseWalker::operator()(const BRLCAD::Object& object) {
    const BRLCAD::Combination* comb = dynamic_cast<const BRLCAD::Combination*>(&object);
    if (comb != 0) {
        if(comb->HasColor()) {
            colorInfo.red = comb->Red();
            colorInfo.green = comb->Green();
            colorInfo.blue = comb->Blue();
            colorInfo.hasColor = true;
        }
        ListTreeNode(comb->Tree());
    }
    else{
        geometryRenderer.drawSolid(path.c_str(), colorInfo);
    }
}

Not the complete code handling the color. But this is the core code. TODO Implement ignoring cases where Combination::Inherit()==false in the above code.

view this post on Zulip Sadeep Darshana (Jul 21 2020 at 22:10):

anim.gif
@Daniel Rossberg @Sean @pooh (Inderpreet Singh) project status

view this post on Zulip Sadeep Darshana (Jul 21 2020 at 22:12):

animation

view this post on Zulip Sean (Jul 22 2020 at 03:26):

that's looking good. perhaps spin widgets instead of text fields, so it's more clear you can slider up/down?

view this post on Zulip Sean (Jul 22 2020 at 03:56):

I shared your animated gif on facebook. Good stuff.

view this post on Zulip Sadeep Darshana (Jul 22 2020 at 12:55):

Sean said:

perhaps spin widgets instead of text fields, so it's more clear you can slider up/down?

I made it so that the cursor changes to vertical drag icon when hovering over textboxes changeable by dragging. Might not be clear in the gif. I have seen a similar implementation somewhere (3Ds Max?). Wouldn't spin widgets give the impression you have to click on the up/down buttons rather than dragging?

view this post on Zulip Sadeep Darshana (Jul 23 2020 at 20:19):

I implemented autoview.

view this post on Zulip Sadeep Darshana (Jul 23 2020 at 20:28):

I selected (ConstDatabase::Select) all objects that are not combination for this. Is this necessary? (for the BoundingBox methods to work)

view this post on Zulip Sean (Jul 24 2020 at 01:27):

Sadeep Darshana said:

I implemented autoview.

Did you use the code in libged or did you do something custom? How is it working?

view this post on Zulip Sean (Jul 24 2020 at 01:27):

would be nice to match what mged/archer uses.. :)

view this post on Zulip Sadeep Darshana (Jul 24 2020 at 04:44):

My camera implementation is different. I'll have change that also if I'm to match it.

view this post on Zulip Daniel Rossberg (Jul 26 2020 at 17:50):

Sadeep Darshana said:

I selected (ConstDatabase::Select) all objects that are not combination for this. Is this necessary? (for the BoundingBox methods to work)

If you want to select all (geometric) objects, you should Select() all top objects beside _GLOBAL.

view this post on Zulip Daniel Rossberg (Jul 26 2020 at 17:51):

BTW, nice interface design :smiley:

view this post on Zulip Sadeep Darshana (Jul 26 2020 at 17:55):

The code might not be of good quality in the latest several commits. I rushed to implement features using quick fixes. Need to fix those things

view this post on Zulip Sumagna Das (Jul 26 2020 at 18:02):

@Sadeep Darshana the slider option from the new gui works very similarly to the slider options in blender but the new GUI is cool with support for opening multiple files at the same time :+1:

view this post on Zulip Sadeep Darshana (Jul 26 2020 at 18:21):

I was sure I had seen that somewhere but couldnt recall where. So its blender.

view this post on Zulip Inder Singh (Jul 30 2020 at 02:11):

@Sadeep Darshana I am loving the progress. Please keep your devlog updated. A daily dev log would be more helpful than a full week's log at once.

view this post on Zulip Sadeep Darshana (Aug 07 2020 at 20:21):

@Daniel Rossberg My new rendering method only renders modified parts. Performance when modifying by dragging from my handlers went from practically impossible to use to seemless for goliath

However this would still not be efficient if a high level combination is modified since the whole subtree will be redrawn. This can only be solved by changing how combinations are rendered. In other words we need to save child objects in displaylists without their transformation available due to the position in object hierarchy. (save "wheel" instead of "cart/wheel"). And apply parent child transformations in the displaylist drawing time. I did not study how applying this currently happens in BRLCAD code. Without diving deep into this can't optimize this further.

view this post on Zulip Daniel Rossberg (Aug 08 2020 at 14:28):

This sounds impressive. But, how can I modify by dragging? The Edit Menu entry seems to have no function.

A fully featured GUI needs an own data model, and the display lists are part of it. For example, it would need to emphasize the regions, because this are in fact the geometric objects. But, nobody expects you to implement this in 3 months. BTW, do you have a plan for creating a ray-traced image? (not required, just asking)

However, because this is the last Month in 2020's GSoC, you should aim for rounding Arbalest off, for example:

view this post on Zulip Sadeep Darshana (Aug 08 2020 at 14:41):

Daniel Rossberg said:

But, how can I modify by dragging? The Edit Menu entry seems to have no function.

I meant the handles in text boxes (the icon changes when you hover on a property textbox). No handles have been implemented in the 3D GUI.

view this post on Zulip Sadeep Darshana (Aug 08 2020 at 14:45):

Keeping the eye in the Objects tree view widget visible, if it is active(?)

I can do that. My original intention was to keep it only as a button rather than an indicator.
The text colors work as an indicator.
Each item in the tree can have one of 3 colors. Blue (subtree+itself[if leaf] fully visible), light blue (some children in the subtree are visible) and black (no child [or itself] in the subtree is visible).

view this post on Zulip Sadeep Darshana (Aug 08 2020 at 14:48):

My current focus is to create properties for Combination.

These are the ones without properties pages,
BagOfTriangles
Combination
NMG
Pipe
Sketch

view this post on Zulip Sadeep Darshana (Aug 08 2020 at 14:52):

A fully featured GUI needs an own data model, and the display lists are part of it. For example, it would need to emphasize the regions, because this are in fact the geometric objects.

Regarding data models, most of my commits in the past few days were to place the ObjectTree class in the center of everything.

view this post on Zulip Sadeep Darshana (Aug 08 2020 at 15:24):

image.png

view this post on Zulip Daniel Rossberg (Aug 08 2020 at 17:20):

Sadeep Darshana said:

Daniel Rossberg said:

But, how can I modify by dragging? The Edit Menu entry seems to have no function.

I meant the handles in text boxes (the icon changes when you hover on a property textbox). No handles have been implemented in the 3D GUI.

Ah yes, this was indeed seamless :smiley:

view this post on Zulip Sadeep Darshana (Aug 09 2020 at 17:34):

Is it okay to display the transformation matrix in the UI instead of translate + rotation + scale + skew?
I've been struggling to extract components and then use these components to prepare the matrix back.

view this post on Zulip Sadeep Darshana (Aug 09 2020 at 17:35):

(combination child node's matrix)

view this post on Zulip Sadeep Darshana (Aug 09 2020 at 20:15):

btw raytracing done
image.png

view this post on Zulip Sadeep Darshana (Aug 09 2020 at 20:18):

image.png
Current camera position and orientation are used for raytracing also

view this post on Zulip Daniel Rossberg (Aug 11 2020 at 15:50):

@Sadeep Darshana, regarding the transformation matrix of the combinations: I would hide them by default. They could be shown on request, e.g. by clicking on a button. At first, it is only of interest, if a node has a transformation matrix different from the identity matrix or not. You could show the "Show Matrix" button for these entries only.

For me, it would be more interesting to see the tree structure of the combination with its Boolean operations.

BTW, you make still extensive use of auto, but I think, you shouldn't use it unless it really makes sense. If an inexperienced reader sees it, they don't know the type of the variable. In addition, it makes it hard to find the places where a distinct type is used (e.g. with grep). Reading through some articles discussing this issue, I got the impression, that people who know the code (classes, API used there) find it a reasonable way to make the code more readable, for every body else it makes the source code a riddle.

view this post on Zulip Daniel Rossberg (Aug 11 2020 at 15:50):

PS: The File menu would need a Quit or Exit entry :)

view this post on Zulip Sadeep Darshana (Aug 11 2020 at 16:09):

I'll remove the auto keyword. There are only 3 instances of the keyword I have forgotten to remove in all project files.

view this post on Zulip Sadeep Darshana (Aug 11 2020 at 16:10):

debug_utils.cpp is not project, i removed that from CMake didn't delete the file just in case

view this post on Zulip Daniel Rossberg (Aug 11 2020 at 16:13):

Okay, then it was bad luck that I saw one if theae remaining instances :}

view this post on Zulip Sadeep Darshana (Aug 11 2020 at 16:37):

@Daniel Rossberg if no matrix is displayed shouldn't we provide a way to change the transformation? Display position / rotation etc?

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 13:08):

Transformation matrix is not having [0 0 0 1] as the last row. Why is this the case?

view this post on Zulip Daniel Rossberg (Aug 12 2020 at 17:01):

Sadeep Darshana said:

Daniel Rossberg if no matrix is displayed shouldn't we provide a way to change the transformation? Display position / rotation etc?

Yes, if the combination can be edited. But, editing isn't possible in general, or am I missing something?

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:02):

I thought objects are movable :speechless:

view this post on Zulip Daniel Rossberg (Aug 12 2020 at 17:03):

In arbalest?

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:03):

In BRLCAD?

view this post on Zulip Daniel Rossberg (Aug 12 2020 at 17:04):

In mged or Archer: Yes. But, as far as I can see, the Edit menu in arbalest has no functionality(?)

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:05):

I am asking to implement the functionality

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:06):

Every BRLCAD::Object should be able to move rotate and scale, aren't they?

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:06):

Except the TopObjects

view this post on Zulip Daniel Rossberg (Aug 12 2020 at 17:07):

Top objects too ;)

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:07):

I'm not sure I understand things correctly

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:08):

Isn't the position, rotation and scale stored in the node tree of the parent combination?

view this post on Zulip Daniel Rossberg (Aug 12 2020 at 17:09):

You can move something around by giving an intermediate combination another transformation matrix - or by changing its content (points, vectors).

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:10):

oh yes. That I have implemented. (you are talking about changing Ellipsoid::Center right?)

view this post on Zulip Daniel Rossberg (Aug 12 2020 at 17:11):

For example, the mged commands push and xpush changes the transformations from the matrices in the combinations to changes in the solids' parameters.

view this post on Zulip Daniel Rossberg (Aug 12 2020 at 17:11):

Sadeep Darshana said:

oh yes. That I have implemented. (you are talking about changing Ellipsoid::Center right?)

Yes, for example.

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:12):

I noticed something weird when I was rotating things in Archer

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:12):

Instead of the object being rotated (which should chang its parent properties) it changed the properties of its children

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:13):

SO this was due to push and xpush?

view this post on Zulip Daniel Rossberg (Aug 12 2020 at 17:18):

Maybe not the push command itself, but a similar functionality. It's often desired that the combinations have identity transformations. This way, the solids are still at the same place if selected separate.

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:20):

I'll look into this. This wouldn't be easy since math would be different for each object type. Isn't it?

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:22):

Btw I implemented a dark theme and raytracing. Did not make it possible to edit any parameters relating to raytracing.

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:23):

Which parameters need to be implemented for raytracing first (are there any?)?

view this post on Zulip Daniel Rossberg (Aug 12 2020 at 17:24):

Sadeep Darshana said:

Which parameters need to be implemented for raytracing first (are there any?)?

I recommend to stay with the background color for the moment.

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:27):

ah okay
About combinations I will display the translation, scale or quaternions if the matrix is not identity. No displaying of the matrix in any case and also no editing.

view this post on Zulip Daniel Rossberg (Aug 12 2020 at 17:29):

Sadeep Darshana said:

I'll look into this. This wouldn't be easy since math would be different for each object type. Isn't it?

There should be functions for this in the primitives (~_xform?) They need however to be included in the C++ interface.

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:30):

Let me know if about or license has to be changed. I copied the license from Archer. Also sketched something in illustrator for the icon.

view this post on Zulip Daniel Rossberg (Aug 12 2020 at 17:31):

You don't need to mention the mentors in the About dialog ;) Especially not in the first place.

view this post on Zulip Daniel Rossberg (Aug 12 2020 at 17:31):

You are the creator of Arbalest.

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:33):

For now I will focus on implementing functionalities that change the object tree? Moving objects in the tree, duplicating and creating new objects

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:33):

I had implemented creating last year

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:33):

Without creating the application will not be complete

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:34):

Since can't do anythig without a pre saved .g from archer or mged

view this post on Zulip Sadeep Darshana (Aug 12 2020 at 17:34):

Thanks

view this post on Zulip Sadeep Darshana (Aug 14 2020 at 11:41):

@Sean @Daniel Rossberg @pooh (Inderpreet Singh)
arbal1.gif
arbal2.gif
arbal3.gif

view this post on Zulip Daniel Rossberg (Aug 19 2020 at 13:55):

@Sadeep Darshana, do you have the exact license text from icons8.com?

view this post on Zulip Sadeep Darshana (Aug 19 2020 at 14:07):

https://icons8.com/vue-static/landings/pricing/icons8-license.pdf

view this post on Zulip Sadeep Darshana (Aug 19 2020 at 14:08):

(deleted)

view this post on Zulip Sadeep Darshana (Aug 19 2020 at 14:09):

"DESKTOP APPS
macOS and Windows applications should have the link to https://icons8.com in the About dialog."

This is what the website says. It is different from what is in the license agreement.

view this post on Zulip Sadeep Darshana (Aug 19 2020 at 14:10):

Also they have something like this,
"OPEN SOURCE
Established open source projects could get the icons for free. For you, we'll opensource the resources that you need.

By established projects we mean the Wikipedia criteria. If you have a page on Wikipedia and it's not removed for a week, you're qualified."

This is also from the website, not the formal agreement.

view this post on Zulip Daniel Rossberg (Aug 19 2020 at 18:33):

Well yes, this matches with my impression: Under some circumstances it is possible to use these icons - but it's preferable to avoid them. If somebody else works with your code, they won't know about the conditions.

view this post on Zulip Sadeep Darshana (Aug 19 2020 at 18:35):

I'll try to find alternatives
what is the legal situation for previous commits in a repository?

view this post on Zulip Daniel Rossberg (Aug 21 2020 at 09:57):

Sadeep Darshana said:

what is the legal situation for previous commits in a repository?

They are self-made. They are part of the BRL-CAD project.

The least thing you should do is to mention all other origins than yourself and what came from there. Do all icons8.com icons have the "icons8" prefix?

view this post on Zulip Sadeep Darshana (Aug 21 2020 at 10:14):

They do. I'll change them.

view this post on Zulip Sadeep Darshana (Aug 21 2020 at 10:16):

I meant what is the legal situation for all the icons from 3rd party sources that have already been committed to the repository by me in the previous commits.

view this post on Zulip Sadeep Darshana (Aug 21 2020 at 11:17):

The google material design repository is free and open. I'll use that

view this post on Zulip Daniel Rossberg (Aug 21 2020 at 16:49):

Sadeep Darshana said:

I meant what is the legal situation for all the icons from 3rd party sources that have already been committed to the repository by me in the previous commits.

I don't know ;) Which 3rd party sources did you used?

view this post on Zulip Sean (Aug 25 2020 at 01:48):

It's always been a bit strange to me that one can't just put a matrix over any object (comb or primitive). Probably a carryover from comgeom days, but one we really should rectify in v6.

view this post on Zulip Sean (Aug 25 2020 at 02:29):

Sadeep Darshana said:

I'll try to find alternatives
what is the legal situation for previous commits in a repository?

We do have sets of icons developed under GCI for common editing operations like scale/rotate/translate

view this post on Zulip Sean (Aug 25 2020 at 02:42):

There are also tons at https://thenounproject.com/search/?q=3D

view this post on Zulip Sean (Aug 25 2020 at 02:53):

here's some examples from the gci work, more at https://brlcad.org/gci/data/uncategorized/ if you search on "icon": Overview.png

view this post on Zulip Sean (Aug 25 2020 at 02:54):

file-1-2014-12-06T00-01-0800-mockup.png file-10-2014-12-09T03-13-0800-All-1_2.png file-1-2015-01-16T06-32-0800-allicons.png

view this post on Zulip Sean (Aug 25 2020 at 02:55):

There's bunches more .

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 06:17):

all displayed icons are now from google material design repository (Apache license). I'll remove the unused from the repository.

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 06:25):

It's always been a bit strange to me that one can't just put a matrix over any object (comb or primitive). Probably a carryover from comgeom days, but one we really should rectify in v6.

I can implement changing the matrix of a node in a combination. Is it recommended this be a feature?
I was thinking this was discouraged in favor of propagating rotate/scale/translate changes to the primitives via push / xpush.
@Sean

view this post on Zulip Sean (Aug 25 2020 at 06:26):

For proper editing, you really need both the ability to have matrices in the hierarchy as well as the ability to push them down

view this post on Zulip Sean (Aug 25 2020 at 06:28):

I'll also note that pushing is a relatively complex topic to do correctly in the general case without introducing xpush options for replicating geometry and detecting when a push must be prohibited (e.g., applying a non-uniform scale to a torus primitive is impossible to represent using the parameters of a torus)

view this post on Zulip Sean (Aug 25 2020 at 06:29):

But yes, in general we want to be able to apply and edit a matrix at any node in a hierarchy.

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 06:36):

Sean said:

But yes, in general we want to be able to apply and edit a matrix at any node in a hierarchy.

I will implement this.
Is it okay to allow them to edit the 4x4 matrix directly? @Sean

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 06:37):

Does it have to be via individual components like translate / rotation / scale?

view this post on Zulip Sean (Aug 25 2020 at 06:38):

They're stored as a homogeneous matrix

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 06:46):

I know.
But to allow it to be as a matrix rather than individual components?

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 06:51):

This is not something most programs allow. They allow rotating / moving / scaling but not changing a 4x4 table which is the matrix.
I'm asking should there be textboxes for x, y, z of translate (same with rotation and shear? and scale ). It will be hard since I will have to compose and decompose the matrix given translate/rotation/scale.

view this post on Zulip Sean (Aug 25 2020 at 06:52):

The editing can be constrained to rotate/scale/translate, but it's stored as a matrix

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 06:52):

I'm asking instead of this is it okay to directly allow changing 4x4 matrix in the form of 16 text boxes through the UI

view this post on Zulip Sean (Aug 25 2020 at 06:53):

I don't think you need to allow direct editing of the matrix at this point in time... no

view this post on Zulip Sean (Aug 25 2020 at 06:54):

the problem is you're not going to reliably be able to tell what operations are encoded to display them

view this post on Zulip Sean (Aug 25 2020 at 06:54):

if you just open an existing database with matrices, for example

view this post on Zulip Sean (Aug 25 2020 at 06:57):

I mean you might be able to apply https://math.stackexchange.com/questions/237369/given-this-transformation-matrix-how-do-i-decompose-it-into-translation-rotati a large portion of the time, so maybe good enough. not sure what you'll do when it's not though.

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 06:59):

I looked at that stackexchange post and tried to implement that. The translate sometimes was different when there was a scale.

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 06:59):

in BRLCAD

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 07:00):

Sean said:

I don't think you need to allow direct editing of the matrix at this point in time... no

But Sean if it's unreliable shouldn't I be giving them direct access?

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 07:02):

I wouldn't be able to compose and decompose matrices. So the most reliable thing is to let them change the matrix directly. Wiithout taking the translate / scale/ rotation.

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 07:03):

Sean said:

the problem is you're not going to reliably be able to tell what operations are encoded to display them

This supports the opposite of

"I don't think you need to allow direct editing of the matrix at this point in time... no"

view this post on Zulip Sean (Aug 25 2020 at 07:05):

Sadeep Darshana said:

Sean said:

I don't think you need to allow direct editing of the matrix at this point in time... no

But Sean if it's unreliable shouldn't I be giving them direct access?

It's nearly impossible to directly edit a 4x4 matrix in any meaningful way except for existing simple matrices. The ones that can be edited are trivially decomposable.

view this post on Zulip Sean (Aug 25 2020 at 07:05):

if it can't be decomposed and you support edits, that's more likely to just result in an invalid matrix

view this post on Zulip Sean (Aug 25 2020 at 07:06):

that said, you can still allow scale/translate/rotate operations ... you just might not know what the current values are

view this post on Zulip Sean (Aug 25 2020 at 07:07):

your interface could override the matrix with the values they input in that case

view this post on Zulip Sean (Aug 25 2020 at 07:08):

you can allow the edits in absolute form because they can be encoded without issue even on top of some arbitrary existing matrix.

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 07:11):

you mean multiplying an existing matrix to apply an operation instead of [decomposing matrix->change components->compose matrix back] ?

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 07:11):

@Sean

view this post on Zulip Sean (Aug 25 2020 at 07:12):

basically, yes

view this post on Zulip Sean (Aug 25 2020 at 07:12):

at least in the cases where you can't decompose

view this post on Zulip Sadeep Darshana (Aug 25 2020 at 07:16):

Okay I will do that.
How do I represent rotation for relative editing? quaternion? rotation around an axis?

view this post on Zulip Sean (Aug 25 2020 at 07:16):

maybe display an icon or something to indicate that the operation is relative or simply disallow the edits if it can't be decomposed. you have choices, just saying you'll have to figure out some plan. there's not a great answer as the editing intent is lost.

view this post on Zulip Sean (Aug 25 2020 at 07:17):

you just know it's 32, you don't know if it was 2 * 10 + 12 or 3 * 10 + 2 or 4 * 8 + 0 or ..

view this post on Zulip Sean (Aug 25 2020 at 07:17):

(oversimplified of course)

view this post on Zulip Sadeep Darshana (Aug 27 2020 at 12:11):

@Sean
I implemented the feature we discussed.
anim.gif

The method we discussed is not perfect since as you can see in the animation translate is applied before other operations. So relative scaling on top of the existing matrix leads to the whole object moving also. Same with rotating.

Also removed all the 3rd party icons from the repository.

view this post on Zulip Sean (Aug 27 2020 at 19:32):

@Sadeep Darshana nice work!

view this post on Zulip Sean (Aug 27 2020 at 19:33):

it won't work for primitives as they don't have any place to hang/retain the parameters, but for members of combinations, you could display this as a property panel

view this post on Zulip Sean (Aug 27 2020 at 19:33):

something like this: 30.png

view this post on Zulip Sean (Aug 27 2020 at 19:34):

or this: Scale10.jpg

view this post on Zulip Sean (Aug 27 2020 at 19:36):

that way it also becomes clear that it's the reflective absolute state being described, not the relative edit operation, so it's consistent and can be adjusted incrementally or to absolute values without needing a checkbox or other GUI clutter

view this post on Zulip Sean (Aug 27 2020 at 20:08):

here's another example how cinema4d presents it: Screen-Shot-2020-08-27-at-3.51.22-PM.png

view this post on Zulip Sean (Aug 27 2020 at 20:08):

Video from https://www.youtube.com/watch?v=lz3cjEtaXpA

view this post on Zulip Sadeep Darshana (Aug 31 2020 at 14:47):

This wouldn't be possible @Sean since I don't have access to the absolute values as we discussed earlier. I am merely taking the existing matrix and apply a transformation to it. I do not know the absolute Position / Rotation / Scale values of the previous (before user changes) state or after.

view this post on Zulip Sadeep Darshana (Aug 31 2020 at 14:48):

@Daniel Rossberg @Sean @pooh (Inderpreet Singh)
Shouldn't https://github.com/sadeepdarshana/arbalest be moved somewhere else?

view this post on Zulip Sean (Aug 31 2020 at 19:54):

absolutely!

view this post on Zulip Sean (Aug 31 2020 at 19:55):

how to proceed? we could import it or fork it .. other options?

view this post on Zulip Sadeep Darshana (Aug 31 2020 at 20:22):

I don't know. What do you think is the best? Can I just put the entire directory into the rt^3 repository?
Because that is where my repository has to be placed when building / running?
image.png

view this post on Zulip Daniel Rossberg (Sep 01 2020 at 06:41):

One possibility would be to move it to https://github.com/BRL-CAD. It is legitimate to see it as an independent program.

I hesitate to add it to rt^3, at least at the moment, and would like to wait until the main repository is moved to github. Then, it can be included in rt^3 as a submodule.

view this post on Zulip Sadeep Darshana (Sep 01 2020 at 08:55):

Daniel Rossberg said:

One possibility would be to move it to https://github.com/BRL-CAD. It is legitimate to see it as an independent program.

Can we proceed with this?

view this post on Zulip Daniel Rossberg (Sep 01 2020 at 09:00):

Sure.

view this post on Zulip Sadeep Darshana (Sep 01 2020 at 09:03):

anything I should do for this?

view this post on Zulip Daniel Rossberg (Sep 01 2020 at 09:37):

Hmm, good question. If you go to your repository, click "Settings", and go to the bottom, you come to the "Danger Zone". There you can select "Transfer ownership", but only if you can create a repository at the target. I.e., if this doesn't end with a kind of pull request at BRL-CAD, we should probably better fork it there.

view this post on Zulip Sean (Sep 01 2020 at 12:43):

It would be nice to retain all commits, however it's done.

view this post on Zulip Sean (Sep 01 2020 at 12:46):

ah, looks like this is documented: https://help.github.jp/enterprise/2.11/user/articles/transferring-a-repository-owned-by-your-personal-account/

view this post on Zulip Sadeep Darshana (Sep 01 2020 at 13:09):

https://github.com/sadeepdarshana/arbalest link will still be accessible isn't it (or redirected)? Because that is the one I submitted for GSoC evaluation.

view this post on Zulip Sadeep Darshana (Sep 01 2020 at 13:10):

"Users must have repository creation permissions within the receiving organization before they can transfer a repository that they individually own"

view this post on Zulip Sean (Sep 01 2020 at 13:13):

Will see if we can fix that since need to fix that. Need to fix it for others as well.

view this post on Zulip Daniel Rossberg (Sep 04 2020 at 16:34):

@Sadeep Darshana Who is kaymers? An alter ego?

view this post on Zulip Sadeep Darshana (Sep 04 2020 at 16:38):

I changed my computer's git email & user to the account we have for our final year project. I changed it back in github desktop. Only later I discovered it was still using the final year project account when I commit from the terminal

view this post on Zulip Sadeep Darshana (Sep 04 2020 at 17:25):

How do we proceed with placing the project to https://github.com/BRL-CAD?
I can't do it since I don't have the create repository permission in https://github.com/BRL-CAD
@Sean @Daniel Rossberg

view this post on Zulip Daniel Rossberg (Sep 04 2020 at 17:27):

I think that the best would be to fork it on ttps://github.com/BRL-CAD.

view this post on Zulip Sean (Sep 05 2020 at 04:43):

@Sadeep Darshana I got distracted/interrupted the other day working on GitHub permissions. I think the best preserving option will be for you to initiate a transfer (you will have create repository permission once I fix it) so it becomes authoritative for all and includes your entire commit history. I'm looking at the permissions now.

view this post on Zulip Sadeep Darshana (Sep 05 2020 at 04:45):

great

view this post on Zulip Sean (Sep 05 2020 at 04:46):

Sadeep Darshana said:

https://github.com/sadeepdarshana/arbalest link will still be accessible isn't it (or redirected)? Because that is the one I submitted for GSoC evaluation.

That should still be possible. At most, you might have to fork it back to yourself so upstream/downstream work right.

view this post on Zulip Sean (Sep 05 2020 at 04:47):

Also, the link you submitted is mostly for our benefit, but I can certainly sort things out with OSPO if needed.

view this post on Zulip Sean (Sep 05 2020 at 07:54):

@Sadeep Darshana I have to get some rest, but would you give it a try now? The default permissions should allow you to initiate the transfer once you accept the member invitation.

view this post on Zulip Sean (Sep 05 2020 at 08:29):

the steps are at https://help.github.jp/enterprise/2.11/user/articles/transferring-a-repository-owned-by-your-personal-account/

view this post on Zulip Sadeep Darshana (Sep 05 2020 at 16:57):

@Sean I transferred the repo. https://github.com/BRL-CAD/arbalest
The old link is working fine. It redirects to the new location.

The readme is outdated. I will update it tomorrow if possible.

view this post on Zulip Daniel Rossberg (Sep 09 2020 at 06:29):

@Sadeep Darshana, please have a look at https://github.com/BRL-CAD/arbalest/pull/8

view this post on Zulip Sadeep Darshana (Sep 09 2020 at 06:49):

merged it @Daniel Rossberg

view this post on Zulip Daniel Rossberg (Sep 09 2020 at 06:52):

And tested it? I was wondering why this section was in the config.

view this post on Zulip Sadeep Darshana (Sep 12 2020 at 08:19):

Tested. It works fine. I might have added it when I was experimenting with windows window system to remove title bar and still retain other functionalities associated with it.

view this post on Zulip Daniel Rossberg (Sep 15 2020 at 10:50):

@Sadeep Darshana, I created a new pull request: https://github.com/BRL-CAD/arbalest/pull/9

I could merge it by myself, but I want you to have a look at it too. For example, I removed the glm library and replaced it with Qt methods. However, was there a reason why you didn't use Qt?

view this post on Zulip Sadeep Darshana (Sep 16 2020 at 12:58):

I checkedout https://github.com/drossberg/arbalest. This is working fine on Windows, Visual Studio.
I didn't know Qt already had these features until the very end of the project. I used what was seeing everywhere on the internet for GL math.
I actually thought of changing them to use Qt functions once I got to know. This is great.

view this post on Zulip Sadeep Darshana (Sep 16 2020 at 13:04):

What do you think of my use of circular dependency? I only realized later that this was very inconvenient in C++ unlike in Java/C#. Everytime I do some change or addition in the includes of most files a lot of errors come up due to header including / forward declaration related errors etc.

view this post on Zulip Daniel Rossberg (Sep 16 2020 at 14:02):

To be honest, I haven't noticed the circular dependencies yet.

However, there are some more flaws in the code too. E.g., transformationMatrix in MatrixTransformationWidget.cpp is allocated on the heap but never freed. I.e., a code review is necessary anyway. But, this isn't surprising after a step in a new direction.

view this post on Zulip Sadeep Darshana (Sep 16 2020 at 14:20):

I've been using C++ in algorithm contests. But this is the first software I created.

view this post on Zulip starseeker (Sep 16 2020 at 14:51):

@Sadeep Darshana I know it's not your primary focus, but any chance you could back-port those changes to the qged code as well?

view this post on Zulip Daniel Rossberg (Sep 16 2020 at 15:04):

arbalest is a very nice peace of software. I like the modern look and feel. Especially, GUI apllication source code tends to become messy if developed fast from the scratch. But, you managed to implement a new GUI concept for BRL-CAD.

view this post on Zulip Sean (Sep 16 2020 at 17:20):

@Sadeep Darshana that was your first software creation!? That's amazing. You should be very proud; I'm impressed!

view this post on Zulip Sean (Sep 16 2020 at 17:23):

Instead of backporting, it may make more sense at this point to forward-merge qged into arbalest. I'm not intimately familiar with the differences but do like the fresh physically separated architecture. They both use the same hierarchy widget now, yes? Main aspect missing I believe is the ability to invoke ged commands?

view this post on Zulip Sean (Sep 16 2020 at 17:26):

@Sadeep Darshana do you have or can you make a short 5-30 sec screencap video showcasing the GUI how it ended up by the end of GSoC? I posted one you gave me from a couple months ago, but it'd be nice to showcase the finale too. Something with an interesting hierarchical model like m35 or something downloaded..

view this post on Zulip Sadeep Darshana (Sep 16 2020 at 17:27):

I will create one @Sean

view this post on Zulip Sadeep Darshana (Sep 16 2020 at 17:29):

Sean said:

Instead of backporting, it may make more sense at this point to forward-merge qged into arbalest. I'm not intimately familiar with the differences but do like the fresh physically separated architecture. They both use the same hierarchy widget now, yes? Main aspect missing I believe is the ability to invoke ged commands?

The best way would be to implement ged commands into coreinterface and make arbalest use it, isn't it?

view this post on Zulip Sadeep Darshana (Sep 16 2020 at 17:29):

Sean said:

Sadeep Darshana that was your first software creation!? That's amazing. You should be very proud; I'm impressed!

First C++

view this post on Zulip starseeker (Sep 16 2020 at 17:52):

The thing is, qged can integrate directly into the main BRL-CAD repo the way mged/archer do. Arbalest, as I understand it, doesn't and deliberately isn't intended to (since coreInterface also isn't intended to integrate into the main repo.)

view this post on Zulip starseeker (Sep 16 2020 at 17:54):

Visually speaking, it looks like qged and arbalest have different hierarchy widgets. (qged's has an issue with newer Qt in my testing, but it's the one that sets the icons based on type and (at least when things are working properly) can do selection based highlighting of rows.)

view this post on Zulip starseeker (Sep 16 2020 at 18:01):

Also not sure if things like the html based console widget, accordion widget, or docking setup have migrated?

view this post on Zulip starseeker (Sep 16 2020 at 18:04):

Not really sure if they can be readily migrated to arbalest - would take some exploring - but I'd hate to lose some of those features...

view this post on Zulip starseeker (Sep 16 2020 at 18:04):

On the plus side, ged_exec and friends should make exposing the GED commands much simpler...

view this post on Zulip Sean (Sep 16 2020 at 20:45):

Sadeep Darshana said:

The best way would be to implement ged commands into coreinterface and make arbalest use it, isn't it?

That's a great question. Probably as part of MOOSE (i.e. part of the larger API that includes coreInterface's OO hierarchy). It could be attached as a method on a Database object, but the GUI needs more access and control in order to automatically update views and such, so probably not there. It really begs for a stand-alone command executor interface that is hooked up to a database and has connections for getting update notifications.

view this post on Zulip Sean (Sep 16 2020 at 20:57):

starseeker said:

On the plus side, ged_exec and friends should make exposing the GED commands much simpler...

Exposing them or even just directly calling them from inside a qt console is super easy already. The question would just be whether there's any benefit to wrapping it in an OO API or whether the app should just directly manage the ged state. Somewhere someone has to keep one informed of changes from the other (e.g., delete an object in the GUI, does ged see the deletion and vice versa).

view this post on Zulip starseeker (Sep 16 2020 at 20:58):

I would prefer in some ways to have callback hooks at the .g read/write layer in libg...

view this post on Zulip Sean (Sep 16 2020 at 21:00):

o.O

view this post on Zulip starseeker (Sep 16 2020 at 21:01):

That's when the .g file actually changes, after all...

view this post on Zulip starseeker (Sep 16 2020 at 21:02):

Right now I think we're trying to keep track of which GED commands potentially do what, which just feels wrong...

view this post on Zulip Sean (Sep 16 2020 at 21:02):

that would be weird. I get it. but it would be unusual. callbacks typically implement app logic.

view this post on Zulip starseeker (Sep 16 2020 at 21:02):

Well, generate DB_WRITE events of some sort then, if we have an events or signals system apps can hook into.

view this post on Zulip Sean (Sep 16 2020 at 21:04):

I had envisioned that happening at the libged layer. After all, once it's fully abstracted, just about all that remains is an exec call, so the rest of it's role would be providing app connections

view this post on Zulip Sean (Sep 16 2020 at 21:04):

callbacks or a public/subscribe system, definitely transactions

view this post on Zulip starseeker (Sep 16 2020 at 21:06):

/me has a little trouble envisioning what that would look like, at least from a migration standpoint - would all librt level calls in libged commands be replaced with transaction event generation calls?

view this post on Zulip Sean (Sep 16 2020 at 21:06):

was leaning towards an event based publish/subscribe system where invoking a command then generates a list of events and those events default to specific behaviors (i.e., what they currently do)

view this post on Zulip Sean (Sep 16 2020 at 21:08):

starseeker said:

/me has a little trouble envisioning what that would look like, at least from a migration standpoint - would all librt level calls in libged commands be replaced with transaction event generation calls?

yes, exactly. so for a command like "killall foo" could return a transaction set filled with whatever relevant "DELETE [obj]" events.

view this post on Zulip starseeker (Sep 16 2020 at 21:09):

So the first step is to design the transaction set and API?

view this post on Zulip Sean (Sep 16 2020 at 21:09):

there would be a predefined set of possible events that we'd have to specify (i.e., all possible low-operations)

view this post on Zulip starseeker (Sep 16 2020 at 21:09):

Would libg publish that set, or does that live at the libged level?

view this post on Zulip Sean (Sep 16 2020 at 21:10):

I saw that living at the libged level as it introduces the concept of a command and command transactions

view this post on Zulip Sean (Sep 16 2020 at 21:11):

it would have default handlers for things like KILL, MAKE, DRAW, ERASE, LIST, ... that would make the corresponding librt/libg call

view this post on Zulip starseeker (Sep 16 2020 at 21:12):

OK, I think that makes sense.

view this post on Zulip starseeker (Sep 16 2020 at 21:13):

As long as we don't have any situations where a command can't deduce it's transaction list without applying the previously generated transaction(s)...

view this post on Zulip Sean (Sep 16 2020 at 21:13):

I see these default handlers actually getting far more interesting and advanced than our currently ad hoc logic. for example, a command that causes a new object to get created might generate a MAKE event, and the handler for MAKE would automatically 1) do the db_lookup to make sure it doesn't already exist 2) come up with a consistent name or error if it does exist based on some policy, 3) automatically be loggable or debuggable, 4) be automatically and consistently undo-able

view this post on Zulip Sean (Sep 16 2020 at 21:15):

starseeker said:

As long as we don't have any situations where a command can't deduce it's transaction list without applying the previously generated transaction(s)...

that's a very important consideration, yes! (nice)

view this post on Zulip starseeker (Sep 16 2020 at 21:16):

search -exec is what leaps to mind, but there may be others...

view this post on Zulip starseeker (Sep 16 2020 at 21:17):

What to do about "commands" that are Tcl procs calling multiple GED commands is another one - do we build up all the transaction sets and then apply them at the end, or does each GED command finalize before moving on to the next one?

view this post on Zulip Sean (Sep 16 2020 at 21:17):

I think it'd be on us in how transactions are ultimately validated and processed, but I think it's very tractable as there'd still be the call that's there now (e.g., wdb_export() becomes something like ged_make() or whatever) and inside that routine it would carry the current processing state.

view this post on Zulip Sean (Sep 16 2020 at 21:18):

mind you, that processing state is a virtual environment

view this post on Zulip Sean (Sep 16 2020 at 21:18):

but from the command's perspective, it will have occurred

view this post on Zulip starseeker (Sep 16 2020 at 21:21):

But, for example, a loop that does a wdb_export and then later in the loop does a db_lookup on the object it just exported - if wdb_export is a transaction not applied, the db_lookup equivalent would have to check both the .g state and play the transaction set up to that point to answer the question of what the db_lookup is actually supposed to be. Am I missing something?

view this post on Zulip Sean (Sep 16 2020 at 21:21):

so something like search -exec would be nested transactions in a parent transaction. and if you have a command like "mv a b" that does a RENAME a b event followed by a validation check to make sure b exists and a doesn't, those would likewise be updated.

view this post on Zulip Sean (Sep 16 2020 at 21:24):

starseeker said:

But, for example, a loop that does a wdb_export and then later in the loop does a db_lookup on the object it just exported - if wdb_export is a transaction not applied, the db_lookup equivalent would have to check both the .g state and play the transaction set up to that point to answer the question of what the db_lookup is actually supposed to be. Am I missing something?

we have choices here. even to make it play transactions, which is an option, we'd still have to inject ourselves somewhere in that command (e.g., replace all db_lookup with an identical ged_lookup)

view this post on Zulip starseeker (Sep 16 2020 at 21:25):

Playing transactions though would get performance prohibitive as the building transaction set gets large. Don't we need another answer?

view this post on Zulip Sean (Sep 16 2020 at 21:25):

and doing that, we could also not apply transactions inside the ged_lookup but instead just keep track of changes thus far to know what objects exist and dont' exist

view this post on Zulip Sean (Sep 16 2020 at 21:25):

that would be even faster than what we currently do

view this post on Zulip Sean (Sep 16 2020 at 21:26):

as all I/O would get deferred

view this post on Zulip Sean (Sep 16 2020 at 21:26):

similarly, laying out our choices, we could do it fully passively

view this post on Zulip Sean (Sep 16 2020 at 21:26):

like what svn and git do

view this post on Zulip Sean (Sep 16 2020 at 21:27):

ged would have an inmem of the real deal, let the command actually do whatever it does to it, and then diff to determine the change events

view this post on Zulip Sean (Sep 16 2020 at 21:28):

speaking of which, gdiff already has a strong notion of what this event system should look like

view this post on Zulip Sean (Sep 16 2020 at 21:28):

as the things it can diff are akin to the events possible (at least for i/o events, there are also camera, view, and display events)

view this post on Zulip starseeker (Sep 16 2020 at 21:30):

Is the transaction API what we'd then send over the capnproto channels when we go fully IPC for ged_exec execution?

view this post on Zulip starseeker (Sep 16 2020 at 21:31):

Must confess that appeals as all ged commands become read-only on the .g file

view this post on Zulip Sean (Sep 16 2020 at 21:31):

that would be my hope

view this post on Zulip starseeker (Sep 16 2020 at 21:31):

Would solve a whole host of issues.

view this post on Zulip Sean (Sep 16 2020 at 21:31):

would be good to survey and see if we actually have any commands that potentially rely on previous state besides search

view this post on Zulip starseeker (Sep 16 2020 at 21:32):

OK, that establishes the order of implementation then - transaction API first, then IPC.

view this post on Zulip Daniel Rossberg (Sep 24 2020 at 16:40):

Intrinsic database viewer: Proof of concept
Steps:

However, it's only a proof of a concept, and not meant to be product ready.

view this post on Zulip Sean (Sep 24 2020 at 17:02):

Hah!

view this post on Zulip Sean (Sep 24 2020 at 17:04):

this is great, and the original idea for a standalone cad viewer that the student worked on. is this using anything from that, or from scratch?

view this post on Zulip Sadeep Darshana (Sep 24 2020 at 17:27):

@Sean I will prepare that gif you asked. Sorry, there were some exams and I couldn't work on that.

view this post on Zulip Daniel Rossberg (Sep 24 2020 at 17:41):

Sean said:

this is great, and the original idea for a standalone cad viewer that the student worked on. is this using anything from that, or from scratch?

I don't know about any outcome of this student project. My POC uses the rt_dirbuild_inmem() function I implemented this summer (from scratch) via the C++ core interface and Sadeep's arbalest.

view this post on Zulip Himanshu (Mar 10 2022 at 15:28):

How should I get started with https://github.com/opencax/GSoC/issues/27 ? I am able to build and run arblest.

view this post on Zulip Himanshu (Mar 10 2022 at 15:30):

I saw Implement the C++ core classes for the remaining primitives but how should I get started? @Sean @Daniel Rossberg

view this post on Zulip Sean (Mar 10 2022 at 16:18):

I'd probably look at one of the existing primitives that has a name that can be easily searched (e.g., torus), find all references to it, then find a primitive that is missing (look at all the subfolders in src/librt/primitives in the brlcad repo for a listing), and work to implement it

view this post on Zulip Sean (Mar 10 2022 at 16:23):

You could also simply find a bug and fix it, you could also get qged up and running so you can compare against that, you could work on trying to make components in qged reusable in arbalest (e.g., the hierarchy view), you could also work on something unrelated to qged like setting up an interactive raytrace window, ... lots of possibilities ;)

view this post on Zulip Himanshu (Mar 10 2022 at 18:30):

btw rt^3 can be build and run in windows too?

view this post on Zulip Daniel Rossberg (Mar 10 2022 at 18:30):

I thought, you already did it(?)

view this post on Zulip Himanshu (Mar 10 2022 at 18:31):

I don't know how to export brlcad bin dir so that rt^3 can find and build in windows.

view this post on Zulip Himanshu (Mar 10 2022 at 18:31):

Daniel Rossberg said:

I thought, you already did it(?)

Done in WSL.

view this post on Zulip Daniel Rossberg (Mar 10 2022 at 18:32):

You need to install BRL-CAD (CMake INSTALL target). This is what rt^3 needs.

view this post on Zulip Himanshu (Mar 10 2022 at 18:33):

I have build BRL-CAD for windows.

view this post on Zulip Daniel Rossberg (Mar 10 2022 at 18:34):

In addition, you should use the CMake GUI. It tells you which paths are missing, so you can set them there. Also, have a look at the CMake output. It may give you a hint what's missing.

view this post on Zulip Himanshu (Mar 10 2022 at 18:34):

let me see now

view this post on Zulip Daniel Rossberg (Mar 10 2022 at 18:34):

Himanshu Sekhar Nayak said:

I have build BRL-CAD for windows.

But, have you installed it too?

view this post on Zulip Himanshu (Mar 10 2022 at 18:35):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

I have build BRL-CAD for windows.

But, have you installed it too?

install through NIS installer or something like that I guess?

view this post on Zulip Daniel Rossberg (Mar 10 2022 at 18:35):

BTW, for development it's wise to install it at a directory where you don't need administration privileges.

view this post on Zulip Himanshu (Mar 10 2022 at 18:35):

I don't recall the name of the installer.

view this post on Zulip Daniel Rossberg (Mar 10 2022 at 18:36):

Himanshu Sekhar Nayak said:

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

I have build BRL-CAD for windows.

But, have you installed it too?

install through NIS installer or something like that I guess?

Install it by building the INSTALL project in Visual Studio.

view this post on Zulip Himanshu (Mar 10 2022 at 18:37):

On my way to INSTALL now :sweat_smile:

view this post on Zulip Himanshu (Mar 10 2022 at 18:38):

Daniel Rossberg said:

BTW, for development it's wise to install it at a directory where you don't need administration privileges.

Yes, it shows me the error now that it needs admin privileges.

view this post on Zulip Daniel Rossberg (Mar 10 2022 at 18:40):

So, set CMAKE_INSTALL_PREFIX to a directory where you can write to: Open the CMake GUI - look for CMAKE_INSTALL_PREFIX - change its value (it's a string) - configure - generate - open Visual Studio ...

view this post on Zulip Daniel Rossberg (Mar 10 2022 at 18:55):

You can help rt^3 CMake to find your BRL-CAD installation by setting the BRLCAD_BASE_DIR variable to its installation directory: Open the CMake GUI (for rt^3) - [+ Add Entry] with name BRLCAD_BASE_DIR and type "PATH" - set its value - configure - generate - ...

view this post on Zulip Himanshu (Mar 11 2022 at 19:22):

@Daniel Rossberg I added both BRLCADD_BASE_DIR and CMAKE_INSTALL_PREFIX for /bin and Qt 5.14.2 but I am getting errors.

view this post on Zulip Himanshu (Mar 11 2022 at 19:27):

I am getting bunch of errors related to "BRLCAD_HEADERS_DIR-NOTFOUND"

view this post on Zulip Daniel Rossberg (Mar 11 2022 at 19:37):

Did you check the CMake configuration? Sounds like the variable BRLCAD_HEADERS_DIR isn't set.

view this post on Zulip Himanshu (Mar 11 2022 at 20:08):

Daniel Rossberg said:

Did you check the CMake configuration? Sounds like the variable BRLCAD_HEADERS_DIR isn't set.

Where it should be set?

view this post on Zulip Daniel Rossberg (Mar 11 2022 at 20:12):

CMake GUI (for example)

view this post on Zulip Himanshu (Mar 11 2022 at 20:13):

I mean what path it should be set to.

view this post on Zulip Daniel Rossberg (Mar 11 2022 at 20:15):

include directory of your BRL-CAD installation

view this post on Zulip Himanshu (Mar 11 2022 at 20:15):

One thing I noticed that while installing it shows Build: 328 succeeded, 0 failed, 686 up-to-date, 0 skipped but may be it should show around 1k succeeded ?

view this post on Zulip Daniel Rossberg (Mar 11 2022 at 20:18):

The number of build targets is the sum of the four numbers.

view this post on Zulip Himanshu (Mar 11 2022 at 20:19):

:hushed: I didn't know that.

view this post on Zulip Himanshu (Mar 11 2022 at 20:20):

I am getting this even if I added right paths. Screenshot-5.png

view this post on Zulip Daniel Rossberg (Mar 11 2022 at 20:22):

It means that

view this post on Zulip Himanshu (Mar 11 2022 at 20:23):

Daniel Rossberg said:

It means that

:hushed: Now I understand the meaning of these lines.

view this post on Zulip Daniel Rossberg (Mar 11 2022 at 20:24):

What's the path of the installed mged program?

view this post on Zulip Himanshu (Mar 11 2022 at 20:25):

Daniel Rossberg said:

What's the path of the installed mged program?

c/Users/Himanshu/Desktop/WindowsBRLCAD/install/bin

view this post on Zulip Daniel Rossberg (Mar 11 2022 at 20:27):

I.e., the installation directory is c/Users/Himanshu/Desktop/WindowsBRLCAD/install. This should be the value of BRLCADD_BASE_DIR.

view this post on Zulip Himanshu (Mar 11 2022 at 20:29):

btw my WindowsBRLCAd/ have brlcad/ build/ buildRT3/ install/ rt-cubed/

view this post on Zulip Himanshu (Mar 11 2022 at 20:32):

all the time I am thinking that bin/ should be go to dir like I had done for linux

view this post on Zulip Himanshu (Mar 11 2022 at 20:32):

Screenshot-6.png

view this post on Zulip Himanshu (Mar 11 2022 at 20:34):

Should I ignore this?
Found BRL-CAD at C:/Users/Himanshu/Desktop/WindowsBRLCAD/install Configuration for 'ge'... Omitted. Configuration for 'coreInterface'... Omitted.

view this post on Zulip Himanshu (Mar 11 2022 at 20:43):

Getting errors while building RT3 in vs.

view this post on Zulip Himanshu (Mar 11 2022 at 20:43):

2>LINK : fatal error LNK1104: cannot open file 'coreinterface.lib' 2>Done building project "tester_ci_primitives.vcxproj" -- FAILED.

view this post on Zulip Daniel Rossberg (Mar 11 2022 at 20:44):

In the output in the CMake GUI there should be a message regarding BRLCAD_VERSION.

view this post on Zulip Himanshu (Mar 11 2022 at 20:44):

Daniel Rossberg said:

In the output in the CMake GUI there should be a message regarding BRLCAD_VERSION.

Got a warning.
CMake Warning at cmake/FindBRLCAD.cmake:178 (MESSAGE): Could not locate 'brlcad-config' - please set BRLCAD_VERSION in CMake Call Stack (most recent call first): CMakeLists.txt:132 (find_package)

view this post on Zulip Himanshu (Mar 11 2022 at 21:05):

Getting bunch of errors related to cannot open file while building in vs.

view this post on Zulip Daniel Rossberg (Mar 12 2022 at 16:40):

Did coreInterface succeeded?

view this post on Zulip Himanshu (Mar 12 2022 at 16:48):

nope because it shows ommitted.

view this post on Zulip Daniel Rossberg (Mar 12 2022 at 16:54):

Did you set BRLCAD_VERSION?

view this post on Zulip Himanshu (Mar 12 2022 at 18:38):

Daniel Rossberg said:

Did you set BRLCAD_VERSION?

What should I set to?

view this post on Zulip Himanshu (Mar 12 2022 at 19:03):

Himanshu Sekhar Nayak said:

Daniel Rossberg said:

Did you set BRLCAD_VERSION?

What should I set to?

Okay it should be set to install/

view this post on Zulip Himanshu (Mar 12 2022 at 19:38):

but still linking errors

view this post on Zulip Sean (Mar 12 2022 at 19:41):

@Himanshu Sekhar Nayak it should get set to the version of BRL-CAD, not a path
like "7.32.5"

view this post on Zulip Himanshu (Mar 12 2022 at 19:53):

Sean said:

Himanshu Sekhar Nayak it should get set to the version of BRL-CAD, not a path
like "7.32.5"

should be set to where brlcad is installed right to find the version?

view this post on Zulip Sean (Mar 12 2022 at 20:14):

@Himanshu Sekhar Nayak I just pushed some changes I needed on Mac, do a git pull

view this post on Zulip Sean (Mar 12 2022 at 20:15):

you'll set BRLCAD_ROOT (or BRLCAD_BASE_DIR) and BRLCAD_VERSION ... the first is a path, the second is a version

view this post on Zulip Sean (Mar 12 2022 at 20:15):

see README and make sure you're doing similar steps or see if you missed something

view this post on Zulip Himanshu (Mar 12 2022 at 20:24):

hmm I had set the version to 7.32.5 but still ...

view this post on Zulip Himanshu (Mar 12 2022 at 20:24):

5>VectorList.obj : error LNK2019: unresolved external symbol bv_vlist_copy referenced in function "public: __cdecl BRLCAD::VectorList::VectorList(class BRLCAD::VectorList const &)" (??0VectorList@BRLCAD@@QEAA@AEBV01@@Z) 5>C:\Users\Himanshu\Desktop\WindowsBRLCAD\buildRT3\bin\coreinterface.dll : fatal error LNK1120: 1 unresolved externals 5>Done building project "coreinterface.vcxproj" -- FAILED.

view this post on Zulip Himanshu (Mar 12 2022 at 20:30):

Build: 14 succeeded, 3 failed, 0 up-to-date, 0 skipped

view this post on Zulip Himanshu (Mar 12 2022 at 21:23):

Hmm I found another too
3>Sketch.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Sphere.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Torus.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Object.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>ParabolicCylinder.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Paraboloid.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Particle.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>HyperbolicCylinder.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Hyperboloid.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>MemoryDatabase.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>NonManifoldGeometry.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>EllipticalTorus.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>FileDatabase.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>globals.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Halfspace.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Cone.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>ConstDatabase.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Database.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Ellipsoid.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>MinimalDatabase.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Arb8.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>BagOfTriangles.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Combination.obj : error LNK2001: unresolved external symbol bu_setjmp_valid 3>Pipe.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Sketch.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Sphere.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Torus.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Object.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>ParabolicCylinder.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Paraboloid.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Particle.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>HyperbolicCylinder.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Hyperboloid.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>MemoryDatabase.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>NonManifoldGeometry.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>EllipticalTorus.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>FileDatabase.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>globals.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Halfspace.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Cone.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>ConstDatabase.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Database.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Ellipsoid.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>MinimalDatabase.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Arb8.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>BagOfTriangles.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>Combination.obj : error LNK2001: unresolved external symbol bu_jmpbuf 3>ConstDatabase.obj : error LNK2001: unresolved external symbol rt_uniresource 3>ConstDatabase.obj : error LNK2001: unresolved external symbol RTG 3>NonManifoldGeometry.obj : error LNK2001: unresolved external symbol RTG 3>C:\Users\Himanshu\Desktop\WindowsBRLCAD\buildRT3\bin\ge.dll : fatal error LNK1120: 4 unresolved externals 3>Done building project "ge.vcxproj" -- FAILED.

view this post on Zulip Himanshu (Mar 12 2022 at 21:26):

Himanshu Sekhar Nayak said:

5>VectorList.obj : error LNK2019: unresolved external symbol bv_vlist_copy referenced in function "public: __cdecl BRLCAD::VectorList::VectorList(class BRLCAD::VectorList const &)" (??0VectorList@BRLCAD@@QEAA@AEBV01@@Z) 5>C:\Users\Himanshu\Desktop\WindowsBRLCAD\buildRT3\bin\coreinterface.dll : fatal error LNK1120: 1 unresolved externals 5>Done building project "coreinterface.vcxproj" -- FAILED.

This one got solved after I git pull and build and now 15 succeeded.

view this post on Zulip Sean (Mar 12 2022 at 21:50):

@Himanshu Sekhar Nayak so are you built now or do you ahve the bu_jmpbuf unresolved symbols issue? that's basically saying you're missing libbu from the link list or missing BU_DLL_IMPORTS during compile

view this post on Zulip Himanshu (Mar 13 2022 at 06:26):

Sean said:

Himanshu Sekhar Nayak so are you built now or do you ahve the bu_jmpbuf unresolved symbols issue? that's basically saying you're missing libbu from the link list or missing BU_DLL_IMPORTS during compile

I still have bu_jmpbuf unresolved symbols issue.

view this post on Zulip Himanshu (Mar 13 2022 at 06:27):

BRLCAD_BU_LIBRARY is able to find C:/Users/Himanshu/Desktop/WindowsBRLCAD/install/lib/libbu.lib

view this post on Zulip Sean (Mar 13 2022 at 07:20):

@Himanshu Sekhar Nayak I know it's a hassle, but can you try deleting your build directory, recreate it, re-run cmake, and compile again? when repeatedly rebuilding through errors, sometimes object files will get compiled with wrong settings and it can help to make sure you start fresh. The fact that bv_vlist_copy went away and bu_setjmp_valid and bu_jmpbuf remained indicates the possibility.

view this post on Zulip Sean (Mar 13 2022 at 07:21):

it'll also then be easier to inspect your log to make sure it's getting compiled... if you turn up the verbosity, we can check that BU_DLL_IMPORTS is being defined

view this post on Zulip Daniel Rossberg (Mar 13 2022 at 13:45):

Cleaning up the CMake cache (or removing everything what's in the build directory) and re-running CMake with BRLCAD_BASE_DIR set would be my first idea too.

view this post on Zulip Himanshu (Mar 13 2022 at 13:52):

Daniel Rossberg said:

Cleaning up the CMake cache (or removing everything what's in the build directory) and re-running CMake with BRLCAD_BASE_DIR set would be my first idea too.

Some of them are getting not found. Is that okay? Screenshot-7_LI.jpg

view this post on Zulip Daniel Rossberg (Mar 13 2022 at 13:57):

This can be okay. The rt^3 configuration may contain some outdated stuff. What does the CMake output window say? Are there warnings or some red text?

view this post on Zulip Himanshu (Mar 13 2022 at 13:58):

Daniel Rossberg said:

This can be okay. The rt^3 configuration may contain some outdated stuff. What does the CMake output window say? Are there warnings or some red text?

Nope, no warnings.

view this post on Zulip Daniel Rossberg (Mar 13 2022 at 13:59):

Some thing omitted?

view this post on Zulip Himanshu (Mar 13 2022 at 14:00):

Daniel Rossberg said:

Some thing omitted?

Nah, after I set BRLCAD_VERSION to 7.32.5 then those omitted are not shown.

view this post on Zulip Daniel Rossberg (Mar 13 2022 at 14:03):

Then you can generate the Visual Studio files and give the build another try.

view this post on Zulip Himanshu (Mar 13 2022 at 14:03):

Himanshu Sekhar Nayak said:

Daniel Rossberg said:

Some thing omitted?

Nah, after I set BRLCAD_VERSION to 7.32.5 then those omitted are not shown.

Sorry, those omitted are gone after I set right path to install previously set to install/bin/

view this post on Zulip Daniel Rossberg (Mar 13 2022 at 14:05):

This is how it should be. I had never to struggle with BRLCAD_VERSION before.

view this post on Zulip Himanshu (Mar 13 2022 at 14:12):

I turned verbosity to normal from minimal and here is the log https://pastecode.io/s/c8ekapr4

view this post on Zulip Daniel Rossberg (Mar 13 2022 at 14:17):

"ge" and "geTest" failed. This is possible because they are unsupported. But, there should be a coreInterface.dll somewhere among the build results(?)

view this post on Zulip Himanshu (Mar 13 2022 at 14:20):

Daniel Rossberg said:

"ge" and "geTest" failed. This is possible because they are unsupported. But, there should be a coreInterface.dll somewhere among the build results(?)

https://pastecode.io/s/9szgod1f New one.

view this post on Zulip Daniel Rossberg (Mar 13 2022 at 14:24):

And, do you know what this output says? Did you got a coreinterface.dll somewhere?

view this post on Zulip Daniel Rossberg (Mar 13 2022 at 14:27):

Hint: Search for coreinterface in your log.

view this post on Zulip Himanshu (Mar 13 2022 at 14:29):

Daniel Rossberg said:

Hint: Search for coreinterface in your log.

5> coreinterface.vcxproj -> C:\Users\Himanshu\Desktop\Windows\buildRT3\bin\coreinterface.dll

view this post on Zulip Himanshu (Mar 13 2022 at 14:31):

line no 200

view this post on Zulip Daniel Rossberg (Mar 13 2022 at 14:31):

And, is there a C:\Users\Himanshu\Desktop\Windows\buildRT3\bin\coreinterface.dll in your file system?

view this post on Zulip Daniel Rossberg (Mar 13 2022 at 14:32):

BTW, there is in addition

5>Build succeeded.
5>    0 Warning(s)
5>    0 Error(s)

in your log.

view this post on Zulip Himanshu (Mar 13 2022 at 14:32):

Daniel Rossberg said:

And, is there a C:\Users\Himanshu\Desktop\Windows\buildRT3\bin\coreinterface.dll in your file system?

Yep, it is there.
Himanshu@Legion-5P MINGW64 ~/Desktop/Windows/buildRT3/bin $ ls coreinterface.dll coreinterface.dll*

view this post on Zulip Sean (Mar 13 2022 at 17:18):

Might want to double check your version if you’re using latest brlcad main. It was bumped to 7.35.7 recently.

view this post on Zulip Himanshu (Mar 13 2022 at 17:48):

I cloned BRLCAD latest from github

view this post on Zulip Sean (Mar 13 2022 at 19:04):

Yes but it matters when and if you’ve done a git pull and recompiled, etc. What did the summary say when you compiled brl-cad? Can also run rt and look at the usage statement for a version number.

view this post on Zulip Himanshu (Mar 14 2022 at 07:07):

Sean said:

Yes but it matters when and if you’ve done a git pull and recompiled, etc. What did the summary say when you compiled brl-cad? Can also run rt and look at the usage statement for a version number.

BRL-CAD Release 7.32.7 The BRL-CAD Raytracer RT Mon, 14 Mar 2022 06:04:48 UTC, Compilation 1 Himanshu@Legion-5P

view this post on Zulip Sean (Mar 14 2022 at 22:02):

Okay yeah so make sure your rt-cubed cmake has version set to that

view this post on Zulip Sean (Mar 14 2022 at 22:02):

/me wonders what it needs the version number for…

view this post on Zulip Daniel Rossberg (Mar 15 2022 at 17:53):

Sean said:

/me wonders what it needs the version number for…

Same reason why there is a brlcad_version.h. But this file wasn't always part of the public API. That's why rt^3 generates its own one.

However, if the BRL-CAD installation was found, it will be generated automatically. But if the installation wasn't found, CMake and the compiler will complain about every piece which isn't configured, including the version number.

view this post on Zulip Himanshu (Mar 22 2022 at 20:11):

@Daniel Rossberg I am able to produce fully ray traced image by clicking on Reset the viewports and focus on the visible button having Z-axis to 0. Screenshot-12.png

view this post on Zulip Himanshu (Mar 22 2022 at 20:12):

But without focusing, ray traced is not fully complete.

view this post on Zulip Himanshu (Mar 22 2022 at 20:13):

Screenshot-13.png

view this post on Zulip Himanshu (Mar 22 2022 at 20:15):

Also tried on havoc too without reset and focus. And it gives results same as half ray traced castele.

view this post on Zulip Himanshu (Mar 22 2022 at 20:16):

Screenshot-14.png

view this post on Zulip Himanshu (Mar 22 2022 at 20:17):

After reset and focus, it gives fully ray traced image. Screenshot-15.png

view this post on Zulip Himanshu (Mar 22 2022 at 20:29):

I have done some testing on this QVector3D imagePoint(column, h - row - 1., 0.); changing Zpos to column and row + column but column didn't work out well while row + columnworks well without having to reset and focus.

view this post on Zulip Himanshu (Mar 22 2022 at 20:31):

Having only column gives Screenshot-16_LI.jpg

view this post on Zulip Himanshu (Mar 22 2022 at 20:34):

But row + column gives Screenshot-17_LI.jpg

view this post on Zulip Himanshu (Mar 22 2022 at 20:36):

I don't know about the behavior of taking only column and row + column because it comes to my mind arbitrarily.

view this post on Zulip Daniel Rossberg (Mar 24 2022 at 18:48):

What does the Reset the viewports and focus on the visible button? Can you call this function before the ray-trace?

view this post on Zulip Himanshu (Mar 24 2022 at 18:48):

Daniel Rossberg said:

What does the Reset the viewports and focus on the visible button? Can you call this function before the ray-trace?

Yes, it can be called before ray-trace.

view this post on Zulip Himanshu (Mar 24 2022 at 18:50):

It just resize the very zoomed wireframe into a smaller one I guess. Like this.... Screenshot-18.png

view this post on Zulip Daniel Rossberg (Mar 24 2022 at 18:58):

Okay, that's not optimal. Have you had a look at the reset routine and understood how it works?

view this post on Zulip Himanshu (Mar 24 2022 at 19:00):

Daniel Rossberg said:

Okay, that's not optimal. Have you had a look at the reset routine and understood how it works?

Nope. Where should I look at? Is it in RaytraceView.cpp?

view this post on Zulip Daniel Rossberg (Mar 24 2022 at 19:09):

Look for the code of the button and which function it refers (probable a QAction).

view this post on Zulip Himanshu (Mar 24 2022 at 19:15):

Daniel Rossberg said:

Look for the code of the button and which function it refers (probable a QAction).

In MainWindow.cpp resetViewports->setToolTip("Reset the viewports and focus on the visible"); in line no 652

view this post on Zulip Daniel Rossberg (Mar 24 2022 at 19:20):

Which slot is connected to resetViewports?

view this post on Zulip Daniel Rossberg (Mar 24 2022 at 19:21):

What's the type of resetViewports?

view this post on Zulip Himanshu (Mar 24 2022 at 19:25):

(deleted)

view this post on Zulip Himanshu (Mar 24 2022 at 19:25):

(deleted)

view this post on Zulip Himanshu (Mar 24 2022 at 19:27):

Daniel Rossberg said:

What's the type of resetViewports?

QPushButton* resetViewports = new QPushButton(menuTitleBar);

view this post on Zulip Himanshu (Mar 24 2022 at 19:28):

it's QPushButton *

view this post on Zulip Daniel Rossberg (Mar 24 2022 at 19:35):

In this case, you should learn about QPushButton :wink: E.g., how function are connected to the button actions.

view this post on Zulip Himanshu (Mar 26 2022 at 17:19):

Daniel Rossberg said:

In this case, you should learn about QPushButton :wink: E.g., how function are connected to the button actions.

I am taking a break due to my upcoming semester exams that is going to start from 29th March to 9th April. I hope I will not miss the deadline for sending an proposal after discussion with you and @Sean for this project.

view this post on Zulip Sean (Mar 29 2022 at 15:25):

Yes, definitely don't miss the deadline. Google has a strict no-exceptions policy for anyone that misses a deadline, no matter the reason.

view this post on Zulip Himanshu (Apr 01 2022 at 17:57):

Btw I found a bug that after closing .g file the Properties and Objects does not clear own buffers. Screenshot-23.png

view this post on Zulip Himanshu (Apr 01 2022 at 18:31):

because documentArea->currentIndex() still counts Quick Start as opened tab so it doesn't clears the Objects and Properties.

view this post on Zulip Himanshu (Apr 01 2022 at 19:06):

Desktop-2022.04.02-00.35.03.01.mp4

view this post on Zulip Himanshu (Apr 01 2022 at 19:51):

Another one I found that in dark theme, close is not visible. Screenshot-24_LI.jpg

view this post on Zulip Himanshu (Apr 01 2022 at 19:53):

There is tons of things to do :smiley:.

view this post on Zulip Himanshu (Apr 01 2022 at 19:54):

/me just waiting for my semester exam to complete :oh_no:

view this post on Zulip Daniel Rossberg (Apr 03 2022 at 14:13):

Good to see that you make progress with exploring the current development state and identifying things you want to change, extend or add.
One big difference between GCi and GSoC is that you have to make your own project plan for GSoC.

view this post on Zulip Himanshu (Apr 06 2022 at 16:00):

Daniel Rossberg said:

Good to see that you make progress with exploring the current development state and identifying things you want to change, extend or add.
One big difference between GCi and GSoC is that you have to make your own project plan for GSoC.

Only one subject is left and my exams will be over. Today, I started writing up the proposal and only added the personal information by following https://opencax.github.io/gsoc_guidelines.html.

view this post on Zulip Himanshu (Apr 06 2022 at 16:01):

Once it is over, I will write the complete proposal.

view this post on Zulip Himanshu (Apr 08 2022 at 19:29):

My exams got over. I am thinking to open issue in arbalest that I had spotted. Should I open the issue ?

view this post on Zulip Sean (Apr 09 2022 at 15:11):

I mean that completely depends... why or why not?

view this post on Zulip Sean (Apr 09 2022 at 15:12):

we know it's in development and has issues and room for improvement, so creating the issue if you're not going to work on it is not valuable. If you're going to create an issue to discuss and work on it, then sure.

view this post on Zulip Himanshu (Apr 09 2022 at 18:51):

Yeah I will work upon on those issues so I thought that I should go on and upon the issue. And also I thought that to add those issues to my proposal for addressing.

view this post on Zulip Sean (Apr 09 2022 at 20:08):

Sure that’s fine with me that way. I just don’t want to create busy work if the plan changes before it’s finalized, but if it helps you be more productive and it creates an intentional space for discussion, absolutely sounds fine

view this post on Zulip Himanshu (Apr 10 2022 at 14:27):

One major thing I found that I think is not implemented yet is if I create a new file and draw a primitive and close the file by clicking X without saving then the untitled tab is removed. And also if I close the main GUI app having unsaved changes then the app got closed without asking to save the file or not.

view this post on Zulip Himanshu (Apr 10 2022 at 14:47):

Another one I found that Help section is not showing anything.

view this post on Zulip Himanshu (Apr 10 2022 at 15:22):

It should show manual I think.

view this post on Zulip Himanshu (Apr 11 2022 at 19:55):

Btw where I can find the primitives headers in brlcad dir? Not talking about coreinterface.

view this post on Zulip Himanshu (Apr 12 2022 at 10:41):

Is it include/rt/primitive? Because I found arb8.h there.

view this post on Zulip Himanshu (Apr 12 2022 at 10:45):

I am just trying to match if every primitive matched with coreinterface to brlcad/ so that I don't miss any primitives that is not yet implemented

view this post on Zulip Daniel Rossberg (Apr 12 2022 at 18:54):

The closest to a primitive header in the core BRL-CAD is include/rt/geom.h. If you are looking for the list of primitives, src/librt/primitives may contain what you are looking for. include/rt/defines.h contains the list of solid IDs.

view this post on Zulip Sean (Apr 13 2022 at 05:56):

Yeah, src/librt/primitives/table.cop has all possible entities. Just beware that some are deprecated or obsoleted. You can probably ignore hf, cline, bspline, hrt, super, just to name a few that come to mind

view this post on Zulip Himanshu (Apr 13 2022 at 20:03):

@Daniel Rossberg @Sean Which feature(s) I should try to implement? Like in mged there are too much options that are not found in arbalest yet. I have listed some of the feature that are not yet in arbalest which are the following:-

  1. Alert box is missing that shows title after opening a .g file. There should be way to give title to a file? If this feature implemented then either it can be displayed in a bar which is currently showing the file path or when I hover mouse on the name of the tab . Or any suggestion?
    title.jpg

  2. The most important one I found that missing of status bar which includes angle of view, size of view, center and also changing the units. I think instead of showing file path in arbalest we can show the status bar.
    statusBar.jpg

  3. Currently Arbalest Help section is only showing Quick start . We can add a manual page which will be helpful but there is a part where it shows synopsis which shows a command but Arbalest didn't have a command line yet.
    HelpSection.jpg
    Manual.png

  4. In mged, the create section have primitives like Arbs which contains arb8, arb7... but there is no such like in arbalest. It only includes arb8 instead of Arbs section. Same applies to cone and ellipsoids. May be we should try to import those into arbalest?

  5. Also I found some shift key grips and effects are not in arbalest. We can add those too.
    shiftKeyGrips.png

There are many more features that can be implemented and many more I can explore what have been missing by comparing mged with arbalest. From above list of features, which will be important one? I am deciding to work on these and also the bugs that I have found during this GSoC. Since this is a long project, so I will write both improvements, fixes and features to arbalest.

view this post on Zulip Himanshu (Apr 14 2022 at 05:15):

Btw I saw this project is 350hrs so it will come to end on November 21 or September 5-12? I am little confused here.

view this post on Zulip Daniel Rossberg (Apr 14 2022 at 16:03):

Himanshu Sekhar Nayak said:

Btw I saw this project is 350hrs so it will come to end on November 21 or September 5-12? I am little confused here.

This depends on how many hours you want to spend per week.

Doe you prefer a 175h size?

view this post on Zulip Himanshu (Apr 14 2022 at 16:05):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

Btw I saw this project is 350hrs so it will come to end on November 21 or September 5-12? I am little confused here.

This depends on how many hours you want to spend per week.

Doe you prefer a 175h size?

I think I should go with 175hrs.

view this post on Zulip Himanshu (Apr 14 2022 at 16:06):

I am planning to propose bugs fix, add features and extend object-oriented C++ Geometry API.

view this post on Zulip Himanshu (Apr 14 2022 at 16:10):

I can commit 4hrs/day.

view this post on Zulip Himanshu (Apr 14 2022 at 16:11):

I thought 175hrs timeline will end on September while 350hrs will end on November.
So according to those timelines, I have to write development schedule too.

view this post on Zulip Daniel Rossberg (Apr 14 2022 at 16:46):

  1. I don't miss this alert box. In mged it signals that something happened. This shouldn't be necessary in arbalest because the GUI elements change according the opened database. An often used way to display a datasets title is to use Database Title [/path/to/the/file.g]. If this text is too long, you could write the title in the tab and have the file path as tool tip for it. In addition, you could have in the File menu (or somewhere else?) a Properties entry where one can set the database title.
  2. This would create space in the status bar for something else.
  3. Qt comes with an own frame work for help pages. And, arbalest aims for a GUI centered user interface.
  4. An arb7, etc. is in fact a (special) arb8 and arbalest was implemented very straight there. It would however be very useful to be able to create the other arb# there too, ideally with mouse support to place and resize them.
  5. The shortcuts should adapt to what's usual for CAD or modeler applications. But, there seem indeed only few shortcuts implemented in arbalest. I.e., we would probably need more there.

These are only small issues. Implementing only these wouldn't be enough for a GSoC project. You should look for at least one new CAD feature, like creating and modifying a pipe with the mouse. It can be something else, but you should aim for implementing a new concept for working with BRL-CAD models.

Because you plan to go with 175h, how about a small feature as placing and sizing new solids with the mouse?

view this post on Zulip Daniel Rossberg (Apr 14 2022 at 16:53):

Added the medium size to the project idea.

view this post on Zulip Himanshu (Apr 14 2022 at 16:58):

Daniel Rossberg said:

  1. I don't miss this alert box. In mged it signals that something happened. This shouldn't be necessary in arbalest because the GUI elements change according the opened database. An often used way to display a datasets title is to use Database Title [/path/to/the/file.g]. If this text is too long, you could write the title in the tab and have the file path as tool tip for it. In addition, you could have in the File menu (or somewhere else?) a Properties entry where one can set the database title.
  2. This would create space in the status bar for something else.
  3. Qt comes with an own frame work for help pages. And, arbalest aims for a GUI centered user interface.
  4. An arb7, etc. is in fact a (special) arb8 and arbalest was implemented very straight there. It would however be very useful to be able to create the other arb# there too, ideally with mouse support to place and resize them.
  5. The shortcuts should adapt to what's usual for CAD or modeler applications. But, there seem indeed only few shortcuts implemented in arbalest. I.e., we would probably need more there.
  6. Yes, creating other arb# with mouse support to place and resize them would be a meaningful feature.
    These are only small issues. Implementing only these wouldn't be enough for a GSoC project. You should look for at least one new CAD feature, like creating and modifying a pipe with the mouse. It can be something else, but you should aim for implementing a new concept for working with BRL-CAD models.

Because you plan to go with 175h, how about a small feature as placing and sizing new solids with the mouse?

  1. Yes, creating other arb# with mouse support to place and resize them would be a meaningful feature.

view this post on Zulip Himanshu (Apr 14 2022 at 17:01):

btw 175h can also be completed within November right?

view this post on Zulip Himanshu (Apr 14 2022 at 17:20):

I thought those will be new features that are missing from arbalest.

view this post on Zulip Himanshu (Apr 14 2022 at 17:23):

In mged, placing a new solid using mouse and resizing is there or not? I have to search for it to see how it works originally.

view this post on Zulip Daniel Rossberg (Apr 14 2022 at 17:27):

Himanshu Sekhar Nayak said:

I thought those will be new features that are missing from arbalest.

Yes, they are new for arbalest, but rather small and straight forward, not demonstrating a new concept for a GUI.

view this post on Zulip Daniel Rossberg (Apr 14 2022 at 17:31):

Himanshu Sekhar Nayak said:

In mged, placing a new solid using mouse and resizing is there or not? I have to search for it to see how it works originally.

You can look at the mged tutorial for reference. But, I don't recommend to copy it. And, don't think of mged as the original. It's rather the reference (together with archer). Arbalest want's to introduce a new way of interacting with the geometry.

view this post on Zulip Himanshu (Apr 14 2022 at 17:42):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

I thought those will be new features that are missing from arbalest.

Yes, they are new for arbalest, but rather small and straight forward, not demonstrating a new concept for a GUI.

Now I remembered that using in we are able to create shape by giving size to the parameters.

view this post on Zulip Himanshu (Apr 14 2022 at 17:44):

Is it like that? Instead of CUI, use mouse support to place and resize.

view this post on Zulip Himanshu (Apr 14 2022 at 19:45):

I will look into it in the morning. I have written down bugs that I am going to fix and also extending support for coreinterface in my proposal. Only thing that is missing is adding at least an feature. I will check it out in morning for this new feature. By far I know we can create shapes by giving size using in which insert command.

view this post on Zulip Himanshu (Apr 15 2022 at 16:21):

@Daniel Rossberg I have done an example. Is it like this? Desktop-2022.04.15-21.48.06.03.mp4

view this post on Zulip Daniel Rossberg (Apr 15 2022 at 16:38):

This is how it works in mged. But you should not be tempted to copy from mged. Be creative!

E.g., how are other programs doing this? Some of them put handles on the objects which can be hold by the mouse and allow special actions (moving, resizing, rotating it), for example.

Mouse supported placing and sizing of new solids is one possibility for a new feature. Selecting objects with the mouse could be another. E.g., selecting an element in a ray-traced view and make it transparent, to see what's inside. Or, clicking on the model starts a ray-trace and returns a list of hits.

Be creative!!!

view this post on Zulip Himanshu (Apr 15 2022 at 17:04):

Daniel Rossberg said:

This is how it works in mged. But you should not be tempted to copy from mged. Be creative!

E.g., how are other programs doing this? Some of them put handles on the objects which can be hold by the mouse and allow special actions (moving, resizing, rotating it), for example.

Mouse supported placing and sizing of new solids is one possibility for a new feature. Selecting objects with the mouse could be another. E.g., selecting an element in a ray-traced view and make it transparent, to see what's inside. Or, clicking on the model starts a ray-trace and returns a list of hits.

Be creative!!!

I am thinking of one way. Like first selecting an object through mouse by selecting an specific area.

view this post on Zulip Himanshu (Apr 15 2022 at 17:04):

Then do operation like move and resizing.

view this post on Zulip Himanshu (Apr 15 2022 at 17:05):

I will post an example now.

view this post on Zulip Himanshu (Apr 15 2022 at 17:41):

Daniel Rossberg said:

This is how it works in mged. But you should not be tempted to copy from mged. Be creative!

E.g., how are other programs doing this? Some of them put handles on the objects which can be hold by the mouse and allow special actions (moving, resizing, rotating it), for example.

Mouse supported placing and sizing of new solids is one possibility for a new feature. Selecting objects with the mouse could be another. E.g., selecting an element in a ray-traced view and make it transparent, to see what's inside. Or, clicking on the model starts a ray-trace and returns a list of hits.

Be creative!!!

Here is an example that I have done in AutoCAD. Desktop-2022.04.15-23.01.41.04.mp4

view this post on Zulip Himanshu (Apr 15 2022 at 17:42):

This is a feature where we can select an object and can resize them.

view this post on Zulip Himanshu (Apr 16 2022 at 21:09):

I have a doubt. In rt-cubed/include/brlcad, all primitives headers are there. Let's take Arb8.h as consider. How Arb8.h here is different from arb8.h found in brlcad/include/rt/primitives? Are they same?

view this post on Zulip Himanshu (Apr 16 2022 at 21:10):

@Daniel Rossberg How Arb8.h is extracting object nature from arb8.h?

view this post on Zulip Daniel Rossberg (Apr 17 2022 at 17:47):

Did you looked into these files?

view this post on Zulip Himanshu (Apr 17 2022 at 17:49):

Yes

view this post on Zulip Himanshu (Apr 17 2022 at 17:52):

Today I added Pipe and BagOfTriangles to MainWindow.cpp to test it.

view this post on Zulip Himanshu (Apr 17 2022 at 17:53):

:sweat_smile: I am able to give the object name too but not able to draw on screen.

view this post on Zulip Himanshu (Apr 17 2022 at 17:54):

I will look later why they don't work.

view this post on Zulip Himanshu (Apr 17 2022 at 17:55):

Currently I am writing milestones and timeline for the project. Hopefully I will send the draft for feedback tomorrow.

view this post on Zulip Daniel Rossberg (Apr 17 2022 at 17:55):

I mean, opened them in and editor and read it.

view this post on Zulip Himanshu (Apr 17 2022 at 17:56):

I am thinking to leave the project as Long so I will get time to research and implement the feature.

view this post on Zulip Himanshu (Apr 17 2022 at 17:58):

Daniel Rossberg said:

I mean, opened them in and editor and read it.

Yeah, I had opened and read the code too. I tried to look into functions of both arb8.h and Arb8.h.

view this post on Zulip Daniel Rossberg (Apr 17 2022 at 18:00):

The function names mainly describe what they are doing. From these descriptions, what do you think are the headers purpose?

view this post on Zulip Himanshu (Apr 17 2022 at 18:01):

Looked into functions like rt_arb_centroid(), rt_arb_calc_points(), etc of arb8.h and tried to match with function found in Arb8.h like NumberOfVertices(), Point(), SetPoint().

view this post on Zulip Daniel Rossberg (Apr 17 2022 at 18:05):

And, do they match?

view this post on Zulip Himanshu (Apr 17 2022 at 18:07):

Daniel Rossberg said:

And, do they match?

I am not able to match it through function names. So may be I have not yet looked into .cpp files.

view this post on Zulip Himanshu (Apr 17 2022 at 18:08):

I thought names are not similar too. So might be anything other.

view this post on Zulip Daniel Rossberg (Apr 17 2022 at 18:13):

Looking at the function names should you give the answer: The headers of the core interface declare the interfaces for accessing the primitives, as expected. The headers in rt/primitives are utility functions which declare/export some useful higher level functions used ate different places in main BRL-CAD.

view this post on Zulip Himanshu (Apr 17 2022 at 18:24):

Daniel Rossberg said:

Looking at the function names should you give the answer: The headers of the core interface declare the interfaces for accessing the primitives, as expected. The headers in rt/primitives are utility functions which declare/export some useful higher level functions used ate different places in main BRL-CAD.

Hmm now I understand. So coreinterface still uses main BRL-CAD for some functions.

view this post on Zulip Himanshu (Apr 17 2022 at 18:24):

I thought it to be single one rather than extracting from main BRL-CAD.

view this post on Zulip Himanshu (Apr 17 2022 at 18:25):

my bad

view this post on Zulip Himanshu (Apr 17 2022 at 18:28):

I thought every functionality of arb8.h have to be here in Arb8.h so that it will not use even a single functionality from main BRL-CAD.

view this post on Zulip Daniel Rossberg (Apr 17 2022 at 18:36):

The "C++ core interface" is a thin layer on the BRL-CAD core.

view this post on Zulip Himanshu (Apr 18 2022 at 16:36):

Since my proposal contains gif to show some examples that can't be viewed in pdf format. So here is the docs file format draft of my proposal. I am currently uploading in gsoc website.

view this post on Zulip Himanshu (Apr 18 2022 at 16:43):

@Daniel Rossberg What topics I should include for this project?

view this post on Zulip Himanshu (Apr 18 2022 at 16:43):

saw in gsoc

view this post on Zulip Daniel Rossberg (Apr 18 2022 at 16:44):

BTW, the creation of arb5, arb6, tgc, etc. are implemented in the core interface. See the constructors.

view this post on Zulip Daniel Rossberg (Apr 18 2022 at 16:45):

Himanshu Sekhar Nayak said:

Daniel Rossberg What topics I should include for this project?

What do you mean by "topics"?

view this post on Zulip Himanshu (Apr 18 2022 at 16:46):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

Daniel Rossberg What topics I should include for this project?

What do you mean by "topics"?

Like is this project belongs Vision or Robotics or Cloud or Graphics or Web or Machine Learning, etc.

view this post on Zulip Daniel Rossberg (Apr 18 2022 at 16:51):

Choose the topics you think match best. Graphics sounds reasonable, maybe GUI too.

view this post on Zulip Daniel Rossberg (Apr 18 2022 at 17:08):

Himanshu Sekhar Nayak said:

Since my proposal contains gif to show some examples that can't be viewed in pdf format. So here is the docs file format draft of my proposal. I am currently uploading in gsoc website.

You should explicitly mention the program size (mdium/175h or large/350h) you apply too in your proposal.

view this post on Zulip Himanshu (Apr 18 2022 at 20:19):

I found that a constructor in ellipsoid.h for sph is already there and also a sphere.h is created for sph.

view this post on Zulip Himanshu (Apr 18 2022 at 20:19):

Are they same?

view this post on Zulip Himanshu (Apr 18 2022 at 20:21):

btw both have different functions in use.

view this post on Zulip Himanshu (Apr 18 2022 at 20:54):

Updated the document and sent proposal from gsoc website.

view this post on Zulip Daniel Rossberg (Apr 19 2022 at 13:46):

Himanshu Sekhar Nayak said:

Are they same?

It's a bit confusing that both Ellipsoid and Sphere handle rt_ell_internal. But, ConstDatabase::Get (in ConstDatabase.cpp) and Database::Add (in Database.cpp) tell you that Ellipsoid is a C++ handle for the database objects with ID ID_ELL (3) and Sphere is a handle for objects with ID_SPH (10).

view this post on Zulip Himanshu (Apr 21 2022 at 14:19):

Btw for creating a rectangle shape selection area using mouse support, I have found https://doc.qt.io/qt-5/qrubberband.html#:~:text=A%20QRubberBand%20can%20represent%20a,QRubberBand%20can%20represent%20a%20rectangle.

view this post on Zulip Himanshu (Apr 21 2022 at 14:19):

Currently I learnt about QDialog, signals and slots and their functions too.

view this post on Zulip Himanshu (Apr 21 2022 at 15:40):

https://doc.qt.io/qt-5/qrubberband.html

view this post on Zulip Himanshu (Apr 21 2022 at 15:44):

I found another one and it looks picking an primitive https://doc.qt.io/qt-5/qtquick3d-picking-example.html

view this post on Zulip Daniel Rossberg (Apr 21 2022 at 16:14):

Himanshu Sekhar Nayak said:

I found another one and it looks picking an primitive https://doc.qt.io/qt-5/qtquick3d-picking-example.html

This can give you some ideas, but the example is based on a different geometric engine and a different kind of programming (QML).

view this post on Zulip Himanshu (Apr 21 2022 at 16:26):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

I found another one and it looks picking an primitive https://doc.qt.io/qt-5/qtquick3d-picking-example.html

This can give you some ideas, but the example is based on a different geometric engine and a different kind of programming (QML).

Hmm QML : JavaScript

view this post on Zulip Himanshu (Apr 21 2022 at 16:29):

I will look into it.

view this post on Zulip Himanshu (Apr 22 2022 at 18:14):

I found a bug :beetle: Opening a new tab and closing it and having Quick Start tab opened, I am still able to create arb8 and also it shows properties and objects.

view this post on Zulip Himanshu (Apr 22 2022 at 19:06):

@Daniel Rossberg Can I send a pull request? I have fixed a bug that I have mentioned above. I am asking because I don't know if the actual coding should start after the project gets selected or before. But anyways I want to fix the bug :innocent: :grinning_face_with_smiling_eyes:.

view this post on Zulip Himanshu (Apr 22 2022 at 19:21):

Btw I have a doubt

view this post on Zulip Himanshu (Apr 22 2022 at 19:22):

In MainWindow.h line no 53
// The ID of the active document. int activeDocumentId = -1;

view this post on Zulip Himanshu (Apr 22 2022 at 19:23):

Here activeDocumentId is counting number of tabs opened?

view this post on Zulip Himanshu (Apr 22 2022 at 19:30):

hmm for each tab, it's giving an id number?

view this post on Zulip Himanshu (Apr 22 2022 at 19:33):

What I found that even after new tab is closed and if Quick Start is not closed then still activeDocumentId is 0. So Create is able to function.

view this post on Zulip Himanshu (Apr 22 2022 at 19:38):

I will look into this in morning. Late night here.

view this post on Zulip Himanshu (Apr 23 2022 at 12:37):

Himanshu Sekhar Nayak said:

What I found that even after new tab is closed and if Quick Start is not closed then still activeDocumentId is 0. So Create is able to function.

Same applies to Save and Save As too.

view this post on Zulip Himanshu (Apr 23 2022 at 15:01):

I have also found that after the tab is removed, the [key, value] is not removed from the documents which is type of unordered_map.

view this post on Zulip Sean (Apr 23 2022 at 17:26):

@Himanshu Singh you don’t need permission to work on code or to submit pull requests

view this post on Zulip Sean (Apr 23 2022 at 17:27):

Open source is about working together as a community

view this post on Zulip Himanshu (Apr 23 2022 at 18:39):

Sean said:

Himanshu Singh you don’t need permission to work on code or to submit pull requests

There are two Himanshu here :open_mouth:

view this post on Zulip Sean (Apr 23 2022 at 19:14):

Oops! My apologies @Himanshu Sekhar Nayak and @Himanshu Singh

view this post on Zulip Sean (Apr 23 2022 at 19:14):

He’s not subscribed here fortunately so he won’t see the mistake

view this post on Zulip Himanshu (Apr 23 2022 at 19:15):

I will send a pull request to fix this bug.

view this post on Zulip Himanshu (Apr 23 2022 at 21:43):

Done testing. I will push the code in the morning. Late night here. :night:

view this post on Zulip Himanshu (Apr 24 2022 at 08:44):

I have send the pull request with new issue. Also I will work on another patch to fix status bar.

view this post on Zulip Himanshu (Apr 28 2022 at 21:00):

I pushed a new commit @Daniel Rossberg.

view this post on Zulip Himanshu (Apr 29 2022 at 15:28):

@Daniel Rossberg I don't know if these functions like Relative scale, move, rotate are actually working or not? I didn't find any during testing. Is these are the functions that we are talking about to implement like move and scale?

view this post on Zulip Himanshu (Apr 29 2022 at 15:29):

I found one

QMenu* editMenu = menuTitleBar->addMenu(tr("&Edit"));

    QAction* relativeMoveAct = new QAction("Relative move selected object", this);
    relativeMoveAct->setStatusTip(tr("Relative move selected object. Top objects cannot be moved."));
    connect(relativeMoveAct, &QAction::triggered, this, [this](){
        if (activeDocumentId == -1) return;
        if (documents[activeDocumentId]->getObjectTreeWidget()->currentItem() == nullptr) return;
        int objectId = documents[activeDocumentId]->getObjectTreeWidget()->currentItem()->data(0, Qt::UserRole).toInt();
        MatrixTransformWidget * matrixTransformWidget = new MatrixTransformWidget(documents[activeDocumentId],objectId, MatrixTransformWidget::Translate);
    });
    editMenu->addAction(relativeMoveAct);

view this post on Zulip Himanshu (Apr 29 2022 at 15:32):

btw @Sean Have you looked into my proposal :sweat_smile: ? I am just curios if you have seen it or not. I had shown to Daniel. btw pdf doesn't show the gifs but here is the doc file that shows gifs proposal

view this post on Zulip Daniel Rossberg (Apr 29 2022 at 17:52):

Himanshu Sekhar Nayak said:

Daniel Rossberg I don't know if these functions like Relative scale, move, rotate are actually working or not? I didn't find any during testing. Is these are the functions that we are talking about to implement like move and scale?

You need a combination to use these functions. The transformation matrix is put into the object tree. But, I didn't found a way to confirm the input values :thinking:

view this post on Zulip Sean (May 01 2022 at 12:40):

Himanshu Sekhar Nayak said:

btw Sean Have you looked into my proposal :sweat_smile: ? I am just curios if you have seen it or not. I had shown to Daniel. btw pdf doesn't show the gifs but here is the doc file that shows gifs proposal

Yes, I definitely had seen and read it! I think it looks good and like the focus on GUI interaction.

view this post on Zulip Himanshu (May 03 2022 at 12:08):

Opened a new issue https://github.com/BRL-CAD/arbalest/issues/15

view this post on Zulip Himanshu (May 03 2022 at 12:09):

(deleted)

view this post on Zulip Himanshu (May 03 2022 at 12:09):

(deleted)

view this post on Zulip Daniel Rossberg (May 05 2022 at 17:22):

I would expect the patch to be small ;)

view this post on Zulip Himanshu (May 05 2022 at 17:23):

Daniel Rossberg said:

I would expect the patch to be small :wink:

:sweat_smile: I will make the changes that you have asked for in my next commit. Also I saw inconsistency in code style too in the project. Should I follow any code style for this project?

view this post on Zulip Daniel Rossberg (May 05 2022 at 17:25):

Not yet. If there would be stylistic changes necessary, it's better to have an own patch for them.

view this post on Zulip Himanshu (May 06 2022 at 18:46):

/me learning Models of Qt

view this post on Zulip Himanshu (May 09 2022 at 20:10):

Finished Models and learnt QStringListModel, QFileSystemModel, QStandardItemModel with List, Table and Tree View and also know how the models are sync and extract data from a model. :grinning:

view this post on Zulip Himanshu (May 10 2022 at 20:59):

The rt-cubed version uses the BRL-CAD libraries from the main installation during runtime while MOOSE doesn't. Sounds interesting. How I forgot about this :sad: ?

view this post on Zulip Sean (May 11 2022 at 20:09):

@Himanshu Sekhar Nayak that's one of the more compelling aspects of the arbalest architecture, honestly. It's built strictly on top so there's no cheating or lazy coding even possible. It requires calling through API, properly layered and isolated. It's cool.

view this post on Zulip Daniel Rossberg (May 12 2022 at 17:12):

MOOSE is a generalization of the Windows brlcad.dll. The goal is to get a shard library containing the complete BRL-CAD core, which can be distributed easily with all supported systems. In addition, it shall not be a "hack" but cleanly build based on a normal BRL-CAD installation.

view this post on Zulip Himanshu (May 12 2022 at 17:19):

May be next time, this project will appear in gsoc? Anyways, I am interested for it. I will look into it in future.

view this post on Zulip Sean (May 12 2022 at 17:22):

@Himanshu Sekhar Nayak "this project" meaning what? working on MOOSE?

view this post on Zulip Daniel Rossberg (May 12 2022 at 17:22):

It would be interesting to port arbalest to MOOSE. This would avoid hacking rt-cubed, for example. This port would consist mainly in some renaming (e.g. header paths).

view this post on Zulip Himanshu (May 12 2022 at 17:23):

Sean said:

Himanshu Sekhar Nayak "this project" meaning what? working on MOOSE?

Yep, working on MOOSE.

view this post on Zulip Himanshu (May 12 2022 at 17:27):

Daniel Rossberg said:

It would be interesting to port arbalest to MOOSE. This would avoid hacking rt-cubed, for example. This port would consist mainly in some renaming (e.g. header paths).

So MOOSE will be independent and once it get's installed and compiled and it will never look back to libraries during runtime what rt-cubed does.

view this post on Zulip Daniel Rossberg (May 12 2022 at 17:28):

MOOSE is liked with the static BRL-CAD libraries.

view this post on Zulip Himanshu (May 12 2022 at 17:29):

That's cool I think and it will be faster in terms of performance right?

view this post on Zulip Sean (May 12 2022 at 17:31):

That's an interesting nuanced perspective (static).. I hadn't really conceptualized it in terms of static vs dynamic. I think of it as clean C++ API on top of the C libs (i.e., rt^3) but compiled in a separate space so it can't reach into non-public API.

view this post on Zulip Daniel Rossberg (May 12 2022 at 17:32):

Himanshu Sekhar Nayak said:

That's cool I think and it will be faster in terms of performance right?

Potentially yes, but it looks like that the overhead of having multiple dynamic bindings should not be overrated.

view this post on Zulip Sean (May 12 2022 at 17:32):

I doubt performance will be a distinguishing feature, but yes it does put less burden on program start-up time as the linker doesn't have to resolve symbols.

view this post on Zulip Sean (May 12 2022 at 17:33):

There's also a different memory footprint, as the dynamic linker will often not load until something is actually needed. So there's a tradeoff that will have different implications for different app needs.

view this post on Zulip Himanshu (May 12 2022 at 17:35):

Sean said:

There's also a different memory footprint, as the dynamic linker will often not load until something is actually needed. So there's a tradeoff that will have different implications for different app needs.

That's true, dynamic linker will not load until needed.

view this post on Zulip Daniel Rossberg (May 12 2022 at 17:35):

Sean said:

That's an interesting nuanced perspective (static).. I hadn't really conceptualized it in terms of static vs dynamic. I think of it as clean C++ API on top of the C libs (i.e., rt^3) but compiled in a separate space so it can't reach into non-public API.

One possible application in mind was the BRL-CAD backend for Freecad. They may have stronger requirements regarding their libraries (like Linux standard base).

view this post on Zulip Himanshu (May 12 2022 at 18:02):

@Daniel Rossberg https://github.com/BRL-CAD/arbalest/pull/13#discussion_r870764258 What you think about this?

view this post on Zulip Himanshu (May 24 2022 at 04:59):

So how should I proceed?

view this post on Zulip Sean (May 24 2022 at 15:00):

@Himanshu Sekhar Nayak for most, this is the time to get fully set up and familiarized with the code and community, so you have an advantage there -- you're already familiar. Your mentor may have other setup tasks in mind, but one bit of setup that'd be useful would be compiling the latest brlcad repo with Qt enabled, familiarize yourself with how it's different. That way, you'd be able to at least be aware what is going on in those Qt modules that are being developed for other GUI integrations, and what's going on in Arbalest.

view this post on Zulip Himanshu (May 24 2022 at 15:12):

Okay, I think I should clean up my workspace and build brlcad & arbalest again. Btw I saw that previous year students maintained a log for each day work. So should I do that this year too?
Sean said:

Himanshu Sekhar Nayak for most, this is the time to get fully set up and familiarized with the code and community, so you have an advantage there -- you're already familiar. Your mentor may have other setup tasks in mind, but one bit of setup that'd be useful would be compiling the latest brlcad repo with Qt enabled, familiarize yourself with how it's different. That way, you'd be able to at least be aware what is going on in those Qt modules that are being developed for other GUI integrations, and what's going on in Arbalest.

view this post on Zulip Daniel Rossberg (May 24 2022 at 16:54):

According to our checklist: Yes, please.

You daily log will be a very useful, informal way of communication. It can tell me, if I need to become active, for example.

view this post on Zulip Himanshu (May 24 2022 at 16:57):

Daniel Rossberg said:

According to our checklist: Yes, please.

You daily log will be a very useful, informal way of communication. It can tell me, if I need to become active, for example.

Blogger is fine for that? Or I should choose any?

view this post on Zulip Daniel Rossberg (May 24 2022 at 16:57):

And, regarding your pull request, I made a comment to your code.

view this post on Zulip Himanshu (May 24 2022 at 16:59):

Daniel Rossberg said:

And, regarding your pull request, I made a comment to your code.

I can't see the comment. You commented now?

view this post on Zulip Himanshu (May 24 2022 at 17:02):

Btw I already added a commit 4 days ago.

view this post on Zulip Daniel Rossberg (May 24 2022 at 17:02):

Himanshu Sekhar Nayak said:

Blogger is fine for that? Or I should choose any?

You can choose the solution you like most. However, one possibility is to create an account for the BRL-CAD wiki and have the blog there under your user page.

view this post on Zulip Daniel Rossberg (May 24 2022 at 17:04):

Himanshu Sekhar Nayak said:

I can't see the comment. You commented now?

No, it was 2 or 3 days before, regarding your last commit.

view this post on Zulip Daniel Rossberg (May 24 2022 at 17:05):

I can see my comment at the bottom of the "Conversation" tab, for example.

view this post on Zulip Himanshu (May 24 2022 at 17:05):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

I can't see the comment. You commented now?

No, it was 2 or 3 days before, regarding your last commit.

I forgot to inform you that I had added a commit.

view this post on Zulip Daniel Rossberg (May 24 2022 at 17:06):

I saw your commit, and commented it :)

view this post on Zulip Himanshu (May 24 2022 at 17:10):

Daniel Rossberg said:

I saw your commit, and commented it :smile:

Yep I saw it and added a commit. How's about the recent commit that I had sent?

view this post on Zulip Himanshu (May 24 2022 at 17:10):

https://github.com/BRL-CAD/arbalest/pull/13#issuecomment-1132499183

view this post on Zulip Daniel Rossberg (May 24 2022 at 17:18):

And, this is the last thing you see at Conversation?

view this post on Zulip Himanshu (May 24 2022 at 17:19):

Daniel Rossberg said:

And, this is the last thing you see at Conversation?

Yep, my comment is the last one with a commit above comment.

view this post on Zulip Himanshu (May 24 2022 at 17:19):

Screenshot-62.png

view this post on Zulip Himanshu (May 24 2022 at 17:24):

Btw I had to add my project here ? https://brlcad.org/wiki/Google_Summer_of_Code/2022

view this post on Zulip Daniel Rossberg (May 24 2022 at 17:26):

Can you see it now?

view this post on Zulip Himanshu (May 24 2022 at 17:27):

Daniel Rossberg said:

Can you see it now?

Yes, now I got the notification.

view this post on Zulip Daniel Rossberg (May 24 2022 at 17:29):

It was a "review" before. Now, I added it as "single comment". (I can't remember to had this option the day before :thinking:)

view this post on Zulip Himanshu (May 24 2022 at 17:32):

I now added two more commits.

view this post on Zulip Daniel Rossberg (May 24 2022 at 17:36):

Hmm, then you have to change line 811 (807) too. The point in my code example was, that I mad two distinct if-clauses:

if (displayGrid != nullptr) {
    if (displayGrid->getDocument()->getDocumentId() != activeDocumentId) {

view this post on Zulip Daniel Rossberg (May 24 2022 at 17:38):

The outer if tests if it's a BRL-CAD database or not. If it's not, and if it wasn't reset yet (activeDocument = -1), then reset it now.

view this post on Zulip Himanshu (May 24 2022 at 17:42):

Ahh... Why I am so in hurry ...... :oh_no:

view this post on Zulip Himanshu (May 24 2022 at 17:46):

Daniel Rossberg said:

The outer if tests if it's a BRL-CAD database or not. If it's not, and if it wasn't reset yet (activeDocument = -1), then reset it now.

Added new commit.

view this post on Zulip Daniel Rossberg (May 24 2022 at 17:48):

I see :grinning:
I'll test it tomorrow, but this should do it.

view this post on Zulip Himanshu (May 24 2022 at 17:49):

I am going to search for library for mouse events that I am going to apply and will inform you.

view this post on Zulip Himanshu (May 24 2022 at 17:49):

Himanshu Sekhar Nayak said:

Btw I had to add my project here ? https://brlcad.org/wiki/Google_Summer_of_Code/2022

And should I add?

view this post on Zulip Daniel Rossberg (May 24 2022 at 17:50):

Ah, yes.

view this post on Zulip Sean (May 24 2022 at 19:38):

@Himanshu Sekhar Nayak yes, please add yourself to the wiki page. thank you for stubbing the new year too.

view this post on Zulip Himanshu (May 26 2022 at 15:35):

My Workspace is ready. Freshly built and ran arbalest. :cowboy:

view this post on Zulip Himanshu (May 26 2022 at 17:30):

I updated my wiki page https://brlcad.org/wiki/Google_Summer_of_Code/2022#New_BRL-CAD_GUI and also started updating my dev log from today.

view this post on Zulip Himanshu (May 26 2022 at 18:00):

Btw arbalest don't have .ui file?

view this post on Zulip Sean (May 26 2022 at 21:54):

That's Qt's xml configuration when you make the GUI using their tool right?

view this post on Zulip Himanshu (May 27 2022 at 04:35):

Yep, that's right. I can't find one.

view this post on Zulip Sean (May 27 2022 at 04:36):

Yes, that's to be expected. It wasn't designed using the GUI tool.

view this post on Zulip Daniel Rossberg (May 27 2022 at 10:58):

We didn't want to use the code generator. I'm also in doubt that what Himanshu did can be created with the Composer.

view this post on Zulip Himanshu (May 27 2022 at 12:21):

Daniel Rossberg said:

We didn't want to use the code generator. I'm also in doubt that what Himanshu did can be created with the Composer.

Composer? What is it?

view this post on Zulip Daniel Rossberg (May 27 2022 at 15:19):

Sorry, you are right, it's called Qt Creator.

view this post on Zulip Himanshu (May 27 2022 at 18:28):

Created a pr https://github.com/BRL-CAD/arbalest/pull/16 @Daniel Rossberg

view this post on Zulip Himanshu (May 27 2022 at 20:25):

Updated my dev log and also raised an issue https://github.com/BRL-CAD/arbalest/issues/17

view this post on Zulip Daniel Rossberg (May 28 2022 at 15:57):

Can https://github.com/BRL-CAD/arbalest/issues/15 be closed?

view this post on Zulip Divyanshu Garg (May 28 2022 at 19:46):

(deleted)(Posted in Project site topic)

view this post on Zulip Himanshu (May 29 2022 at 11:05):

Daniel Rossberg said:

Can https://github.com/BRL-CAD/arbalest/issues/15 be closed?

Nope, it is not fixed yet. Properties docks are not visible while switching tabs.

view this post on Zulip Himanshu (May 29 2022 at 16:36):

@Daniel Rossberg Arbalest have special tool bar?

view this post on Zulip Himanshu (May 29 2022 at 17:00):

btw should I add those icons to the menubar?

view this post on Zulip Himanshu (May 29 2022 at 17:04):

but these icons are in black color and doesn't suit with violet.

view this post on Zulip Himanshu (May 29 2022 at 17:05):

Screenshot-64.png

view this post on Zulip Himanshu (May 29 2022 at 17:05):

probably white icons can help?

view this post on Zulip Himanshu (May 29 2022 at 19:41):

I am thinking to remove QPushButton completely in tool bar area and only keep DisplayGrid and Viewports.

view this post on Zulip Himanshu (May 29 2022 at 20:02):

But still there will be duplicate code for DisplayGrid and ViewPorts. One thing can be done like keep QPushButton and remove QAction for DisplayGrid and ViewPorts. It looks good and helpful too.

view this post on Zulip Daniel Rossberg (May 30 2022 at 16:46):

Himanshu Sekhar Nayak said:

Daniel Rossberg Arbalest have special tool bar?

The usual way would be to use a QToolBar object, e.g. from QMainWidget::addToolBar(). But, arbalest uses a QFrame with a QVBoxLayout for this purpose.

view this post on Zulip Daniel Rossberg (May 30 2022 at 16:51):

You can assign an action to a QToolButton via setDefaultAction().

view this post on Zulip Himanshu (May 30 2022 at 17:05):

Instead of using QPushButton, we can shift to QToolButton.

view this post on Zulip Himanshu (May 30 2022 at 17:06):

So we have QToolBar and QVBoxLayout.

view this post on Zulip Himanshu (May 30 2022 at 17:07):

I will look into it and will compare what will be best.

view this post on Zulip Daniel Rossberg (May 30 2022 at 17:08):

I think, it's worth to give QToolButton a try. And of course, it need a different icon.

view this post on Zulip Himanshu (May 30 2022 at 17:09):

Btw QVBoxLayout is like having items downward fashion right?

view this post on Zulip Himanshu (May 30 2022 at 17:10):

Like this Screenshot-2022-05-30-224015.png

view this post on Zulip Daniel Rossberg (May 30 2022 at 17:11):

Right, the V is for vertical, QHBoxLayout (QHBoxWidget) is the horizontal one.

view this post on Zulip Himanshu (May 30 2022 at 17:13):

Daniel Rossberg said:

I think, it's worth to give QToolButton a try. And of course, it need a different icon.

Previous night, I was trying that QToolButton. And I agree that once QAction object for New is created then it can be used by QToolButton too right?

view this post on Zulip Daniel Rossberg (May 30 2022 at 17:15):

I would expect it. The documentation and the Internet says it...

view this post on Zulip Himanshu (May 30 2022 at 17:15):

Yep, I was searching on it and saw we can assign QAction to QToolButton.

view this post on Zulip Himanshu (May 30 2022 at 17:16):

I have a doubt regarding GSoC timelines.

view this post on Zulip Himanshu (May 30 2022 at 17:16):

My dashboard shows september is the final deadline submission.

view this post on Zulip Himanshu (May 30 2022 at 17:17):

It should be November right? Or google will extend it in future?

view this post on Zulip Daniel Rossberg (May 30 2022 at 17:21):

So, you want Final Submission End Date: Monday, November 21?

view this post on Zulip Himanshu (Jun 01 2022 at 14:22):

Created a new PR https://github.com/BRL-CAD/arbalest/pull/19

view this post on Zulip Himanshu (Jun 02 2022 at 16:47):

@Daniel Rossberg Ahh... what a fool I used view in for all icons.

view this post on Zulip Himanshu (Jun 02 2022 at 16:48):

$Color-IconFile                         : #430086;
$Color-IconView                         : #0d7088;
$Color-IconRaytrace                     : #cf041b;

view this post on Zulip Daniel Rossberg (Jun 02 2022 at 17:00):

It can easily been overseen. I realized the different colors when I put the old and new version side-by-side, and looked for the reason.

view this post on Zulip Himanshu (Jun 02 2022 at 17:02):

Daniel Rossberg said:

It can easily been overseen. I realized the different colors when I put the old and new version side-by-side, and looked for the reason.

Now it looks like this after I made changes. Screenshot-2022-06-02-223204.png

view this post on Zulip Daniel Rossberg (Jun 02 2022 at 17:03):

BTW, this method could be a way to recolor the icons for the menu too. Something like $Color-MenuIcon: #ffffff;.

view this post on Zulip Himanshu (Jun 02 2022 at 17:04):

So we are adding icons to menu items?

view this post on Zulip Daniel Rossberg (Jun 02 2022 at 17:05):

You could also have Color-MenuIconFile, Color-MenuIconView, and Color-MenuIconRaytrace. Try it out!

view this post on Zulip Daniel Rossberg (Jun 02 2022 at 17:05):

Himanshu Sekhar Nayak said:

So we are adding icons to menu items?

By adding the icon to the action.

view this post on Zulip Himanshu (Jun 02 2022 at 17:08):

I will start my work from 6th June because I have an entrance exam on 4th June and tomorrow I will be travelling to a different state because the test center is not available where I live now.

view this post on Zulip Himanshu (Jun 02 2022 at 17:09):

I will test it out and will update the pr.

view this post on Zulip Daniel Rossberg (Jun 02 2022 at 17:21):

Have a good trip!

view this post on Zulip Himanshu (Jun 06 2022 at 15:17):

@Daniel Rossberg Are we planning to add icons to QAction open, new, .... same like that I had done for QToolButton? I am bit confused to add icons to the menu or inside menu items?

view this post on Zulip Himanshu (Jun 06 2022 at 16:10):

Opened a new pr https://github.com/BRL-CAD/arbalest/pull/20

view this post on Zulip Daniel Rossberg (Jun 06 2022 at 17:12):

Himanshu Sekhar Nayak said:

Daniel Rossberg Are we planning to add icons to QAction open, new, .... same like that I had done for QToolButton? I am bit confused to add icons to the menu or inside menu items?

I would give QAction::setIcon() a try. With an appropriate $Color-, of course.

view this post on Zulip Himanshu (Jun 07 2022 at 14:56):

Added a new commit to the pr.

view this post on Zulip Himanshu (Jun 08 2022 at 07:01):

@Daniel Rossberg To create a toggle button for ToggleGrid, I saw that using QCheckBox and adding icons ON/OFF we can do it. But I think we can achieve same using QToolButton by using QToolButton::pressed and QToolButton::released too.

view this post on Zulip Himanshu (Jun 08 2022 at 20:12):

I created a new pr https://github.com/BRL-CAD/arbalest/pull/21. We can remove the color if you don't like it.

view this post on Zulip Daniel Rossberg (Jun 09 2022 at 17:55):

I'm having a busy week. I hope to be able to test them at the weekend.

view this post on Zulip Himanshu (Jun 09 2022 at 17:56):

No problem, take your time. :cowboy:

view this post on Zulip Himanshu (Jun 13 2022 at 12:34):

@Daniel Rossberg Added a new pr and found some problems too. https://github.com/BRL-CAD/arbalest/pull/22

view this post on Zulip Himanshu (Jun 13 2022 at 14:44):

Should I add space? Screenshot-68.png

view this post on Zulip Sean (Jun 13 2022 at 14:46):

Seems like a good idea for readability

view this post on Zulip Himanshu (Jun 13 2022 at 17:03):

I haven't yet tried QAction::setCheckable(). Will do it now.

view this post on Zulip Himanshu (Jun 13 2022 at 17:24):

After I add isCheckable to true. But the color shows Screenshot-2022-06-13-225345.png

view this post on Zulip Himanshu (Jun 13 2022 at 17:26):

how this color is set?

view this post on Zulip Himanshu (Jun 13 2022 at 17:27):

I can't find.

view this post on Zulip Daniel Rossberg (Jun 13 2022 at 17:32):

I don't really know what you mean. I'm just testing it, and something strange happens. But, the QToolButton now has definitely a checked state.

view this post on Zulip Himanshu (Jun 13 2022 at 17:35):

Daniel Rossberg said:

I don't really know what you mean. I'm just testing it, and something strange happens. But, the QToolButton now has definitely a checked state.

I removed setCheckable(true); from toggleGrid and added back to toggleGridAct->setCheckable(true);. Also I commented out connect that I have added in my pr. Then I run the program and click on that button and it becomes green.

view this post on Zulip Himanshu (Jun 13 2022 at 17:35):

I can't find where this color property is set.

view this post on Zulip Daniel Rossberg (Jun 13 2022 at 17:38):

Maybe, it's a default behavior. Can you control it with your #toolbarButton:checked { background-color: "$Color-ButtonHoverMask"; } line?

view this post on Zulip Himanshu (Jun 13 2022 at 17:39):

Nope.

view this post on Zulip Himanshu (Jun 13 2022 at 17:39):

Already tested it out but nothing I can see the result.

view this post on Zulip Himanshu (Jun 13 2022 at 17:39):

Yes it may be a default behaviour.

view this post on Zulip Daniel Rossberg (Jun 13 2022 at 17:40):

BTW, on my computer (Linux) the icon disappears and is replaced by the tool tip text. But, this text shows a nice toggle behavior.

view this post on Zulip Daniel Rossberg (Jun 13 2022 at 17:41):

Well, something you can test out tomorrow.

view this post on Zulip Himanshu (Jun 13 2022 at 17:41):

I will test it and will you tell you if something I find. :computer:

view this post on Zulip Himanshu (Jun 14 2022 at 14:07):

@Daniel Rossberg I found that the icon becomes green due to the icon that I had set for QAction in toogleGridAct. So when I click on the tool button of toggle grid, it swaps with the color that had been set for icon in QAction.

view this post on Zulip Himanshu (Jun 14 2022 at 14:31):

So I commented out setIcon of QToolButton for toggleGrid and ran the program. I found that the the setIcon for QAction is acting default for QToolButton too. The icon for QAction is already there for QToolButton too which means setDefaultAction is playing a part here.

view this post on Zulip Himanshu (Jun 14 2022 at 14:37):

So one now I am proposing that if we set icons for QAction for all items in menu bar then the icons will be already be present for QToolButton too. Should we do that?

view this post on Zulip Daniel Rossberg (Jun 14 2022 at 17:40):

Hmm, not sure if it helps, but it may good to know: Look at the documentation of QIcon. You can set there multiple pixmaps for multiple purposes. I.e., in Qt an icon isn't just one image.

view this post on Zulip Daniel Rossberg (Jun 14 2022 at 17:42):

Himanshu Sekhar Nayak said:

So one now I am proposing that if we set icons for QAction for all items in menu bar then the icons will be already be present for QToolButton too. Should we do that?

For View and Raytrace this could work, but for File?

view this post on Zulip Amanjot Singh (Jun 15 2022 at 05:22):

(deleted)

view this post on Zulip Himanshu (Jun 15 2022 at 15:47):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

So one now I am proposing that if we set icons for QAction for all items in menu bar then the icons will be already be present for QToolButton too. Should we do that?

For View and Raytrace this could work, but for File?

Hmm the icons that I have added for QAction for files of items in menu bar will not suit the color to fit in tool bar area, I think.

view this post on Zulip Himanshu (Jun 15 2022 at 15:47):

I am taking a day off today.

view this post on Zulip Himanshu (Jun 16 2022 at 15:22):

I have commented out all setIcon for QToolButton and let them behave according to setDefaultAction and it looks this. Screenshot-2022-06-16-205231.png

view this post on Zulip Himanshu (Jun 16 2022 at 15:23):

For files the color is not suitable and looks not good.

view this post on Zulip Daniel Rossberg (Jun 16 2022 at 16:13):

Therefore, which color do you propose?

view this post on Zulip Himanshu (Jun 16 2022 at 16:18):

I haven't decided it yet. I have to choose a color that will best fit in menu bar and in tool bar too. I am now looking into it.

view this post on Zulip Himanshu (Jun 16 2022 at 19:55):

Pushed a new commit regarding that and solved merge conflicts.

view this post on Zulip Himanshu (Jun 16 2022 at 19:56):

And now it looks like this. check.png

view this post on Zulip Himanshu (Jun 16 2022 at 19:57):

I chosen a color which both suits light and dark areas.

view this post on Zulip Himanshu (Jun 16 2022 at 19:58):

I also found a way that is mentioned in docs too. https://doc.qt.io/qt-6/qicon.html#making-classes-that-use-qicon

view this post on Zulip Himanshu (Jun 17 2022 at 14:53):

@Daniel Rossberg Is there any closeEvent()? So that we can handle close successfully like when we close we can see if a document is opened or not and also it is saved or not.

view this post on Zulip Himanshu (Jun 18 2022 at 07:01):

I found there is no closeEvent().

view this post on Zulip Himanshu (Jun 18 2022 at 07:35):

It should check if current document is edited and not saved then the closeEvent() should notify to save it or close it, like that.

view this post on Zulip Himanshu (Jun 18 2022 at 17:36):

Btw what event propagation in qt really do? I only came to know through by writing an example if I have two classes ParentButton and ChildButton. ParentButton inherits QPushButton and ChildButton inherits ParentButton. In ParentButton class I have added an override function name ParentButton::mousePressEvent(QMouseEvent *event) and inside this function definition I called QPushButton::mousePressEvent(event); while in 'ChildButton' class I have added ChildButton::mousePressEvent(QMouseEvent *event) and inside this function definition I have added ParentButton::mousePressEvent(event);.

view this post on Zulip Himanshu (Jun 18 2022 at 17:36):

Then in widget.cpp I wrote

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    ChildButton *button {new ChildButton(this)};
    button->setText("Child Button");
    connect(button, &ChildButton::clicked, [=](){
        qDebug() << "Button clicked";
    });

    ui->verticalLayout->addWidget(button);
}

view this post on Zulip Himanshu (Jun 18 2022 at 17:37):

And when I run this program I can clearly see the output of the program using qDegug()

Child button mousePressEvent called
Parent button mousePressEvent called
Button clicked

view this post on Zulip Himanshu (Jun 18 2022 at 17:41):

But if I comment out ParentButton::mousePressEvent(event); then connect doesn't work. Why? Slot doesn't respond it. Why?

view this post on Zulip Himanshu (Jun 18 2022 at 17:44):

Ultimately this ChildButton is not going to work if I comment it out.

view this post on Zulip Himanshu (Jun 19 2022 at 17:37):

Created a new commit where I selected a suitable color for both light and dark theme.

view this post on Zulip Himanshu (Jun 20 2022 at 14:31):

btw where I should start looking for to add mouse support using qt? Any references?

view this post on Zulip Himanshu (Jun 20 2022 at 14:32):

Currently I am looking to mouse events.

view this post on Zulip Daniel Rossberg (Jun 20 2022 at 17:12):

Himanshu Sekhar Nayak said:

Daniel Rossberg Is there any closeEvent()? So that we can handle close successfully like when we close we can see if a document is opened or not and also it is saved or not.

The QWidget class has a protected function closeEvent() which can be redefined to handle close events correctly.

view this post on Zulip Daniel Rossberg (Jun 20 2022 at 17:25):

While testing your latest version of #21 I learned that it's not a good idea to have the same colors for the menu and tool buttons. However, you can give an own color to the tool buttons with setIcon.

Then, I saw that a light color looks good in the menus, as long as you don't touch it with a mouse. Then, the background color changes to white. This can be handled by code like this:

QIcon newActIcon;
newActIcon.addPixmap(QPixmap::fromImage(coloredIcon(":/icons/sharp_note_add_black_48dp.png", "$Color-MenuText")), QIcon::Normal);
newActIcon.addPixmap(QPixmap::fromImage(coloredIcon(":/icons/sharp_note_add_black_48dp.png", "$Color-Menu")), QIcon::Active);
newAct->setIcon(newActIcon);

As I already said, in Qt an icon isn't just one image.

view this post on Zulip Daniel Rossberg (Jun 20 2022 at 17:26):

Himanshu Sekhar Nayak said:

btw where I should start looking for to add mouse support using qt? Any references?

You probably have to reimplement one or more of QWidget's protected mouse~Event() functions.

view this post on Zulip Himanshu (Jun 20 2022 at 17:54):

Daniel Rossberg said:

While testing your latest version of #21 I learned that it's not a good idea to have the same colors for the menu and tool buttons. However, you can give an own color to the tool buttons with setIcon.

Then, I saw that a light color looks good in the menus, as long as you don't touch it with a mouse. Then, the background color changes to white. This can be handled by code like this:

QIcon newActIcon;
newActIcon.addPixmap(QPixmap::fromImage(coloredIcon(":/icons/sharp_note_add_black_48dp.png", "$Color-MenuText")), QIcon::Normal);
newActIcon.addPixmap(QPixmap::fromImage(coloredIcon(":/icons/sharp_note_add_black_48dp.png", "$Color-Menu")), QIcon::Active);
newAct->setIcon(newActIcon);

As I already said, in Qt an icon isn't just one image.

I saw something like that https://doc.qt.io/qt-6/qicon.html#making-classes-that-use-qicon.

view this post on Zulip Himanshu (Jun 20 2022 at 19:15):

(deleted)

view this post on Zulip Himanshu (Jun 20 2022 at 20:45):

Pushed new commit to #21. For now I have only made changes to menubar of file items and added two new icons. Next I will for view icons in menu bar. Then similarly I will add rest changes to toolbar area.

view this post on Zulip Himanshu (Jun 22 2022 at 15:19):

Btw should I mention or credit the icons that I use for arbalest? Those icons I used are free.

view this post on Zulip Himanshu (Jun 23 2022 at 11:09):

Found a bug. After closing the tab. The toolbutton are no longer there. Here what is missing. Screenshot-73.png

view this post on Zulip Himanshu (Jun 23 2022 at 11:09):

The toolbutton supposed to be there right even after there is no tabs or documents open?

view this post on Zulip Himanshu (Jun 23 2022 at 11:12):

MainWindow::tabCloseRequested(const int i) and MainWindow::closeButtonPressed() are not handled if a document is open and there is unsaved changes. And closing the tab should open a dialog and ask to save it. Save goes for closeButtonPressed if the whole application is going to be closed then it should check if there any unsaved changes that are not saved yet.

view this post on Zulip Himanshu (Jun 23 2022 at 11:14):

Is there gonna be any difference if we should use closeEvent() instead of closeButtonPressed()? We can override closeEvent and add the implementation on how to handle the close if there are any unsaved changes?

view this post on Zulip Himanshu (Jun 23 2022 at 18:37):

Pushed a commit where I added Save As to toolbutton and added icons for rest of toolbuttons. Only thing broken is toolGridButton. Because it should behave as pressed if a document is open and the background color should become grey but for now without any document open, it can turn grey if it is in pressed state.

view this post on Zulip Himanshu (Jun 23 2022 at 18:37):

Will work on it tomorrow.

view this post on Zulip Himanshu (Jun 24 2022 at 14:16):

I have upcoming exams from 27-29 June. I may not contribute during those days. I will resume from 29 June.

view this post on Zulip Himanshu (Jun 24 2022 at 18:55):

I just saw https://doc.qt.io/qt-6/qaction.html#qaction-in-widget-applications and thought to give something like that to our code. Btw how it looks:

QIcon newActIcon;
newActIcon.addPixmap(QPixmap::fromImage(coloredIcon(":/icons/sharp_note_add_black_48dp.png", "$Color-MenuIconFile")), QIcon::Normal);
newActIcon.addPixmap(QPixmap::fromImage(coloredIcon(":/icons/sharp_note_add_black_48dp.png", "$Color-Menu")), QIcon::Active);
QAction* newAct = new QAction(newActIcon, tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("New .g file"));
connect(newAct, &QAction::triggered, this, &MainWindow::newFile);
fileMenu->addAction(newAct);

view this post on Zulip Himanshu (Jun 24 2022 at 18:56):

Everything looks same. Only thing is that I directly passed it to the constructor instead of setIcon but looks clean. @Daniel Rossberg

view this post on Zulip Himanshu (Jun 24 2022 at 19:43):

Btw I implemented toggle feature for QAction *toggleGridAct like this and it's working simultaneously with toggleGridButton too. Here is a look:

connect(toggleGridAct, &QAction::triggered, this, [=](){
        if (toggleGridAct->isChecked()) {
            if (activeDocumentId == -1) {
                toggleGridAct->setChecked(false);
                return;
            }
        }
        documents[activeDocumentId]->getDisplayGrid()->getActiveDisplay()->gridEnabled =
                !documents[activeDocumentId]->getDisplayGrid()->getActiveDisplay()->gridEnabled;
        documents[activeDocumentId]->getDisplayGrid()->getActiveDisplay()->forceRerenderFrame();
    });

view this post on Zulip Daniel Rossberg (Jun 26 2022 at 15:33):

Himanshu Sekhar Nayak said:

Btw should I mention or credit the icons that I use for arbalest? Those icons I used are free.

Did you read their license? https://icons8.com/license They require to be mentioned. The full text of their license agreement requires at least two links. In addition, free accounts are for personal use only. I.e., icons8 looks like a no go to me.

view this post on Zulip Daniel Rossberg (Jun 26 2022 at 16:09):

Himanshu Sekhar Nayak said:

MainWindow::tabCloseRequested(const int i) and MainWindow::closeButtonPressed() are not handled if a document is open and there is unsaved changes. And closing the tab should open a dialog and ask to save it. Save goes for closeButtonPressed if the whole application is going to be closed then it should check if there any unsaved changes that are not saved yet.

MainWindow is a QMainWindow, which doesn't have a tabCloseRequested() method. I.e., if you implement one, it will never be called (you don't overwrite the default one because there is no such function). Only QTabBar and QTabWidget have tabCloseRequested() methods.

For catching closing of the application look at the Qt documentation at QWidget::closeEvent():

void MainWindow::closeEvent(QCloseEvent *event)
{
    if (maybeSave()) {
        writeSettings();
        event->accept();
    } else {
        event->ignore();
    }
}

view this post on Zulip Himanshu (Jun 26 2022 at 19:08):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

Btw should I mention or credit the icons that I use for arbalest? Those icons I used are free.

Did you read their license? https://icons8.com/license They require to be mentioned. The full text of their license agreement requires at least two links. In addition, free accounts are for personal use only. I.e., icons8 looks like a no go to me.

Okay, I will look for better options for icons which supports open source license.

view this post on Zulip Daniel Rossberg (Jun 27 2022 at 17:49):

@Sean Do we have icon sets? I looked at https://brlcad.org/gci/, but could find CAD specific icons only, nothing for load/save/new document/etc..

view this post on Zulip Sean (Jun 28 2022 at 16:41):

@Daniel Rossberg yes and no. I have some of the icon sets summarized at https://brlcad.org/design/ under 'icons' for app and web. I only uploaded the overviews, but the complete data sets are under gci/data. There's also a fair bit of GUI concepts under https://brlcad.org/design/gui/ including a few new ones I recently added from 2017 gci. They should all be fair game.

view this post on Zulip Sean (Jun 28 2022 at 16:56):

Here are a handful of good open source icon repositories I've come across:
https://fonts.google.com/icons (apache)
https://remixicon.com (apache)
https://iconoir.com (mit)
https://materialdesignicons.com (mostly apache, see https://github.com/Templarian/MaterialDesign)
https://icons.mono.company (mit)
https://feathericons.com (mit)

view this post on Zulip Himanshu (Jun 29 2022 at 15:02):

Thanks @Sean for the resources. Btw I like the icons provided by Google.

view this post on Zulip Himanshu (Jun 29 2022 at 15:03):

Btw I pushed a new commit too.

view this post on Zulip Daniel Rossberg (Jun 29 2022 at 16:51):

What does the Apache licence there say? What do we have to do to fulfill it?

view this post on Zulip Himanshu (Jun 29 2022 at 17:30):

@Daniel Rossberg Looks like we have to add the LICENSE and NOTICE file in our arbalest if we are adding those icons. https://www.apache.org/licenses/LICENSE-2.0

view this post on Zulip Daniel Rossberg (Jun 29 2022 at 17:56):

Not exactly. They write "If the Work includes a "NOTICE" text file...". Arbalest does not. But, the License file should be updated. And maybe mentioned which files are under Apache 2.0 license.

view this post on Zulip Sean (Jun 29 2022 at 18:00):

In the brlcad repo, we store a copy of each license in doc/legal so they’re included in distributions

view this post on Zulip Himanshu (Jun 30 2022 at 15:01):

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

yyyy - 2022 and what about [name of copyright owner]? Is it brlcad? And this will be written to arbalest LICENSE right?

view this post on Zulip Himanshu (Jun 30 2022 at 18:42):

So far the file menu now looks like this in light theme:
Screenshot-2022-07-01-001151.png

view this post on Zulip Himanshu (Jun 30 2022 at 19:08):

Started working on closeEvent(). Btw I pushed some commits too related to shortcut key.

view this post on Zulip Himanshu (Jul 02 2022 at 09:25):

I found that even if the file is saved and I try to save, the program is saving the contents even if there is no new changes to the file.

view this post on Zulip Himanshu (Jul 02 2022 at 09:47):

Instead of saving it, it should stop because there is no new changes to the file.

view this post on Zulip Himanshu (Jul 02 2022 at 17:55):

I have found similar one https://doc.qt.io/qt-6/qtwidgets-mainwindows-application-example.html but Qt already have isModified() to check if there is unsaved changed which is a part of QLineEdit.

view this post on Zulip Himanshu (Jul 03 2022 at 12:19):

Added initial prototypes https://github.com/BRL-CAD/arbalest/pull/23. I converted this pr to draft because it is still in work in progress.

view this post on Zulip Daniel Rossberg (Jul 03 2022 at 16:15):

Himanshu Sekhar Nayak said:

I have found similar one https://doc.qt.io/qt-6/qtwidgets-mainwindows-application-example.html but Qt already have isModified() to check if there is unsaved changed which is a part of QLineEdit.

That's the point: How do you know if the database was modified? You won't get it for free.

view this post on Zulip Himanshu (Jul 03 2022 at 17:10):

Looks likes this is a feature too like mouse feature.

view this post on Zulip Himanshu (Jul 03 2022 at 19:14):

Okay for now I have some things to do before I start implementing save feature.

bool MainWindow::saveFile(const QString& filePath) {
    return documents[activeDocumentId]->getDatabase()->Save(filePath.toUtf8().data());
}

I need to know how getDatabase()->Save(filePath.toUtf8().data()) is actually being saved in a database. I have found Database.h and MemoryDatabase.h and need to see how this working on to save a file. Without knowing how these are working, I can't know what to do for unsaved changes.

bool MainWindow::saveFile(const QString& filePath) {
    if (!isModified()) {
        return false;
    }
    return documents[activeDocumentId]->getDatabase()->Save(filePath.toUtf8().data());
}

view this post on Zulip Himanshu (Jul 04 2022 at 15:15):

Taking day off today for tomorrow's one and only entrance examination.

view this post on Zulip Daniel Rossberg (Jul 04 2022 at 17:02):

Something like this. You need a flag, which tells you if the database was modified. Any modifying function had to set it, and save() (for example) has to reset it.

Ideally, the save button isn't available, if the database wasn't modified.

view this post on Zulip Himanshu (Jul 06 2022 at 17:35):

Working on to free memory as soon as the tab gets closed.

view this post on Zulip Himanshu (Jul 07 2022 at 18:50):

Added new PR https://github.com/BRL-CAD/arbalest/pull/24

view this post on Zulip Sadeep Darshana (Jul 09 2022 at 07:21):

Great to see progress in Arbalest. Let me know if I can help you with anything.

view this post on Zulip Himanshu (Jul 09 2022 at 12:30):

Sadeep Darshana said:

Great to see progress in Arbalest. Let me know if I can help you with anything.

Thanks @Sadeep Darshana, I am currently looking into how to save the unsaved changes of a .g file.

view this post on Zulip Himanshu (Jul 09 2022 at 12:32):

@Sadeep Darshana How's about the icons that are added? https://github.com/BRL-CAD/arbalest/pull/21

view this post on Zulip Himanshu (Jul 09 2022 at 16:03):

@Sadeep Darshana Meanwhile also have a look here https://github.com/BRL-CAD/arbalest/issues/15. So far I am able to know that after selecting an object from object tree, documents[activeDocumentId]->getProperties()->bindObject(objectId); helps in creating properties and show values. But if I switched to other document where the object is already selected then it doesn't show the properties. Either it is not visible or something idk?

view this post on Zulip Himanshu (Jul 09 2022 at 18:48):

@Daniel Rossberg while closing tabs, the memory is being freed. But I saw in task manager and also in vs while debugging but it doesn't show the memory being reduced of what it is being allocated. Is that right way to see?

view this post on Zulip Daniel Rossberg (Jul 09 2022 at 18:56):

The memory assigned to the process can stay the same, if only a small amount is freed (which is the case for the empty in-memory database in your tests). The memory is kept in store by the C library memory management.

view this post on Zulip Himanshu (Jul 10 2022 at 11:35):

@Daniel Rossberg okay looks like I found what have been causing this problem for switching tabs where it doesn't show properties of the selected object from objects docks.

view this post on Zulip Himanshu (Jul 10 2022 at 11:43):

In Properties.cpp line 28 void Properties::bindObject(const int objectId) {} where it sets the values for properties. Here is the function:

void Properties::bindObject(const int objectId) {
    this->fullPath = document.getObjectTree()->getFullPathMap()[objectId];
    this->name = fullPath.split("/").last();
    fullPathWidget->setText(QString(fullPath).replace("/"," / "));

    static BRLCAD::Object* object = nullptr;
    delete object;
    object = document.getDatabase()->Get(fullPath.toUtf8().data());
    objectType = QString(object->Type());

    static TypeSpecificProperties * current = nullptr;
    delete current;
    current = new TypeSpecificProperties(document, object, objectId);
    typeSpecificPropertiesArea->addWidget(current);

    QString nameType = "<font color='$Color-PropertiesObjectNameText'>"+name+"</font><font color='$Color-DefaultFontColor'> ( "
                        "<font color='$Color-PropertiesObjectTypeText'>"+breakStringAtCaps(objectType)+"</font><font color='$Color-DefaultFontColor'> )";
    nameWidget->setText(Globals::theme->process(nameType));
}

view this post on Zulip Himanshu (Jul 10 2022 at 11:47):

Here BRLCAD::Object* object stores the values of the selected object of the current document and if I switched to another tab or document then object still stores the values of the previous selected object from objects dock.

view this post on Zulip Himanshu (Jul 10 2022 at 12:09):

Main Problem lies here:

    static TypeSpecificProperties * current = nullptr;
    delete current;
    current = new TypeSpecificProperties(document, object, objectId);
    typeSpecificPropertiesArea->addWidget(current);

view this post on Zulip Himanshu (Jul 10 2022 at 12:11):

Since it is static so it only retains the values when bindObject is called for an selected object from Objects dock.

view this post on Zulip Daniel Rossberg (Jul 10 2022 at 12:41):

Nice. It looks like you found the cause. Next, you need an idea of how to fix this. :smile:

view this post on Zulip Himanshu (Jul 11 2022 at 15:11):

Daniel Rossberg said:

Nice. It looks like you found the cause. Next, you need an idea of how to fix this. :smile:

Fixed. Here is the PR: https://github.com/BRL-CAD/arbalest/pull/25

view this post on Zulip Himanshu (Jul 11 2022 at 19:56):

Also I updated my dev log. You can have a look. https://brlcad.org/wiki/User:H1manshu/GSoC2022/Log#Dev_Log

view this post on Zulip Himanshu (Jul 14 2022 at 16:35):

Btw, in meantime I added toggle option for grid.

view this post on Zulip Himanshu (Jul 14 2022 at 16:35):

https://github.com/BRL-CAD/arbalest/pull/21/commits/da58ba2b8056e942fc4bea5d646fb237c5c01df9

view this post on Zulip Himanshu (Jul 16 2022 at 21:34):

@Daniel Rossberg BTW, I wrote some prototype code which I think will be enough to handle if documents are unsaved but now I can start looking how to detect if a file has unsaved changes. You can have a look: https://paste.ofcode.org/PTbXARvTBQLqJt8WpiH2Ue

view this post on Zulip Himanshu (Jul 16 2022 at 21:38):

Also pushed commits to the draft pr: https://github.com/BRL-CAD/arbalest/pull/23

view this post on Zulip Daniel Rossberg (Jul 18 2022 at 17:52):

Himanshu Sekhar Nayak said:

Daniel Rossberg BTW, I wrote some prototype code which I think will be enough to handle if documents are unsaved but now I can start looking how to detect if a file has unsaved changes. You can have a look: https://paste.ofcode.org/PTbXARvTBQLqJt8WpiH2Ue

I started with looking at the logic: In maybeSave() you iterate over the open files, but in closeEvent(), you call saveAsFileDialog(), which saves the active document only, which may even be unmodified. This doesn't look right.

view this post on Zulip Himanshu (Jul 18 2022 at 18:26):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

Daniel Rossberg BTW, I wrote some prototype code which I think will be enough to handle if documents are unsaved but now I can start looking how to detect if a file has unsaved changes. You can have a look: https://paste.ofcode.org/PTbXARvTBQLqJt8WpiH2Ue

I started with looking at the logic: In maybeSave() you iterate over the open files, but in closeEvent(), you call saveAsFileDialog(), which saves the active document only, which may even be unmodified. This doesn't look right.

I only completed maybeSave() but never looked to saveAsFileDialog() which is used in closeEvent(). I wrote saveAsFileDialog() when I had not implemented maybeSave() and hadn't thought about it so more.

view this post on Zulip Himanshu (Jul 18 2022 at 18:29):

Btw, here is the new commit I added https://github.com/BRL-CAD/arbalest/pull/23/commits/f7a782f8aa58ae15ee1f9dac7c704a7d249dbc19

view this post on Zulip Daniel Rossberg (Jul 19 2022 at 17:50):

Hmm, where is the "save file" there? Think about the desired behavior first! How should this feature work?
BTW, don't make it too complicated, e.g. by having two buttons for not saving.
Why not QMessageBox::question()?

view this post on Zulip Himanshu (Jul 23 2022 at 18:21):

@Daniel Rossberg What will be the behavior if the user press cancel for unsaved changes? 1. Close the application 2. Don't close the application and allow user to modify the document ?

view this post on Zulip Himanshu (Jul 23 2022 at 19:54):

Added new commit but I don't know what I should do for if the user press cancel.

view this post on Zulip Daniel Rossberg (Jul 24 2022 at 18:49):

You need 3 buttons: "save", "don't save", and "abort". The first one saves the document and proceeds to the next one. The second doesn't save and proceeds to the next one. The last one aborts the procedure and arbalest won't close.

view this post on Zulip Himanshu (Jul 25 2022 at 14:27):

During execution I got some warnings.

QObject::connect: No such signal QAction::QAction::triggered() in C:\Users\Himanshu\Desktop\Workspace\rt-cubed\src\arbalest\src\gui\MainWindow.cpp:124
QObject::connect: No such signal QAction::QAction::triggered() in C:\Users\Himanshu\Desktop\Workspace\rt-cubed\src\arbalest\src\gui\MainWindow.cpp:133

view this post on Zulip Himanshu (Jul 25 2022 at 14:28):

Currently,

124    connect(saveAct, SIGNAL(QAction::triggered()), this, SLOT(MainWindow::saveFileDefaultPath()));
133    connect(saveAsAct, SIGNAL(QAction::triggered()), this, SLOT(MainWindow::saveAsFileDialog()));

view this post on Zulip Himanshu (Jul 25 2022 at 14:30):

Btw should I ignore these? Btw I solved using,

124    connect(saveAct, SIGNAL(triggered()), this, SLOT(saveFileDefaultPath()));
133    connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAsFileDialog()));

view this post on Zulip Himanshu (Jul 25 2022 at 14:30):

@Daniel Rossberg but it is less informative I think?

view this post on Zulip Daniel Rossberg (Jul 25 2022 at 17:03):

It depneds, if you are using the SIGNAL and SLOT macros or not. I.e., connect(saveAct, &QAction::triggered, this, &MainWindow::saveFileDefaultPath); should work too (using function pointers).

And no, you shouldn't ignore these warnings ;)

view this post on Zulip Himanshu (Jul 25 2022 at 17:12):

@Daniel Rossberg I got something when I am searching in stack overflow.

view this post on Zulip Himanshu (Jul 25 2022 at 17:12):

/me Today's lesson is: do not overload your signals and slots in Qt!

view this post on Zulip Himanshu (Jul 25 2022 at 17:13):

I used signal and slot macros since there are overloading functions.

view this post on Zulip Himanshu (Jul 25 2022 at 17:14):

Btw I added three buttons but from user's perspective there should be abort button or cancel?

view this post on Zulip Himanshu (Jul 25 2022 at 17:15):

Found here https://stackoverflow.com/questions/16794695/connecting-overloaded-signals-and-slots-in-qt-5

view this post on Zulip Himanshu (Jul 25 2022 at 17:16):

What I found that we can use static_cast and qOverload too.

view this post on Zulip Himanshu (Jul 25 2022 at 17:19):

But qOverload requires Qt 5.7

view this post on Zulip Daniel Rossberg (Jul 25 2022 at 17:24):

Or, you could give the save file functions different names.

view this post on Zulip Daniel Rossberg (Jul 25 2022 at 17:26):

Himanshu Sekhar Nayak said:

Btw I added three buttons but from user's perspective there should be abort button or cancel?

I would say "Cancel".

view this post on Zulip Himanshu (Jul 25 2022 at 17:27):

Daniel Rossberg said:

Or, you could give the save file functions different names.

Or we can use static_cast?

view this post on Zulip Daniel Rossberg (Jul 25 2022 at 17:30):

You can work around this with static_cast or avoid it with not using same function names. It's your choice.

view this post on Zulip Himanshu (Jul 26 2022 at 14:15):

Here is the new commit where I changed function names and added cancel instead of abort. https://github.com/BRL-CAD/arbalest/pull/23/commits/848d414236677926b378fcc9bdd9504b70fe112a

view this post on Zulip Himanshu (Jul 27 2022 at 17:48):

Opened a new issue where ray trace is able to function even if there is nothing in document.

view this post on Zulip Himanshu (Jul 27 2022 at 18:01):

https://github.com/BRL-CAD/arbalest/issues/27

view this post on Zulip Himanshu (Jul 31 2022 at 07:15):

@Daniel Rossberg Should we use ConstDatabase for sure? I saw it is for read-only. https://brlcad.org/wiki/BRL-CAD%27s_core_C%2B%2B_interface

view this post on Zulip Daniel Rossberg (Jul 31 2022 at 14:18):

? Where? Arbalest is for modifying databases too. However, MemoryDatabase is derived from Database, which is derived from ConstDatabase. I.e., if you want to return a database handle, where you can be sure that the receiver isn't able to modify it, you can declare it as ConstDatabase.

view this post on Zulip Himanshu (Jul 31 2022 at 14:21):

I made some progress by changing it to BRLCAD::ConstDatabase and still there are some conversion left to remove all errors reported during conversion.

view this post on Zulip Himanshu (Jul 31 2022 at 14:22):

During conversion, I visited back to the article and saw it is for read-only.

view this post on Zulip Himanshu (Jul 31 2022 at 14:22):

Anyways, I understood now.

view this post on Zulip Daniel Rossberg (Jul 31 2022 at 14:22):

You mean Document::getDatabase()?

view this post on Zulip Himanshu (Jul 31 2022 at 14:23):

yup

view this post on Zulip Daniel Rossberg (Jul 31 2022 at 14:25):

That should be possible: By changing the return type to ConstDatabase you make sure that the calling function cannot modify it.

view this post on Zulip Daniel Rossberg (Jul 31 2022 at 14:29):

It follows the usual const - non-const logic: If a function requires a const value, you can put in a non-const too, but not vice versa.

view this post on Zulip Himanshu (Jul 31 2022 at 15:02):

documents[activeDocumentId]->getDatabase()->Add(*object);

Since there is no Add() in ConstDatabase and also for Save. Should I add those to ConstDatabase class?

view this post on Zulip Daniel Rossberg (Jul 31 2022 at 15:22):

Definitely No! A const value cannot be modified. Didn't you know?

But, you can add an Add() and Save() method to the Documentclass, which take care for the modified flag.

view this post on Zulip Himanshu (Jul 31 2022 at 16:25):

Daniel Rossberg said:

Definitely No! A const value cannot be modified. Didn't you know?

But, you can add an Add() and Save() method to the Documentclass, which take care for the modified flag.

Okay I will add those to Document class.

view this post on Zulip Himanshu (Jul 31 2022 at 16:26):

We can add the LICENSE to the about window.

view this post on Zulip Daniel Rossberg (Jul 31 2022 at 16:27):

There is already a license statement in the about window, but it won't use the content of the LICENSE file (automatically).

view this post on Zulip Himanshu (Jul 31 2022 at 16:55):

Added license to aboutwindow.cpp https://github.com/BRL-CAD/arbalest/pull/28

view this post on Zulip Himanshu (Aug 02 2022 at 17:19):

@Daniel Rossberg Made some progress by adding Add and Save to Document and publicly inherited Database to Document because rt_wdb* m_wdbp; in Database is used in Add and Save. So moving Add and Save to Document to make sure it works.
But some of the problems that arises:

C++ object of abstract class type Document is not allowed: pure virtual function BRLCAD::Database::Load has no overrider

So looks like we have to override Load in Document.

  1. There are many primitives that reported like torus->Internal() is not accessible. Need a fix for that.

view this post on Zulip Daniel Rossberg (Aug 03 2022 at 17:44):

I'm not sure what you are doing there. The Document class has a member variable database which is a BRLCAD::Database.

view this post on Zulip Himanshu (Aug 03 2022 at 17:45):

Daniel Rossberg said:

I'm not sure what you are doing there. The Document class has a member variable database which is a BRLCAD::Database.

BRLCAD::MemoryDatabase *database; This one?

view this post on Zulip Himanshu (Aug 03 2022 at 17:46):

I added Add and Save to Document.

bool Add(const BRLCAD::Object& object);
bool Save(const char* fileName);

view this post on Zulip Daniel Rossberg (Aug 03 2022 at 17:48):

OK, that should be easy.

view this post on Zulip Himanshu (Aug 03 2022 at 17:49):

But Add throws errors related to m_wdbp is not defined. So I inherited BRLCAD::Database to Document so that it will be visible.

view this post on Zulip Daniel Rossberg (Aug 03 2022 at 17:50):

??? What's your code?

view this post on Zulip Daniel Rossberg (Aug 03 2022 at 17:51):

paste your Document::Add() method here

view this post on Zulip Himanshu (Aug 03 2022 at 17:53):

Daniel Rossberg said:

??? What's your code?

  1. Here is the Document.h and changes are in line 23, 93 and 94.
  2. Here is the Document.cpp

view this post on Zulip Daniel Rossberg (Aug 03 2022 at 17:55):

Well, why not

bool Document::Add(const BRLCAD::Object& object) {
    return database->Add(object);
}

?

view this post on Zulip Himanshu (Aug 03 2022 at 17:56):

Ahhh that's also good :frowning:

view this post on Zulip Himanshu (Aug 03 2022 at 17:56):

I am thinking too much

view this post on Zulip Daniel Rossberg (Aug 03 2022 at 17:57):

You see :grinning_face_with_smiling_eyes:

view this post on Zulip Daniel Rossberg (Aug 03 2022 at 17:58):

However, my code isn't perfect yet. Why?

view this post on Zulip Daniel Rossberg (Aug 03 2022 at 17:58):

However, probably good enough.

view this post on Zulip Himanshu (Aug 03 2022 at 18:12):

Daniel Rossberg said:

However, my code isn't perfect yet. Why?

Okay I added those what you have suggested. May be database is here of MemoryDatabase and we need type of ConstDatabase to make sure calling function do not modify it?

view this post on Zulip Daniel Rossberg (Aug 04 2022 at 16:38):

No, that's not it. Add() modifies the database. That's its purpose. ConstDatabase cannot have an add.

The reason for my doubt was that the code doesn't contain a check for NULL. But, Document won't work without a correct initialized database member. I.e., with a NULL database we won't get so far to call Add().

However, you should set the modified flag there, if you have it.

view this post on Zulip Himanshu (Aug 05 2022 at 13:22):

Opened a new issue https://github.com/BRL-CAD/arbalest/issues/29

view this post on Zulip Himanshu (Aug 05 2022 at 15:41):

closed the issue since this is from other branch.

view this post on Zulip Himanshu (Aug 05 2022 at 20:00):

@Daniel Rossberg Here is the complete PR and also I have added new function saveFileId and tested all edge cases to make sure it works without breaking the program. You can test the PR now to see if any other changes are required to add.

view this post on Zulip Himanshu (Aug 05 2022 at 20:09):

Also I made sure that saveFile() should not save file unnecessarily if there is no modification in the document and tested it too.

view this post on Zulip Himanshu (Aug 06 2022 at 17:26):

Opened two new issues during debugging that I saw. https://github.com/BRL-CAD/arbalest/issues/31, https://github.com/BRL-CAD/arbalest/issues/30

view this post on Zulip Himanshu (Aug 06 2022 at 17:27):

One thing that I missed is that we have implemented maybeSave() for application close and we missed for if a document is going to close then it should also for unsaved changes.

view this post on Zulip Himanshu (Aug 06 2022 at 17:38):

And what buttons we should expect for one single document if there are any unsaved changes and going to be closed? Like Save, Discard or Don't Save and Cancel.

view this post on Zulip Himanshu (Aug 06 2022 at 19:39):

Pushed a new commit where it checks if there is any object in the document before it start to ray trace.

view this post on Zulip Himanshu (Aug 09 2022 at 17:24):

@Daniel Rossberg Changing assert(alreadyThere == true); to assert(!alreadyThere); doesn't throw error and works fine while changing the properties of Arb8.

view this post on Zulip Himanshu (Aug 09 2022 at 17:26):

This issue https://github.com/BRL-CAD/arbalest/issues/26

view this post on Zulip Daniel Rossberg (Aug 09 2022 at 17:35):

Where did you found the assert(alreadyThere == true);? However, this doesn't look right. For me, the issue looks like something which should be catched in the GUI.

view this post on Zulip Himanshu (Aug 09 2022 at 17:36):

Daniel Rossberg said:

Where did you found the assert(alreadyThere == true);? However, this doesn't look right. For me, the issue looks like something which should be catched in the GUI.

In rt-cubed/src/coreInterface/Arb8.cpp line number 335

view this post on Zulip Daniel Rossberg (Aug 09 2022 at 17:38):

Are you sure? https://github.com/BRL-CAD/rt-cubed/blob/main/src/coreInterface/Arb8.cpp#L335

view this post on Zulip Himanshu (Aug 09 2022 at 17:42):

Mine is showing assert(alreadyThere == true);

view this post on Zulip Daniel Rossberg (Aug 09 2022 at 17:43):

Revert your change?

view this post on Zulip Himanshu (Aug 09 2022 at 17:43):

Screenshot-76.png

view this post on Zulip Daniel Rossberg (Aug 09 2022 at 17:45):

Well, if it is different from GitHub, somebody must have changed it locally on your computer...

view this post on Zulip Himanshu (Aug 09 2022 at 17:46):

We found this error while I was sharing my screen with you.

view this post on Zulip Himanshu (Aug 09 2022 at 17:47):

May be my fault but idk.

view this post on Zulip Daniel Rossberg (Aug 09 2022 at 17:48):

You should ask git about what it knows about this file.

view this post on Zulip Himanshu (Aug 09 2022 at 17:49):

I restored the file now.

view this post on Zulip Himanshu (Aug 09 2022 at 20:11):

Made some changes to the quit message box https://github.com/BRL-CAD/arbalest/pull/23/commits/ae730b8b53e84a6274793779561bb36a1a698a15

view this post on Zulip Sean (Aug 09 2022 at 20:49):

Huge progress @Himanshu Sekhar Nayak, loving it! Could you maybe capture a 1min video showcasing some of the changes you worked on since starting? Even if it's just you clicking around (with or without audio), I think it'd be really helpful to see the current state of the interface from your hands.

view this post on Zulip Himanshu (Aug 09 2022 at 22:37):

Sure. I will do it in today's morning.

view this post on Zulip Himanshu (Aug 10 2022 at 15:33):

@Daniel Rossberg @Sean Feature.mp4 Hope you will like it. :sweat_smile:

view this post on Zulip Himanshu (Aug 12 2022 at 17:02):

@Daniel Rossberg I am thinking to refactor maybeSave () so that tabCloseRequested() can also pass documentId to maybeSave()

view this post on Zulip Daniel Rossberg (Aug 12 2022 at 17:06):

Regarding more mouse actions, here an idea: This can be handled by moving the event filter stuff (see MainWindow::eventFilter()) in an own class hierarchy. I.e. having a base class for all the actions

class MouseAction : public QObject {
    Q_OBJECT
public:
    virtual ~MouseAction(void);

signals:
    void Done(MouseAction* myself);

protected:
    QObject* m_watched;

    MouseAction(QObject* watched,
                ...);
    virtual bool QObject::eventFilter(QObject *watched,
                                      QEvent  *event);

private slots:
    void WatchedDestroyed(QObject* watched);
};

and derive the specific actions from it

class ZoomInMouseAction : public MouseAction {};
class ZoomOutMouseAction : public MouseAction {};
class RotateMouseAction : public MouseAction {};
class MoveMouseAction : public MouseAction {};
...

They have to be instantiated if the corresponding button was pressed

MainWindow::MainWindow() : m_mouseAction(0) {}

void MainWindow::XButtonAction(void) {
    if (m_mouseAction != nullptr)
        delete m_mouseAction;

    m_mouseAction = new XMouseAction();
    installEventFilter(m_mouseAction);
}

(All code here has to be considered as pseudo-code. All names are arbitrary.)

view this post on Zulip Daniel Rossberg (Aug 12 2022 at 17:09):

Himanshu Sekhar Nayak said:

Daniel Rossberg I am thinking to refactor maybeSave () so that tabCloseRequested() can also pass documentId to maybeSave()

Yep, this sounds good.

view this post on Zulip Himanshu (Aug 12 2022 at 17:26):

I am taking day off for tomorrow and will start working from Sunday.

view this post on Zulip Himanshu (Aug 15 2022 at 17:15):

@Daniel Rossberg Added default parameter cancel to maybeSave(). Also I have added blue color to the heading of the dialog box text. See if you like it. Capture.PNG

view this post on Zulip Himanshu (Aug 17 2022 at 18:06):

@Daniel Rossberg changing BRLCAD::MemoryDatabase to BRLCAD::ConstDatabase have some points that I have noted which are:

  1. Since there are two overloads for getBRLCADObject() in Utils.h so I have modified to only 2 args:
    Previously
inline void getBRLCADObject(BRLCAD::MemoryDatabase *database, const QString& objectName,const std::function<void(BRLCAD::Object&)>& func){
    BRLCADObjectCallback callback(func);
    database->Get(objectName.toUtf8(), callback);
}

Now

inline void getBRLCADObject(BRLCAD::ConstDatabase *database, const QString& objectName){
    database->Get(objectName.toUtf8());
}

Since class BRLCADObjectCallback inherits BRLCAD::Database::ObjectCallback where virtual void operator()(const Object& object) = 0; it is a pure virtual function and it has been override in class BRLCADObjectCallback. But what I have changed works with no more errors. Only problem is that to keep const std::function<void(BRLCAD::Object&)>& func or not but I saw it has been used as lambda function.

view this post on Zulip Daniel Rossberg (Aug 18 2022 at 08:23):

Well, this call-back function isbthe whole point on getBRLCADObject(). You version does nothing now. How about moving the getBRLCADObject() to the Document class and setting the modified flag there?

view this post on Zulip Himanshu (Aug 19 2022 at 19:22):

@Daniel Rossberg Moved getBRLCADObject() inside Document class and the problem is that database->Get() not accepting BRLCADObjectCallback object because it inherits BRLCAD::Database::ObjectCallback. So I modified to BRLCAD::ConstDatabase::ObjectCallback and override the () operator where the arg for () is const BRLCAD::Object& object. Now it accepts but main problem is:

    inline explicit BRLCADObjectCallback(std::function<void(BRLCAD::Object&)> func): func(std::move(func)){}

So I added const here too and also where it is declared privately. But now it is leading to more const errors.

Severity    Code    Description Project File    Line    Suppression State
Error   C2664   'void getBRLCADObject(BRLCAD::ConstDatabase *,const QString &,std::function<void (const BRLCAD::Object &)> &)': cannot convert argument 3 from 'TypeSpecificProperties::{ctor}::<lambda_ea01135dc03223a24fd587b78eff7e6e>::()::<lambda_26663c7c4cc71b05277346cda6946773>' to 'std::function<void (const BRLCAD::Object &)> &'   arbalest    C:\Users\Himanshu\Desktop\Workspace\rt-cubed\src\arbalest\src\gui\TypeSpecificProperties.cpp    61

I will dig more tomorrow.

view this post on Zulip Daniel Rossberg (Aug 23 2022 at 17:06):

Hmm, at first glance, it doesn't look good. Why doesn't database->Get() accept a BRLCAD::Database::ObjectCallback object?

view this post on Zulip Daniel Rossberg (Aug 23 2022 at 17:11):

This is exactly what we have in Utils.h, line 55 - 58.

view this post on Zulip Himanshu (Aug 24 2022 at 17:05):

Daniel Rossberg said:

Hmm, at first glance, it doesn't look good. Why doesn't database->Get() accept a BRLCAD::Database::ObjectCallback object?

It was accepting but when I changed to ConstDatabase for getDatabase() then the problem occurs.

view this post on Zulip Himanshu (Aug 24 2022 at 17:06):

So I modified to ConstDatabase from MemoryDatabase in getBRLCADObject()

view this post on Zulip Himanshu (Aug 24 2022 at 17:12):

Then database->Get(objectName.toUtf8(), callback); didn't work for ConstDatabase.

view this post on Zulip Daniel Rossberg (Aug 24 2022 at 17:17):

Himanshu Sekhar Nayak said:

Daniel Rossberg said:

Hmm, at first glance, it doesn't look good. Why doesn't database->Get() accept a BRLCAD::Database::ObjectCallback object?

It was accepting but when I changed to ConstDatabase for getDatabase() then the problem occurs.

??? Can you please show me your code?

view this post on Zulip Himanshu (Aug 24 2022 at 17:18):

  1. Document.h
    BRLCAD::ConstDatabase* getDatabase() const
    {
        return database;
    }
  1. Utils.h
inline void getBRLCADObject(BRLCAD::ConstDatabase *database, const QString& objectName,const std::function<void(BRLCAD::Object&)>& func){
    BRLCADObjectCallback callback(func);
    database->Get(objectName.toUtf8(), callback);
}

view this post on Zulip Daniel Rossberg (Aug 24 2022 at 17:20):

Didn't you want to move getBRLCADObject() to the Document class?

view this post on Zulip Himanshu (Aug 24 2022 at 17:20):

I have shifted but still same issue.

view this post on Zulip Daniel Rossberg (Aug 24 2022 at 17:21):

That's the point: You have not. There is no Document::getBRLCADObject() method.

view this post on Zulip Himanshu (Aug 24 2022 at 17:25):

Working on it.

view this post on Zulip Himanshu (Aug 24 2022 at 17:28):

@Daniel Rossberg In TypeSpecificProperties.cpp we can see in line 60-69:

connect(hasColorCheck,&QCheckBox::stateChanged,[this,objectId](int newState){
            getBRLCADObject(this->document.getDatabase(),this->document.getObjectTree()->getFullPathMap()[objectId],[newState](BRLCAD::Object &object){
                if(newState == Qt::CheckState::Checked){
                    dynamic_cast<BRLCAD::Combination&>(object).SetHasColor(true);
                }
                else {
                    dynamic_cast<BRLCAD::Combination&>(object).SetHasColor(false);
                }
            });
        });

view this post on Zulip Himanshu (Aug 24 2022 at 17:31):

but how we are going to instantiate a Document class to access getBRLCADObject in lambda function and document class has no default constructor?

view this post on Zulip Himanshu (Aug 24 2022 at 17:33):

oops

view this post on Zulip Himanshu (Aug 24 2022 at 17:33):

I found that

view this post on Zulip Himanshu (Aug 24 2022 at 17:34):

We need to capture document object in a capture list so that it can access getBRLCADObject

view this post on Zulip Daniel Rossberg (Aug 24 2022 at 17:38):

void Document::getBRLCADObject(const QString& objectName,const std::function<void(BRLCAD::Object&)>& func) {
    BRLCADObjectCallback callback(func);
    database->Get(objectName.toUtf8(), callback);
    modified = true;
}

and

connect(hasColorCheck,&QCheckBox::stateChanged,[this,objectId](int newState){
            this->document.getBRLCADObject(this->document.getObjectTree()->getFullPathMap()[objectId],[newState](BRLCAD::Object &object){
                if(newState == Qt::CheckState::Checked){
                    dynamic_cast<BRLCAD::Combination&>(object).SetHasColor(true);
                }
                else {
                    dynamic_cast<BRLCAD::Combination&>(object).SetHasColor(false);
                }
            });
        });

view this post on Zulip Himanshu (Aug 24 2022 at 17:41):

Here is a patch Changes-On-3068ee.patch

view this post on Zulip Himanshu (Aug 24 2022 at 17:42):

Himanshu Sekhar Nayak said:

We need to capture document object in a capture list so that it can access getBRLCADObject

Noob here and how on earth I am not able to see there is already a document object. :grimacing:

view this post on Zulip Himanshu (Aug 24 2022 at 17:46):

Okay modified to ConstDatabase that I have forgot.

view this post on Zulip Himanshu (Aug 24 2022 at 17:46):

Changes-On-3068ee.patch

view this post on Zulip Daniel Rossberg (Aug 24 2022 at 17:47):

Okay. Doers it work? Can you add this to your PR #23?

view this post on Zulip Himanshu (Aug 24 2022 at 17:49):

Daniel Rossberg said:

Okay. Doers it work? Can you add this to your PR #23?

Nope. I am still getting error for database->Get()

view this post on Zulip Himanshu (Aug 24 2022 at 17:50):

Severity Code Description Project File Line Suppression State
Error C2665 'BRLCAD::ConstDatabase::Get': none of the 2 overloads could convert all the argument types arbalest C:\Users\Himanshu\Desktop\Workspace\rt-cubed\src\arbalest\src\Document.cpp 90

view this post on Zulip Himanshu (Aug 24 2022 at 17:55):

Get() not accepting callback of BRLCADObjectCallback even if it inherits from BRLCAD::Database::ObjectCallback

view this post on Zulip Himanshu (Aug 24 2022 at 17:57):

Should we modify it to BRLCAD::ConstDatabase::ObjectCallback and override

inline void operator()(const BRLCAD::Object& object) override {
        func(object);
    }

view this post on Zulip Daniel Rossberg (Aug 24 2022 at 18:04):

No, we need the BRLCAD::Database::ObjectCallback. Only this can modify the object. However, did you noticed the modified = true; in my code example?

view this post on Zulip Himanshu (Aug 24 2022 at 18:05):

Daniel Rossberg said:

No, we need the BRLCAD::Database::ObjectCallback. Only this can modify the object. However, did you noticed the modified = true; in my code example?

Yes, saw now.

view this post on Zulip Himanshu (Aug 25 2022 at 15:57):

@Daniel Rossberg Added new commit https://github.com/BRL-CAD/arbalest/pull/23/commits/cbd3b5c57b62c0840a140a2cd8505fe0b0d3c568

view this post on Zulip Himanshu (Aug 25 2022 at 17:09):

Completed https://github.com/BRL-CAD/arbalest/pull/23 you can check

view this post on Zulip Himanshu (Aug 26 2022 at 14:43):

@Daniel Rossberg Do we need this line anymore? Line 77 src/gui/MatrixTransformWidget.cpp

document->modifyObjectNoSet(document->getObjectTree()->getParent()[childObjectId]);

view this post on Zulip Himanshu (Aug 26 2022 at 14:44):

I removed this line after removing modifyObjectNoSet().

view this post on Zulip Daniel Rossberg (Aug 26 2022 at 15:06):

Yes and no. The purpose of this function is to mark objects as changed for redrawing (geometryRenderer). This should however done more automatically whenever modified = true is set.

view this post on Zulip Himanshu (Aug 26 2022 at 15:12):

So this function redraws geometryRenderer

view this post on Zulip Daniel Rossberg (Aug 26 2022 at 15:14):

No. Who redraws?

view this post on Zulip Himanshu (Aug 26 2022 at 15:15):

geometryRenderer->refreshForVisibilityAndSolidChanges(); this one

view this post on Zulip Himanshu (Aug 26 2022 at 15:17):

This function works if the user selected relative scale or move or rotate and then it refresh the screen with new ones?

view this post on Zulip Daniel Rossberg (Aug 26 2022 at 15:19):

Well, somehow the geometryRenderer instance :wink:
It gets the changed objects known (geometryRenderer->clearObject(objectId)) and does a refresh at the end (geometryRenderer->refreshForVisibilityAndSolidChanges()).

view this post on Zulip Himanshu (Aug 26 2022 at 15:34):

I have added a base class to start with mouse action and will add more mouse action derived classes. Meanwhile, I also found two issues which leads to crash of program.

view this post on Zulip Himanshu (Aug 26 2022 at 15:35):

BTW, we can't have object names empty. right?

view this post on Zulip Himanshu (Aug 26 2022 at 15:35):

this things crash the program

view this post on Zulip Himanshu (Aug 26 2022 at 15:45):

We can have a check if the user press ok and with string and then proceed otherwise if the user press cancel then no need to proceed. Otherwise this problem crash the program.

view this post on Zulip Daniel Rossberg (Aug 26 2022 at 15:52):

Just checking the C++ interface. One point is that every object has a IsValid() method. This should check the name as well, but does it for a few types only :thinking:

view this post on Zulip Daniel Rossberg (Aug 26 2022 at 15:53):

BTW, where does it crash?

view this post on Zulip Himanshu (Aug 26 2022 at 15:58):

Daniel Rossberg said:

BTW, where does it crash?

Do not provide any name to the object of any primitive and in Object dock you can see there is a object with no name and try to click on it which leads to crash of the program.

view this post on Zulip Daniel Rossberg (Aug 26 2022 at 16:02):

That's the "how to reproduce". But it was helpful too. The "where" is src/gui/Properties.cpp:33. object is probably invalid.

view this post on Zulip Himanshu (Aug 26 2022 at 16:22):

Daniel Rossberg said:

Just checking the C++ interface. One point is that every object has a IsValid() method. This should check the name as well, but does it for a few types only :thinking:

I can't find IsValid() in arbalest.

view this post on Zulip Daniel Rossberg (Aug 26 2022 at 16:27):

It's not used there. It is a method of BRLCAD::Object, which checks if the object is okay.

view this post on Zulip Himanshu (Aug 26 2022 at 16:46):

This one virtual bool IsValid(void) const = 0; inside Object.h.

view this post on Zulip Daniel Rossberg (Aug 26 2022 at 16:47):

Yes. It's implemented in the derived classes.

view this post on Zulip Himanshu (Aug 26 2022 at 16:47):

Daniel Rossberg said:

Yes. It's implemented in the derived classes.

For every primitive right?

view this post on Zulip Himanshu (Aug 26 2022 at 16:51):

/me going for dinner now

view this post on Zulip Daniel Rossberg (Aug 26 2022 at 16:52):

Well, now: yes. But wasn't before.

view this post on Zulip Himanshu (Aug 27 2022 at 15:23):

@Daniel Rossberg I am thinking to do implement something like this.

bool ok;
QString name = QInputDialog::getText(this,tr("Object Name"), tr("Enter object name"), QLineEdit::Normal, "", &ok);
if (ok && !name.isEmpty()) {
    object->SetName(name.toUtf8());
}
else {
    return;
}

view this post on Zulip Daniel Rossberg (Aug 29 2022 at 15:28):

Hmm, without any feedback to the user?

QInputDialog::getText() is used 11 times in MainWindow. I.e., you should think about writing a function for it. How shall this function look like? It needs somehow two results: The new name and a flag if "Cancel" was hit. In this case, no primitive should be created.

view this post on Zulip Himanshu (Aug 29 2022 at 16:11):

Daniel Rossberg said:

Hmm, without any feedback to the user?

QInputDialog::getText() is used 11 times in MainWindow. I.e., you should think about writing a function for it. How shall this function look like? It needs somehow two results: The new name and a flag if "Cancel" was hit. In this case, no primitive should be created.

So what I have thought like is that ....

  1. To create a function inside document class so that it will help primitives to check object names.
  2. If the user press ok without giving names then it should prompt to enter name.

view this post on Zulip Daniel Rossberg (Aug 29 2022 at 16:37):

You may need this function at other places too, e.g. to change an object name. Therefore, putting it at Utils?

view this post on Zulip Himanshu (Aug 30 2022 at 16:00):

@Daniel Rossberg Changes-On-0e7832.patch I have done something like this but I have not added feedback to the user.

view this post on Zulip Himanshu (Aug 30 2022 at 16:01):

Prompt a messagebox to the user?

view this post on Zulip Daniel Rossberg (Aug 30 2022 at 17:25):

Something like: If Cancel was pressed, then isValidObjectName() returns false. If name is invalid, show a message box and run QInputDialog::getText() again.

BTW, isValidObjectName() is a bad function name, because it doesn't describe what this function does. getObjectNameFromUser() would be better.

view this post on Zulip Himanshu (Aug 31 2022 at 05:32):

Here is the pr: https://github.com/BRL-CAD/arbalest/pull/36 @Daniel Rossberg

view this post on Zulip Himanshu (Sep 01 2022 at 15:27):

https://github.com/BRL-CAD/arbalest/issues/35 BTW, different primitives having same name is not a good idea, I think?

view this post on Zulip Daniel Rossberg (Sep 01 2022 at 16:30):

That's right. The objects are uniquely referenced by their names.

view this post on Zulip Himanshu (Sep 01 2022 at 16:32):

Daniel Rossberg said:

That's right. The objects are uniquely referenced by their names.

Then I should leave it as it is.

view this post on Zulip Daniel Rossberg (Sep 01 2022 at 16:34):

Or, the check for correct object names needs an additional criterion.

view this post on Zulip Himanshu (Sep 01 2022 at 16:35):

Daniel Rossberg said:

Or, the check for correct object names needs an additional criterion.

Hmm good :idea:.

view this post on Zulip Himanshu (Sep 01 2022 at 16:36):

Check if there exist an object name already then re-prompt to enter a new object name apart from previous one.

view this post on Zulip Daniel Rossberg (Sep 01 2022 at 16:42):

The ConstDatabase::Get() searches for an object with a given name. If it found something, the call-back will be called.

view this post on Zulip Himanshu (Sep 01 2022 at 16:49):

Daniel Rossberg said:

The ConstDatabase::Get() searches for an object with a given name. If it found something, the call-back will be called.

Hmm saw now. Get() accepts objectName.

view this post on Zulip Himanshu (Sep 05 2022 at 21:50):

@Daniel Rossberg Here is a patch that I have worked on for prompting a message box if an object is already present. But strange that I have to do forward declarations for some class to make it work. Changes-On-5af3e2.patch

view this post on Zulip Himanshu (Sep 05 2022 at 21:51):

I will start now with mouse functionality.

view this post on Zulip Daniel Rossberg (Sep 06 2022 at 16:54):

Himanshu Sekhar Nayak said:

Daniel Rossberg Here is a patch that I have worked on for prompting a message box if an object is already present. But strange that I have to do forward declarations for some class to make it work. Changes-On-5af3e2.patch

Hmm, the "else if" can be true even if cancel was hitted (!ok). You should test for cancel first (if (!ok) break;) and do the other tests after.

view this post on Zulip Himanshu (Sep 07 2022 at 15:42):

@Daniel Rossberg Changes-On-5af3e2.patch Here is the patch.

view this post on Zulip Himanshu (Sep 08 2022 at 01:46):

Here is the better one Changes-On-5af3e2.patch

view this post on Zulip Daniel Rossberg (Sep 08 2022 at 17:18):

What was the base for this patch? I get errors when trying to apply it to the main repository master version.

view this post on Zulip Himanshu (Sep 08 2022 at 17:19):

Daniel Rossberg said:

What was the base for this patch? I get errors when trying to apply it to the main repository master version.

This one 5af3e220900988671c4f4f8d66c2ac5ab88ff1b6

view this post on Zulip Himanshu (Sep 08 2022 at 17:20):

This id is from fixEmptyObjectName branch

view this post on Zulip Daniel Rossberg (Sep 08 2022 at 17:21):

Okay, I'll check this PR first.

view this post on Zulip Daniel Rossberg (Sep 08 2022 at 17:22):

Ahh, I see...

view this post on Zulip Himanshu (Sep 08 2022 at 17:23):

:thinking:

view this post on Zulip Daniel Rossberg (Sep 08 2022 at 17:24):

I think, you can add your patch to this PR.

view this post on Zulip Himanshu (Sep 08 2022 at 17:26):

okay, I will send a commit now.

view this post on Zulip Daniel Rossberg (Sep 08 2022 at 17:28):

Got it :smile:

view this post on Zulip Himanshu (Sep 08 2022 at 17:29):

Done :cowboy:

view this post on Zulip Himanshu (Sep 08 2022 at 17:30):

BTW, yesterday I started implementing mouse actions feature.

view this post on Zulip Himanshu (Sep 08 2022 at 17:31):

For now I have came across one derived class DragWindowMouseAction

view this post on Zulip Himanshu (Sep 08 2022 at 17:32):

This class can override the eventFilter() of MouseAction which defines if we drag the menu bar or title bar then the window should move.

view this post on Zulip Himanshu (Sep 08 2022 at 17:33):

First virtual bool QObject::eventFilter(QObject* watched, QEvent* event) = 0; I should make it pure virtual then override in derived class.

view this post on Zulip Himanshu (Sep 08 2022 at 17:34):

If we look into definition of eventFilter()

bool MainWindow::eventFilter(QObject *watched, QEvent *event)
{
    static QPoint dragPosition{};
    if (watched == menuTitleBar)
    {
        if (event->type() == QEvent::MouseButtonPress)
        {
            QMouseEvent* mouse_event = dynamic_cast<QMouseEvent*>(event);
            if (mouse_event->button() == Qt::LeftButton)
            {
                dragPosition = mouse_event->globalPos() - frameGeometry().topLeft();
                return false;
            }
        }
        else if (event->type() == QEvent::MouseMove)
        {
            QMouseEvent* mouse_event = dynamic_cast<QMouseEvent*>(event);
            if (mouse_event->buttons() & Qt::LeftButton)
            {
                if(isMaximized()) return false;//showNormal();
                //todo showNormal when dragged
                move(mouse_event->globalPos() - dragPosition);
                return false;
            }
        }
    }
    return false;
}

view this post on Zulip Himanshu (Sep 08 2022 at 17:35):

Here is a variable menuTitleBar which is part of MainWindow.h

view this post on Zulip Daniel Rossberg (Sep 08 2022 at 17:36):

You could make MouseAction::eventFilter() pure virtual, but not QObject::eventFilter(). However, it isn't necessary.

view this post on Zulip Himanshu (Sep 08 2022 at 17:37):

oops

view this post on Zulip Himanshu (Sep 08 2022 at 17:38):

I forgot to add MouseAction::eventFilter()

view this post on Zulip Daniel Rossberg (Sep 08 2022 at 17:38):

At the end, DragWindowMouseAction::eventFilter() should become what MainWindow::eventFilter() is now.

view this post on Zulip Himanshu (Sep 08 2022 at 17:39):

So what we should prefer? MouseAction::eventFilter() or QObject::eventFilter()?

view this post on Zulip Daniel Rossberg (Sep 08 2022 at 17:42):

You should not touch QObject::eventFilter(), but MouseAction is derived from QObject and its eventFilter() method overwrites the one of QObject.

view this post on Zulip Himanshu (Sep 08 2022 at 17:43):

Ahh, I understand now :grinning:

view this post on Zulip Himanshu (Sep 08 2022 at 17:44):

I am on that path. Started implementing the DragWindowMouseAction::eventFilter()

view this post on Zulip Himanshu (Sep 08 2022 at 17:46):

Btw, how DragWindowMouseAction::eventFilter() will access menuTitleBar? Inherit MainWindow?

view this post on Zulip Daniel Rossberg (Sep 08 2022 at 17:50):

If this class needs additional information, you can add them to its constructor.

view this post on Zulip Himanshu (Sep 08 2022 at 17:56):

Ahh, yes, there is a cycle.

view this post on Zulip Daniel Rossberg (Sep 08 2022 at 17:56):

PR #36 looks good, but I want to have another quiet think about it.

view this post on Zulip Himanshu (Sep 08 2022 at 17:57):

In meantime, I will primarily focus on the mouse feature now. Will do #36 if anything more needed.

view this post on Zulip Himanshu (Sep 09 2022 at 19:00):

@Daniel Rossberg Updated https://github.com/BRL-CAD/arbalest/pull/36

view this post on Zulip Himanshu (Sep 09 2022 at 19:00):

removed header file cycle inclusion and conditional operator

view this post on Zulip Himanshu (Sep 15 2022 at 11:39):

Here is a patch for the drag window mouse action Changes-On-d8477a.patch

view this post on Zulip Himanshu (Sep 15 2022 at 11:40):

But I can't figure out the about the slot which will call the signal. Like what would be the definition of the slot WatchedDestroyed()

view this post on Zulip Himanshu (Sep 15 2022 at 15:58):

Oops I missed menuTitleBar->installEventFilter(m_mouseAction); inside DragWindowButtonAction()

view this post on Zulip Daniel Rossberg (Sep 15 2022 at 16:54):

Himanshu Sekhar Nayak said:

Here is a patch for the drag window mouse action Changes-On-d8477a.patch

Is there a reason why you don't do this on github?

view this post on Zulip Daniel Rossberg (Sep 15 2022 at 17:04):

What's the purpose of MainWindow::DragWindowButtonAction()? See, I proposed a Done() signal for the mouse actions. This allows to switch back to a default action when something was done. E.g., suppose there is an object selection action. When activated, you can click on an object, and the action returns its path - and emits "Done". You can react on this signal by switching back to the default drag mouse action.

view this post on Zulip Himanshu (Sep 15 2022 at 17:31):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

Here is a patch for the drag window mouse action Changes-On-d8477a.patch

Is there a reason why you don't do this on github?

I thought to make the PR clean and neat. Okay from next time I will do that.

view this post on Zulip Himanshu (Sep 18 2022 at 03:13):

@Daniel Rossberg Added DragWindowMouseAction class https://github.com/BRL-CAD/arbalest/pull/33/commits/0ac9e7f1d4fe64883afce0679bff3e6d85e1d905

view this post on Zulip Himanshu (Sep 21 2022 at 04:11):

Resolved @Daniel Rossberg https://github.com/BRL-CAD/arbalest/pull/33/commits/1bbfdb2971e0c30ca5cee16fed8cbcae411de387

view this post on Zulip Sean (Sep 22 2022 at 21:17):

Hey @Himanshu Sekhar Nayak I just compiled up the latest sources to test things out and am getting a crash on Mac -- have you seen this?

view this post on Zulip Sean (Sep 22 2022 at 21:18):

Process:               arbalest [70465]
Path:                  /Users/USER/*/arbalest
Identifier:            arbalest
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        zsh [41634]
Responsible:           Terminal [580]
User ID:               501

Date/Time:             2022-09-22 17:13:35.659 -0400
OS Version:            macOS 11.7 (20G817)
Report Version:        12
Anonymous UUID:        4FB272B2-CD88-8DB1-34BA-D8168CF2DAA1


Time Awake Since Boot: 77000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000560
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [70465]

VM Regions Near 0x560:
-->
    __TEXT                      10db60000-10dc10000    [  704K] r-x/r-x SM=COW  /Users/*

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libGL.dylib                     0x00007fff6beee245 glMaterialfv + 20
1   arbalest                        0x000000010dba6e1f DisplayManager::setFGColor(float, float, float, float) + 367
2   arbalest                        0x000000010dba6c97 DisplayManager::DisplayManager(Display&) + 119
3   arbalest                        0x000000010dba6e7d DisplayManager::DisplayManager(Display&) + 29
4   arbalest                        0x000000010dba4207 Display::Display(Document*) + 263
5   arbalest                        0x000000010dba447d Display::Display(Document*) + 29
6   arbalest                        0x000000010dbdc227 DisplayGrid::DisplayGrid(Document*) + 519
7   arbalest                        0x000000010dbdc8fd DisplayGrid::DisplayGrid(Document*) + 29
8   arbalest                        0x000000010db84490 Document::Document(int, QString const*) + 720
9   arbalest                        0x000000010db845d3 Document::Document(int, QString const*) + 35
10  arbalest                        0x000000010db6cbf6 MainWindow::openFile(QString const&) + 102
11  arbalest                        0x000000010db6da32 MainWindow::openFileDialog() + 210
12  arbalest                        0x000000010db7739b QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (MainWindow::*)()>::call(void (MainWindow::*)(), MainWindow*, void**) + 123
13  arbalest                        0x000000010db772dd void QtPrivate::FunctionPointer<void (MainWindow::*)()>::call<QtPrivate::List<>, void>(void (MainWindow::*)(), MainWindow*, void**) + 77
14  arbalest                        0x000000010db771d2 QtPrivate::QSlotObject<void (MainWindow::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) + 146
15  org.qt-project.QtCore           0x000000010eaf88a4 0x10e8e1000 + 2193572
16  org.qt-project.QtWidgets        0x000000010dd617d6 QAction::activate(QAction::ActionEvent) + 310
17  org.qt-project.QtCore           0x000000010eaf0c19 QObject::event(QEvent*) + 745
18  org.qt-project.QtWidgets        0x000000010dd6ada6 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 262
19  org.qt-project.QtWidgets        0x000000010dd6c160 QApplication::notify(QObject*, QEvent*) + 480
20  org.qt-project.QtCore           0x000000010eac7ff7 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 167
21  org.qt-project.QtCore           0x000000010eac9108 QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 792
22  libqcocoa.dylib                 0x0000000113c8a698 0x113c4f000 + 243352
23  libqcocoa.dylib                 0x0000000113c8adb8 0x113c4f000 + 245176
24  com.apple.CoreFoundation        0x00007fff208d5d2c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
25  com.apple.CoreFoundation        0x00007fff208d5c94 __CFRunLoopDoSource0 + 180
26  com.apple.CoreFoundation        0x00007fff208d5a14 __CFRunLoopDoSources0 + 242
27  com.apple.CoreFoundation        0x00007fff208d443c __CFRunLoopRun + 893
28  com.apple.CoreFoundation        0x00007fff208d39fc CFRunLoopRunSpecific + 563
29  com.apple.HIToolbox             0x00007fff28b1d1f3 RunCurrentEventLoopInMode + 292
30  com.apple.HIToolbox             0x00007fff28b1ce26 ReceiveNextEventCommon + 284
31  com.apple.HIToolbox             0x00007fff28b1ccf3 _BlockUntilNextEventMatchingListInModeWithFilter + 70
32  com.apple.AppKit                0x00007fff230dcb12 _DPSNextEvent + 864
33  com.apple.AppKit                0x00007fff230db2e5 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364
34  com.apple.AppKit                0x00007fff230cd609 -[NSApplication run] + 586
35  libqcocoa.dylib                 0x0000000113c89a6a 0x113c4f000 + 240234
36  org.qt-project.QtCore           0x000000010eac45e7 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 471
37  org.qt-project.QtCore           0x000000010eac8592 QCoreApplication::exec() + 130
38  arbalest                        0x000000010db82afa main + 90
39  libdyld.dylib                   0x00007fff207f8f3d start + 1

view this post on Zulip Sean (Sep 22 2022 at 21:20):

Basically it's crashing if I open an existing .g file. This is not on any specific branch, and probably isn't related to anything anyone has done recently. Seems to be OpenGL-related, not the right data it's expecting?

view this post on Zulip Sean (Sep 22 2022 at 21:20):

tried a variety of .g files, seems consistent

view this post on Zulip Himanshu (Sep 23 2022 at 09:58):

@Sean Mine working fine in windows. Not sure why it is failing in mac. Looks like a segmentation fault issue.

view this post on Zulip Himanshu (Sep 23 2022 at 12:00):

@Daniel Rossberg Updated https://github.com/BRL-CAD/arbalest/pull/33/commits/2fa6a37a1315c4bf8c2b6d62a02477f7c8fba879

view this post on Zulip Himanshu (Sep 23 2022 at 15:13):

@Sean I opened three .g files found in rt-cubed/src/arbalest/extra/db and it opens fine.

view this post on Zulip Himanshu (Sep 23 2022 at 15:13):

I opened these three and I am able to view it toogoliath.g m35.g moss.g

view this post on Zulip Himanshu (Sep 23 2022 at 15:22):

Also I am able to open other .g files from brlcad share/db

view this post on Zulip Sean (Sep 23 2022 at 15:35):

@Himanshu Sekhar Nayak thanks for checking -- looking at the stack trace, I'd guess it's a piece of invalid data that is being ignored on linux/windows, but mac opengl driver does not like. that 0x0000000580 looks like data. I'm going to try stepping in the debugger to see which param that is.

view this post on Zulip Sean (Sep 23 2022 at 17:07):

I think there's some initialization order issue. If I comment out the DisplayManager() constructor's two lines that make gl calls, it works. So presumably opengl is not yet initialized at the time of construction.

view this post on Zulip Himanshu (Sep 24 2022 at 12:53):

@Daniel Rossberg Does we actually need to show these child objects in properties tab too? Screenshot-83.png

view this post on Zulip Sean (Sep 24 2022 at 14:32):

Is there a keybinding to get it out of the default fullscreen or resize the window? On mac, I can't seem to minimize it which makes it impossible to get to the Desktop while the app is running.

view this post on Zulip Sean (Sep 24 2022 at 14:34):

I'm also seeing some bug where the wireframe only displays in the bottom left...

view this post on Zulip Sean (Sep 24 2022 at 14:35):

Here's the first issue (no means to windowfy or minimize): Screen-Shot-2022-09-24-at-10.34.33-AM.png

view this post on Zulip Sean (Sep 24 2022 at 14:38):

Here's the second issue:
Screen-Shot-2022-09-24-at-10.36.58-AM.png
Screen-Shot-2022-09-24-at-10.37.36-AM.png

view this post on Zulip Himanshu (Sep 24 2022 at 20:26):

Wow a strange bug that is hiding for mac. @Sean can you upload the .g file that you have tested with?

view this post on Zulip Himanshu (Sep 24 2022 at 20:27):

I will test it out in windows in morning.

view this post on Zulip Daniel Rossberg (Sep 25 2022 at 12:32):

Sean said:

Is there a keybinding to get it out of the default fullscreen or resize the window? On mac, I can't seem to minimize it which makes it impossible to get to the Desktop while the app is running.

This is probably caused by the Qt::FramelessWindowHint flag. For the sake of a modern look, the system menu was eliminated and, at least with Windows and KDE, replaced by the main window's menu bar. On these systems, the minimize/maximize/exit icons are however still there.

view this post on Zulip Daniel Rossberg (Sep 25 2022 at 12:54):

Sean said:

I'm also seeing some bug where the wireframe only displays in the bottom left...

A screen resolution (retina disply) issue? Qt has Qt::AA_EnableHighDpiScaling and Qt::AA_DisableHighDpiScaling flags, but not for macOS? See also https://doc.qt.io/qt-5/highdpi.html#macos-and-ios

view this post on Zulip Daniel Rossberg (Sep 25 2022 at 13:08):

Himanshu Sekhar Nayak said:

Daniel Rossberg Does we actually need to show these child objects in properties tab too? Screenshot-83.png

Yes, ideally including their boolean operators.

view this post on Zulip Sean (Sep 26 2022 at 03:11):

Himanshu Sekhar Nayak said:

Wow a strange bug that is hiding for mac. Sean can you upload the .g file that you have tested with?

It does it with all .g's, so it's not specific to the geometry. something is probably getting calculated differently (obviously half of what it should be in both dimensions).

view this post on Zulip Sean (Sep 26 2022 at 03:23):

Daniel Rossberg said:

A screen resolution (retina disply) issue? Qt has Qt::AA_EnableHighDpiScaling and Qt::AA_DisableHighDpiScaling flags, but not for macOS? See also https://doc.qt.io/qt-5/highdpi.html#macos-and-ios

I do have a retina display and high dpi scaling was turned on, but I get the same result even if I turn scaling off.

view this post on Zulip Sean (Sep 26 2022 at 03:42):

but you're definitely on to something there. if I multiple h and w by 2 in Display::resizeGL() it displays perfectly: Screen-Shot-2022-09-25-at-11.40.52-PM.png

view this post on Zulip Sean (Sep 26 2022 at 03:49):

Ah, I think I found it -- DisplayManager::DrawVListElementCallback::operator()

            /* 96 dpi = 3.78 pixel/mm hardcoded */
            glScaled(2. * 3.78 / displayManager->display.getW(),
                     2. * 3.78 / displayManager->display.getH(),
                     1.);

view this post on Zulip Himanshu (Sep 26 2022 at 03:56):

Sean said:

Ah, I think I found it -- DisplayManager::DrawVListElementCallback::operator()

            /* 96 dpi = 3.78 pixel/mm hardcoded */
            glScaled(2. * 3.78 / displayManager->display.getW(),
                     2. * 3.78 / displayManager->display.getH(),
                     1.);

So it should be calculated differently for different platform?

view this post on Zulip Sean (Sep 26 2022 at 04:12):

spoke too soon, looks like that code isn't called though I was able to eliminate the hardcoding

view this post on Zulip Sean (Sep 26 2022 at 04:24):

I think I got it fixed. I'll push a PR for review but it's pretty simple.

view this post on Zulip Himanshu (Sep 26 2022 at 15:44):

@Daniel Rossberg Added a skeleton class for selecting an object. https://github.com/BRL-CAD/arbalest/pull/33/commits/6f942d91db1f6d450b0f2326b473f5a66f441e0b

view this post on Zulip Daniel Rossberg (Sep 26 2022 at 17:23):

Okay, thanks. I want however talk with you about your MouseAction base class first. You mixed up the parameters there.

For the start, you could rethink my hint "MouseAction(QObject* parent, QWidget* watched);".

view this post on Zulip Himanshu (Sep 27 2022 at 14:10):

Daniel Rossberg said:

Okay, thanks. I want however talk with you about your MouseAction base class first. You mixed up the parameters there.

For the start, you could rethink my hint "MouseAction(QObject* parent, QWidget* watched);".

For frameGeometry().topLeft(), isMaximized(), move() to work they need an object from MainWindow, so I have done something like that.

view this post on Zulip Himanshu (Sep 27 2022 at 14:14):

If I am right, here parent should be MainWindow for MouseAction ?

view this post on Zulip Himanshu (Sep 27 2022 at 16:08):

Here is a patch but I can't figure out how to make frameGeometry().topLeft(), isMaximized(), move() work. Changes-On-6f942d.patch

view this post on Zulip Daniel Rossberg (Sep 27 2022 at 17:13):

You are asking the right question :grinning: We didn't talked about this yet. But, while looking at this, I realized, that your current code aim at the wrong widget. Moving the main window is not what we are looking for. Instead, Display is the widget we want different mouse actions for. I.e., MouseAction(QObject* parent, Display* watched);.

view this post on Zulip Himanshu (Sep 28 2022 at 14:17):

Daniel Rossberg said:

You are asking the right question :grinning: We didn't talked about this yet. But, while looking at this, I realized, that your current code aim at the wrong widget. Moving the main window is not what we are looking for. Instead, Display is the widget we want different mouse actions for. I.e., MouseAction(QObject* parent, Display* watched);.

So menuTitleBar shouldn't be the target widget?

view this post on Zulip Himanshu (Sep 28 2022 at 14:25):

So the goal is to move these mouse functions to their respective classes which are in Display.h?

    void mouseMoveEvent(QMouseEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void wheelEvent(QWheelEvent *event) override;
    void keyPressEvent(QKeyEvent *k) override ;

view this post on Zulip Daniel Rossberg (Sep 28 2022 at 17:40):

The mouse behavior on the menuTitleBar is a bit boring. No need to create a class hierarchy for this. The mouse actions in the Display widget are much more exciting. Here we need a frame work to create easily new kinds of interactions.

And yes, the has to be done in the eventFilter() method.

view this post on Zulip Sean (Sep 29 2022 at 03:53):

Sean said:

I think I got it fixed. I'll push a PR for review but it's pretty simple.

PR pushed, https://github.com/BRL-CAD/arbalest/pull/37

view this post on Zulip Himanshu (Sep 29 2022 at 14:52):

Daniel Rossberg said:

The mouse behavior on the menuTitleBar is a bit boring. No need to create a class hierarchy for this. The mouse actions in the Display widget are much more exciting. Here we need a frame work to create easily new kinds of interactions.

And yes, the has to be done in the eventFilter() method.

So I guess we have to shift the MouseAction object to Display.h instead of keeping it inside MainWindow?

view this post on Zulip Himanshu (Sep 29 2022 at 15:03):

Just want to clear this so that I can start again :sweat_smile:

view this post on Zulip Himanshu (Sep 29 2022 at 15:03):

I will restore the DragWindowMouseAction to its original place e.g removing that class.

view this post on Zulip Himanshu (Sep 29 2022 at 15:04):

Then I will implement them in separate classes for all the override that are in Display.h

view this post on Zulip Daniel Rossberg (Sep 29 2022 at 17:19):

You should save (rescue) the MouseAction and DragWindowMouseAction classes and reset the source tree, e.g. by deleting the branch and creating a new one. Then, move the MouseAction class there and make the constructor look like MouseAction(QObject* parent, Display* observed). The design of DragWindowMouseAction wasn't bad. It can be used as a template for the new mouse rotation action class on Display. This way, you have hopefully an easier start.

view this post on Zulip Himanshu (Sep 29 2022 at 17:24):

Daniel Rossberg said:

You should save (rescue) the MouseAction and DragWindowMouseAction classes and reset the source tree, e.g. by deleting the branch and creating a new one. Then, move the MouseAction class there and make the constructor look like MouseAction(QObject* parent, Display* observed). The design of DragWindowMouseAction wasn't bad. It can be used as a template for the new mouse rotation action class on Display. This way, you have hopefully an easier start.

So all the functions e.g DragWindowButtonAction() will be placed inside Display.h and so on

view this post on Zulip Daniel Rossberg (Sep 29 2022 at 17:45):

No. First, this task is about defining functionality outside from the Display class, i.e., moving stuff out. In addition, Display has no use for a drag window action. But, it would be good if you had this code to hand and look up there to speed up development.

view this post on Zulip Himanshu (Sep 29 2022 at 17:48):

Alright :+1:🏻. I will start tomorrow then. Late night here. I will create a new branch and will send a PR.

view this post on Zulip Himanshu (Oct 05 2022 at 19:14):

@Daniel Rossberg Should I go with friend for all those derived class of MouseAction so that they can access those private variables of Display class?

view this post on Zulip Himanshu (Oct 05 2022 at 19:14):

or add some getters inside Display class?

view this post on Zulip Himanshu (Oct 05 2022 at 20:04):

Btw if (watched == m_watched) Will it even be true? Since both are different classes or I am missing somethin here?

view this post on Zulip Daniel Rossberg (Oct 06 2022 at 07:04):

You should write interfaces for the functionality you need in the mouse action. E.g., don't hand over the camera object but write Display::MoveCamera(), Display::RotateCamera(), etc. functions.

view this post on Zulip Daniel Rossberg (Oct 06 2022 at 07:08):

Himanshu Sekhar Nayak said:

Btw if (watched == m_watched) Will it even be true? Since both are different classes or I am missing somethin here?

m_watched should be of Display type, which is, after some levels of inheritance, a QObject, the type of watched.

view this post on Zulip Sean (Oct 07 2022 at 05:16):

Just FYI, we have a team of capstone students using arbalest GUI as the base for creating a new geometry V&V tool. Basically, the tool is going to have a "compile" button of sorts and will run a slew of tests on the geometry, summarizing them in compiler-info/warning/error fashion like msvc's warnings panel.

view this post on Zulip Himanshu (Oct 07 2022 at 07:54):

@Daniel Rossberg Added the functionality that I need for derived classes of MouseAction class. https://github.com/BRL-CAD/arbalest/pull/38/commits/e793c41e4afaf033d9a995a7c4123b1dbc2209e7

view this post on Zulip Himanshu (Oct 07 2022 at 08:02):

Btw what parameters need to be passed in these? E.g MoveCameraMouseAction(QObject* parent, Display* watched)

view this post on Zulip Himanshu (Oct 07 2022 at 08:08):

Sean said:

Just FYI, we have a team of capstone students using arbalest GUI as the base for creating a new geometry V&V tool. Basically, the tool is going to have a "compile" button of sorts and will run a slew of tests on the geometry, summarizing them in compiler-info/warning/error fashion like msvc's warnings panel.

Wow that's nice. Idk that others are working too in this. :grinning:

view this post on Zulip Sean (Oct 08 2022 at 16:42):

He's a very preliminary screenshot of where they're at right now,
Screenshot_from_2022-10-07_10-06-50.png

view this post on Zulip Daniel Rossberg (Oct 09 2022 at 15:57):

Himanshu Sekhar Nayak said:

Daniel Rossberg Added the functionality that I need for derived classes of MouseAction class. https://github.com/BRL-CAD/arbalest/pull/38/commits/e793c41e4afaf033d9a995a7c4123b1dbc2209e7

Your code is a bit unexpected, and (without having tested it) I doubt that it works. For example, only the wheel action should be active: The last mouse action you create the MainWindows constructor is the wheel action.

view this post on Zulip Daniel Rossberg (Oct 09 2022 at 16:09):

You seem to doing hard in understanding what kind of objects are needed. This is about the generalization of the mouse interactions. At the moment, there is only one mouse interaction implemented: The movement of the camera. This shall be the start point.

Object oriented means, that there shall be objects which take the responsibility for the different behavior modes. However, at the moment there is only one behavior, the default one, the camera movement.

view this post on Zulip Daniel Rossberg (Oct 09 2022 at 16:13):

All behavior specific code has to be part of this class.

In your case you need two new classes:

view this post on Zulip Daniel Rossberg (Oct 09 2022 at 16:16):

The current mouse behavior is implemented like

void Display::mouseMoveEvent(QMouseEvent *event) {
    const int x = event->x();
    const int y = event->y();
    int globalX = event->globalX();
    int globalY = event->globalY();

    bool resetX = false, resetY = false;

    if(prevMouseX != -1 && prevMouseY != -1 && (event->buttons() & (rotateCameraMouseButton|moveCameraMouseButton))) {
        if (skipNextMouseMoveEvent) {
            skipNextMouseMoveEvent = false;
            return;
        }
        if(event->buttons() & (rotateCameraMouseButton)) {
            const bool rotateThirdAxis = QApplication::keyboardModifiers().testFlag(rotateAroundThirdAxisModifier);
            camera->processRotateRequest(x- prevMouseX, y - prevMouseY,rotateThirdAxis);
        }
        if(event->buttons() & (moveCameraMouseButton)){
            camera->processMoveRequest(x- prevMouseX, y - prevMouseY);
        }

        forceRerenderFrame();

        const QPoint topLeft = mapToGlobal(QPoint(0,0));
        const QPoint bottomRight = mapToGlobal(QPoint(size().width(),size().height()));

        int newX = -1;
        int newY = -1;

        if (globalX <= topLeft.x()) {
            newX = bottomRight.x()-1;
            resetX = true;
        }
        if (globalX >= bottomRight.x()) {
            newX = topLeft.x()+1;
            resetX = true;
        }
        if (globalY <= topLeft.y()) {
            newY = bottomRight.y()-1;
            resetY = true;
        }
        if (globalY >= bottomRight.y()) {
            newY = topLeft.y()+1;
            resetY = true;
        }

        if (resetX || resetY) {
            prevMouseX = resetX ? mapFromGlobal(QPoint(newX,newY)).x() : x;
            prevMouseY = resetY ? mapFromGlobal(QPoint(newX,newY)).y() : y;
            QCursor::setPos(resetX ? newX : globalX, resetY ? newY : globalY);
            skipNextMouseMoveEvent = true;
        }
    }

    if(!resetX && !resetY) {
        prevMouseX = x;
        prevMouseY = y;
    }
}

void Display::mousePressEvent(QMouseEvent *event) {
    document->getDisplayGrid()->setActiveDisplay(this);
    prevMouseX = event->x();
    prevMouseY = event->y();
}

void Display::mouseReleaseEvent(QMouseEvent *event) {
    prevMouseX = -1;
    prevMouseY = -1;
}

void Display::wheelEvent(QWheelEvent *event) {

    if (event->phase() == Qt::NoScrollPhase || event->phase() == Qt::ScrollUpdate || event->phase() == Qt::ScrollMomentum) {
        camera->processZoomRequest(event->angleDelta().y() / 8);
        forceRerenderFrame();
    }
}

view this post on Zulip Daniel Rossberg (Oct 09 2022 at 16:21):

This should be implemented as something like this

bool MoveCameraMouseAction::eventFilter(QObject* watched, QEvent* event) {
    if (watched == m_watched) {
        if (event->type() == QEvent::MouseMove) {
            // put the code of Display::mouseMoveEvent() here
        }
        else if (event->type() == QEvent::MouseButtonPress) {
            // put the code of Display::mousePressEvent() here
        }
        else if (event->type() == QEvent::MouseButtonRelease) {
            // put the code of Display::mousePressEvent() here
        }
        else if (event->type() == QEvent::Wheel) {
            // put the code of Display::mousePressEvent() here
        }
    }

    return ?
}

view this post on Zulip Daniel Rossberg (Oct 09 2022 at 16:23):

Variables like prevMouseX and prevMouseY should become member of MoveCameraMouseAction.

view this post on Zulip Himanshu (Oct 10 2022 at 11:03):

Ahh my bad. I though for every different mouse event I have to create separate class. I will solve it by today.

view this post on Zulip Himanshu (Oct 10 2022 at 20:43):

@Daniel Rossberg Should we also shift bool bool skipNextMouseMoveEvent = false; inside MoveCameraMouseAction class ?

view this post on Zulip Himanshu (Oct 10 2022 at 21:21):

Updated @Daniel Rossberg https://github.com/BRL-CAD/arbalest/pull/38/commits/91e2e48670eeef37a882868ddfd162fc557fa563

view this post on Zulip Himanshu (Oct 11 2022 at 12:43):

Btw I have forgot to add return false; in those events so I added them also.

view this post on Zulip Himanshu (Oct 11 2022 at 12:46):

While navigating through MainWindindow src file, I saw QMouseEvent* mouse_event = dynamic_cast<QMouseEvent*>(event); where dynamic_cast is used and I added static_cast inside respective event->type(). So which will be right?

view this post on Zulip Himanshu (Oct 11 2022 at 12:47):

As far I know If there is a surety we will never cast to wrong object then we can avoid dynamic_cast and use static_cast but I don't know which will be best fit for these since dynamic_cast has runtime overhead.

view this post on Zulip Daniel Rossberg (Oct 12 2022 at 17:50):

Himanshu Sekhar Nayak said:

Daniel Rossberg Should we also shift bool bool skipNextMouseMoveEvent = false; inside MoveCameraMouseAction class ?

Yes, it should become a member of MoveCameraMouseAction and removed from Display.

view this post on Zulip Daniel Rossberg (Oct 12 2022 at 17:53):

Himanshu Sekhar Nayak said:

Btw I have forgot to add return false; in those events so I added them also.

One return false; at the end of MoveCameraMouseAction::eventFilter() would be enough, or?

view this post on Zulip Daniel Rossberg (Oct 12 2022 at 18:00):

Himanshu Sekhar Nayak said:

While navigating through MainWindindow src file, I saw QMouseEvent* mouse_event = dynamic_cast<QMouseEvent*>(event); where dynamic_cast is used and I added static_cast inside respective event->type(). So which will be right?

Using static_cast is okay. dynamic_cast is rather a test, if the variable has the desired type. The result of a dynamic_cast should be tested for nullptr too. BTW, it wasn't the MainWindow with these mouse event casts ;)

view this post on Zulip Himanshu (Oct 13 2022 at 07:41):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

Btw I have forgot to add return false; in those events so I added them also.

One return false; at the end of MoveCameraMouseAction::eventFilter() would be enough, or?

Hmm understood. One return false; since all other events are ignored, and the filter returns false to allow them to be sent on to the target widget.

view this post on Zulip Himanshu (Oct 13 2022 at 14:13):

@Daniel Rossberg We need a Display object that need to be passed MoveCameraMouseAction(QObject* parent, Display* watched) and here the parent will be a object of MainWindow?

view this post on Zulip Himanshu (Oct 13 2022 at 15:50):

So now we have to do something like this. Create another class where it can select the object and highlight it. But before that if we select a sub-object inside object dock then it should also highlight too.

view this post on Zulip Daniel Rossberg (Oct 13 2022 at 15:54):

Himanshu Sekhar Nayak said:

Daniel Rossberg We need a Display object that need to be passed MoveCameraMouseAction(QObject* parent, Display* watched) and here the parent will be a object of MainWindow?

Good question. The watched parameter is a Display instance, but who manages these instances? I don't think it's MainWindow.

view this post on Zulip Daniel Rossberg (Oct 13 2022 at 16:02):

The MainWindow has a member documentArea which contains the tab widgets. documentArea->widget(index) is of type DisplayGrid (if it isn't the help page), which contains an array of displays.

view this post on Zulip Daniel Rossberg (Oct 13 2022 at 16:04):

Maybe, the mouse action objects should be managed by DisplayGrid too? It would need a MouseAction instance for each Display instance.

view this post on Zulip Daniel Rossberg (Oct 13 2022 at 16:08):

DisplayGrid could have a setMoveCameraMouseAction() method, which allows to set the required action in the MainWindow class.

view this post on Zulip Himanshu (Oct 15 2022 at 11:51):

Daniel Rossberg said:

The MainWindow has a member documentArea which contains the tab widgets. documentArea->widget(index) is of type DisplayGrid (if it isn't the help page), which contains an array of displays.

Okay, I see that it is dynamically casted to DisplayGrid in MainWindow. Also I saw this, documentArea->addTab(new HelpWidget(), "Quick Start"); that you talked about Help page.

view this post on Zulip Himanshu (Oct 15 2022 at 13:48):

So every time there is a new tab, then there should be always new mouse actions for each tab.

view this post on Zulip Himanshu (Oct 16 2022 at 06:33):

So there are 4 displays right?

view this post on Zulip Daniel Rossberg (Oct 16 2022 at 14:50):

I don't know if their number is limited :thinking:

view this post on Zulip Himanshu (Oct 16 2022 at 14:51):

This one QVector<Display *> displays;

view this post on Zulip Himanshu (Oct 16 2022 at 14:51):

inside DisplayGrid class ^^

view this post on Zulip Himanshu (Oct 16 2022 at 14:52):

In constructor of DisplayGrid I saw this too -> displays.append(new Display(document)); written 4 times

view this post on Zulip Himanshu (Oct 16 2022 at 14:52):

So I thought are they referring to viewport?

view this post on Zulip Himanshu (Oct 16 2022 at 14:53):

Then I saw this activeDisplay = displays[3]; and thought this should be the viewport. Right?

view this post on Zulip Daniel Rossberg (Oct 16 2022 at 15:37):

Himanshu Sekhar Nayak said:

In constructor of DisplayGrid I saw this too -> displays.append(new Display(document)); written 4 times

I think, this refers to the four displays in mged (archer) when you activate the multipane (quad view) mode.

view this post on Zulip Himanshu (Oct 16 2022 at 16:06):

Changes-On-f84019.patch

view this post on Zulip Daniel Rossberg (Oct 17 2022 at 16:48):

Please, add everything I shall consider to your PR.

view this post on Zulip Himanshu (Oct 19 2022 at 14:40):

@Daniel Rossberg Idk but still I am not able to see my mouse during creation of a new file or opening a file. Have you tested it out?

view this post on Zulip Himanshu (Oct 19 2022 at 15:38):

Desktop-2022.10.19-21.04.37.02.mp4 It didn't show the blinks but I will upload another from my camera.

view this post on Zulip Himanshu (Oct 19 2022 at 16:17):

lol, the blinks is due to hide of taskbar. When I disable the auto hide of taskbar, it works. Anyways it's fine now for me at least.

view this post on Zulip Himanshu (Oct 19 2022 at 16:21):

But when I switch to AMD GPU from NVIDIA GPU even if the auto hide of taskbar is enabled, the blinks doesn't appear and works fine. Idk what is happening for NVIDIA GPU.

view this post on Zulip Daniel Rossberg (Oct 20 2022 at 17:07):

The cause is probably a wrong return of the eventFilter() function. See its documentation. However, I'm working on it right now.

view this post on Zulip Himanshu (Oct 20 2022 at 17:11):

Daniel Rossberg said:

The cause is probably a wrong return of the eventFilter() function. See its documentation. However, I'm working on it right now.

This one --> stop it being handled further, return true; otherwise return false.

view this post on Zulip Daniel Rossberg (Oct 20 2022 at 17:17):

I just kind of accepted your PR. Please, test it.

view this post on Zulip Himanshu (Oct 20 2022 at 17:18):

okay

view this post on Zulip Daniel Rossberg (Oct 20 2022 at 17:19):

My main change was, that eventFilter() now returns true, if the event was handled.

view this post on Zulip Himanshu (Oct 20 2022 at 17:25):

Hmm but still my screen blinks when I create a new file. Idk if this is my problem but if I disable the autohide of taskbar, it works fine without blinks.

view this post on Zulip Daniel Rossberg (Oct 20 2022 at 17:27):

Was the behavior different before?

view this post on Zulip Himanshu (Oct 20 2022 at 17:29):

Nope.

view this post on Zulip Himanshu (Oct 20 2022 at 17:31):

After I completed the eventFilter(), it happens but previously my taskbar hide is disabled but these days I am using auto hide of taskbar.

view this post on Zulip Himanshu (Oct 20 2022 at 17:31):

Btw my screen resolution is 2560x1600

view this post on Zulip Daniel Rossberg (Oct 20 2022 at 17:31):

I.e., it could be your video driver.

view this post on Zulip Himanshu (Oct 20 2022 at 17:32):

hmm that can be the reason but anyways I disabled auto hide of taskbar so now it works fine.

view this post on Zulip Himanshu (Oct 23 2022 at 02:36):

@Daniel Rossberg Should there be any Select object inside Edit menu? Or only a tool button for select feature?

view this post on Zulip Himanshu (Oct 23 2022 at 04:10):

and for the arrow, do you mean upward arrow? https://fonts.google.com/icons?icon.query=arrow+upward

view this post on Zulip Daniel Rossberg (Oct 23 2022 at 16:21):

Himanshu Sekhar Nayak said:

and for the arrow, do you mean upward arrow? https://fonts.google.com/icons?icon.query=arrow+upward

I thought more at something like this: https://www.flaticon.com/free-icon/cursor_99183

view this post on Zulip Daniel Rossberg (Oct 23 2022 at 16:22):

Himanshu Sekhar Nayak said:

Daniel Rossberg Should there be any Select object inside Edit menu? Or only a tool button for select feature?

Make a "Select Object" action, which can be inserted in an edit menu and/or tool bar.

view this post on Zulip Himanshu (Oct 23 2022 at 16:22):

Hmm I am thinking for both action and tool button for select.

view this post on Zulip Himanshu (Oct 27 2022 at 17:23):

@Daniel Rossberg Currently I am thinking to do like this for select function.

QString SelectMouseAction::getSelectedRegionPath() const {
    BRLCAD::ConstDatabase::Hit *obj = dynamic_cast<BRLCAD::ConstDatabase::Hit *>(m_watched->getDocument()->getDatabase());

    if (obj != nullptr) {
        return obj->Name();
    }

    return nullptr;
}

view this post on Zulip Daniel Rossberg (Oct 27 2022 at 17:48):

I'm afraid, this won't work.

Better: In eventFilter() on if (event->type() == QEvent::MouseButtonPress) shoot a ray where the click was. If something was hit, memorize obj->Name() on a member variable m_selected and emit Done(this). Then

QString SelectMouseAction::getSelected() const {
    return m_selected;
}

BTW, if there is a region, m_selected contains a region's path, but if there are no regions at all (for example), it can contain a solid's name too.

view this post on Zulip Himanshu (Oct 28 2022 at 15:12):

@Daniel Rossberg In order to shoot a ray which is new to me so first I have to fetch the my mouse x and y co-ordinates.

view this post on Zulip Himanshu (Oct 28 2022 at 15:17):

and also get the direction. And then initialize ray origin and direction coordinates and shoot that ray using this one m_database.ShootRay(ray, callback, BRLCAD::ConstDatabase::StopAfterFirstHit);

view this post on Zulip Daniel Rossberg (Oct 28 2022 at 16:06):

Maybe, RaytraceView can give you a hint on how this can be done. In RaytraceView a ray for every pixel will be shot. You need only one pixel.

view this post on Zulip Himanshu (Oct 29 2022 at 16:40):

@Daniel Rossberg Is this one virtual bool operator()(const BRLCAD::ConstDatabase::Hit& hit) throw(){} actually checks if a ray is hit or not? If yes then why it always return false.

view this post on Zulip Himanshu (Oct 29 2022 at 16:42):

That function operator overloading function is inside class RayTraceCallback : public BRLCAD::ConstDatabase::HitCallback but it is in RaytraceView.cpp file.

view this post on Zulip Daniel Rossberg (Oct 30 2022 at 12:03):

Himanshu Sekhar Nayak said:

Daniel Rossberg Is this one virtual bool operator()(const BRLCAD::ConstDatabase::Hit& hit) throw(){} actually checks if a ray is hit or not? If yes then why it always return false.

The return value isn't meant for you directly, but for the algorithm behind BRLCAD::Database::ShootRay(). It's explained in the ConstDatabase.h file, line 184 ff.:

            /** return true: go on; false: stop
                The return value gives the calling function the possibility to optimize.
                However be aware the return value may be ignored. */

view this post on Zulip Daniel Rossberg (Oct 30 2022 at 12:05):

I.e., always returning false means: Stop after the first hit.

view this post on Zulip Himanshu (Oct 30 2022 at 15:51):

@Daniel Rossberg What does this image point and model point means?

QVector3D        imagePoint(column, h - row - 1., 0.);
QVector3D        modelPoint = m_transformation.map(imagePoint);

view this post on Zulip Daniel Rossberg (Oct 30 2022 at 16:02):

The image coordinates should be more-or-less screen coordinates (y-coordinate reversed?) The transformation maps them to model coordinates (where the BRL-CAD geometry lives). Because the screen is 2D, but the model is 3D, the z-coordinate of the screen is set to 0. In fact, the image of a point on the screen in model space is not a point but a line.

view this post on Zulip Himanshu (Oct 31 2022 at 16:30):

@Daniel Rossberg Here is what I have done so far....

bool SelectMouseAction::eventFilter(QObject* watched, QEvent* event) {
    bool ret = false;

    if (watched == m_watched) {
        if (event->type() == QEvent::MouseButtonPress) {
            QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);

            if (mouseEvent->button() == Qt::LeftButton) {
                const int x = mouseEvent->x();
                const int y = mouseEvent->y();

                int w = m_watched->getDocument()->getRaytraceWidget()->width();
                int h = m_watched->getDocument()->getRaytraceWidget()->height();

                QVector3D &eyePosition = m_watched->getCamera()->getEyePosition();

                QMatrix4x4 m_transformation;
                QVector3D directionStart = m_transformation.map(eyePosition);
                QVector3D directionEnd = m_transformation.map(QVector3D(0., 0., 0.));
                QVector3D direction = directionEnd - directionStart;
                direction.normalize();

                QVector3D        imagePoint(x, h - y - 1., 0.);
                QVector3D        modelPoint = m_transformation.map(imagePoint);
                RayTraceCallback callback(direction, m_watched->getDocument()->getRaytraceWidget()->getColor());
                BRLCAD::Ray3D    ray;

                ray.origin.coordinates[0] = modelPoint.x();
                ray.origin.coordinates[1] = modelPoint.y();
                ray.origin.coordinates[2] = modelPoint.z();
                ray.direction.coordinates[0] = direction.x();
                ray.direction.coordinates[1] = direction.y();
                ray.direction.coordinates[2] = direction.z();

                // Shoot a ray
                m_watched->getDocument()->getDatabase()->ShootRay(ray, callback, BRLCAD::ConstDatabase::StopAfterFirstHit);


                // Check if a ray intersects or hit
                // Dynamically cast BRLCAD::ConstDatabase to BRLCAD::ConstDatabase::Hit and return region Name



                emit Done(this);

                ret = true;
            }
            else {
                ret = false;

            }
        }
    }

    return ret;
}

view this post on Zulip Daniel Rossberg (Oct 31 2022 at 17:34):

You need to write your own call-back class.

view this post on Zulip Himanshu (Nov 01 2022 at 16:47):

@Daniel Rossberg What is the purpose of QColor m_color; in RayTracecallback class? Do you need that?

view this post on Zulip Daniel Rossberg (Nov 01 2022 at 17:15):

RaytraceView generates a ray-trace image: For every pixel of the screen/image a ray will be shot and the corresponding colour will be determined. This colour is based on the colour of the object hit and the hitting angle. The variable m_colorholds this colour.

view this post on Zulip Daniel Rossberg (Nov 01 2022 at 17:16):

Of course, you don't need this for your selection call-back.

view this post on Zulip Himanshu (Nov 05 2022 at 07:06):

@Daniel Rossberg Should we make the select mouse action as a toggle action? So after select operation is finished, it can switch back to move mouse action.

view this post on Zulip Daniel Rossberg (Nov 05 2022 at 16:00):

I wouldn't call it "toggle action" (I've different associations with this name), but yes: Switch back to the mouse move action after the selection has finished.

view this post on Zulip Himanshu (Nov 07 2022 at 21:41):

@Daniel Rossberg okay, I am created a slot that will show the region name in the object docks. But looks like my ray is not shooting the region since I am getting empty in m_selected.

view this post on Zulip Daniel Rossberg (Nov 08 2022 at 18:10):

Good that you implemented the slot. The issues aren't surprising. Now, you should debug your code: Add a break point at the beginning of SelectMouseAction::eventFilter().

view this post on Zulip Himanshu (Nov 09 2022 at 06:09):

@Daniel Rossberg Meanwhile here is the slot that I had done. You can have a look. I have not tested it yet but looks good. Any suggestion like the name of the function or something?

bool ObjectTreeWidget::build(QString& selected, int objectId) {
    if (objectId != 0) {
        ObjectTree::VisibilityState visibilityState = document->getObjectTree()->getObjectVisibility()[objectId];

        if (visibilityState == ObjectTree::FullyVisible || visibilityState == ObjectTree::SomeChildrenVisible) {
            if (document->getObjectTree()->getNameMap()[objectId] == selected) {
                objectIdTreeWidgetItemMap[objectId]->setSelected(true);
                document->getProperties()->bindObject(objectId);

                return true;
            }
        }
        else {
            return false;
        }
    }

    for (int childObjectId : document->getObjectTree()->getChildren()[objectId])
    {
        bool isSelected = build(selected, childObjectId);

        if (isSelected == false) {
            continue;
        }

        if (objectId != 0) {
            objectIdTreeWidgetItemMap[objectId]->setExpanded(true);
        }

        return true;
    }

    return false;
}

view this post on Zulip Himanshu (Nov 10 2022 at 07:13):

Daniel Rossberg said:

Good that you implemented the slot. The issues aren't surprising. Now, you should debug your code: Add a break point at the beginning of SelectMouseAction::eventFilter().

  1. Looks like I am getting right x and y coordinates on screen. Here is the output using qDebug()
handling left mouse button event QEvent "MouseButtonPress"
Mouse x:  957
Mouse y:  852
  1. I think modelPoint is not working because sometimes there is a region name for a click and sometimes even if I click on a object, m_selected shows empty.

view this post on Zulip Daniel Rossberg (Nov 10 2022 at 16:49):

Are this the coordinates you expected?

I'm afraid, you have to set a break point there and debug it yourself. Something must be wrong there.

view this post on Zulip Daniel Rossberg (Nov 10 2022 at 16:59):

Himanshu Sekhar Nayak said:

Daniel Rossberg Meanwhile here is the slot that I had done. You can have a look. I have not tested it yet but looks good. Any suggestion like the name of the function or something?

Why don't you iterate over fullPathMap?

view this post on Zulip Himanshu (Nov 11 2022 at 06:28):

Oops I forgot that m_selected stores full path of the region name. Unless I should make it like document->getObjectTree()->getFullPathMap()[objectId] == selected ?

view this post on Zulip Daniel Rossberg (Nov 11 2022 at 17:20):

Yes, you should look for the selected path in this map.

view this post on Zulip Himanshu (Nov 12 2022 at 17:01):

So here it is --->

void ObjectTreeWidget::build(QString selected) {
    int size = document->getObjectTree()->getFullPathMap().size();

    for (int objectId = 1; objectId < size; ++objectId) {
        ObjectTree::VisibilityState visibilityState = document->getObjectTree()->getObjectVisibility()[objectId];
        if (visibilityState == ObjectTree::FullyVisible || visibilityState == ObjectTree::SomeChildrenVisible) {
            if (document->getObjectTree()->getFullPathMap()[objectId] == selected) {
                objectIdTreeWidgetItemMap[objectId]->setSelected(true);
                document->getProperties()->bindObject(objectId);
            }
        }
    }
}

view this post on Zulip Himanshu (Nov 12 2022 at 17:02):

I have tested it out and looks like when we click on multiple object, the previous selected ones stays setSelected() to true.

view this post on Zulip Himanshu (Nov 14 2022 at 15:03):

@Daniel Rossberg My pr is ready and I have some additional design touches that I wanted to ask if it suits you.

  1. When we click on an empty area which is not an object, so we should not be getting any region names. So at that moment should I clear the properties dock whenever it gets empty region name or make it stay there? Another example like the properties dock already shows the details of a selected object and now I click on empty area and the properties dock is still same and not updates. So should I make it clear?
  2. I have a thought like when we get a selected path then the object dock should be expanded till it's last / and show selected there. Or we should it only make the selected to setSelected(true) and no need of setExpanded()?
  3. When we click on select button icon then the background should be change to show that the button is active or selected instead of just a button which acts like other buttons like new, save, open...... . So should I change the background once it is selected?

view this post on Zulip Himanshu (Nov 14 2022 at 15:04):

For now the pr is ready and ready to test for select action. Let me know if there is anything needs to do.

view this post on Zulip Daniel Rossberg (Nov 14 2022 at 18:09):

Himanshu Sekhar Nayak said:

Daniel Rossberg My pr is ready and I have some additional design touches that I wanted to ask if it suits you.

  1. When we click on an empty area which is not an object, so we should not be getting any region names. So at that moment should I clear the properties dock whenever it gets empty region name or make it stay there? Another example like the properties dock already shows the details of a selected object and now I click on empty area and the properties dock is still same and not updates. So should I make it clear?

Let the properties dock unchanged. Clicking in an empty area is the same as canceling the selection procedure.

  1. I have a thought like when we get a selected path then the object dock should be expanded till it's last / and show selected there. Or we should it only make the selected to setSelected(true) and no need of setExpanded()?

Do not setExpanded(). Show the selected object together with its siblings.

  1. When we click on select button icon then the background should be change to show that the button is active or selected instead of just a button which acts like other buttons like new, save, open...... . So should I change the background once it is selected?

Doesn't do setCheckable(true) the job? Why does it work for toggleGridAct/toggleGrid?

view this post on Zulip Daniel Rossberg (Nov 14 2022 at 18:14):

Himanshu Sekhar Nayak said:

For now the pr is ready and ready to test for select action. Let me know if there is anything needs to do.

This will need some time. However, here is my first one: ObjectTreeWidget::build() is a bad name. You don't build something. Instead, look at line 110: You select something. Therefore, ObjectTreeWidget::select() would be a better name.

view this post on Zulip Himanshu (Nov 15 2022 at 08:02):

Ahh I forgot that there is one thing to add so that background will be changed once it is checked.
#toolbarButton:checked { background-color:"$Color-ButtonCheckedMask"; }

view this post on Zulip Himanshu (Nov 15 2022 at 08:04):

But the problem is background color is not able to find that macro $Color-ButtonCheckedMask. I have tried to clean the solution and rebuild it but no luck but once I set it to like this #toolbarButton:checked { background-color:"$Color-ButtonHoverMask"; } or set the background color to yellow without any macro, it works. I made sure that the macro is present in both light and dark theme but looks like didn't work.

view this post on Zulip Himanshu (Nov 15 2022 at 15:30):

I found a bug. If the grid button or select object button is enabled for one document then once we create a another new document, the buttons remains active. These buttons should act according to the document right? @Daniel Rossberg

view this post on Zulip Himanshu (Nov 15 2022 at 15:33):

One thing we can do like to check for every document for grid and select act and setChecked() accordingly. We can do it here MainWindow::onActiveDocumentChanged() but problem is that we can't access those variables which are inside MainWindow::prepareUi().

view this post on Zulip Himanshu (Nov 15 2022 at 15:43):

Or we can do a signal slot connection to solve this issue?

view this post on Zulip Daniel Rossberg (Nov 15 2022 at 18:46):

Himanshu Sekhar Nayak said:

I found a bug. If the grid button or select object button is enabled for one document then once we create a another new document, the buttons remains active. These buttons should act according to the document right? Daniel Rossberg

Not necessarily. I personally would consider it rather confusing if the grid would be a property of the document.

view this post on Zulip Himanshu (Nov 16 2022 at 13:55):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

I found a bug. If the grid button or select object button is enabled for one document then once we create a another new document, the buttons remains active. These buttons should act according to the document right? Daniel Rossberg

Not necessarily. I personally would consider it rather confusing if the grid would be a property of the document.

So once grid and select is active then it should remain active for all documents right? Because here you can see documents[activeDocumentId]->getDisplayGrid()->getActiveDisplay()->selectObjectEnabled == false. This only works when the button is clicked but not on active document change.

view this post on Zulip Daniel Rossberg (Nov 16 2022 at 20:39):

I expected that you bring up this point :)

What's important is that the behavior is all-in-all consistent. That the behavior of the grid (display property) and select (mouse behavior) button are different, would be reasonable. You can however define how you think the behavior should be and implement it that way.

view this post on Zulip Sean (Nov 16 2022 at 23:14):

Is there any key binding or way to drop arbalest out of full-screen mode? On Mac, there's no maximize/minimize buttons when it's full screen -- Only the menu bar. Typically Mac apps have an "Exit Fullscreen" menu option under View, or the window fills the whole desktop without going fullscreen so buttons remain accessible.

view this post on Zulip Himanshu (Nov 17 2022 at 05:26):

Sean said:

Is there any key binding or way to drop arbalest out of full-screen mode? On Mac, there's no maximize/minimize buttons when it's full screen -- Only the menu bar. Typically Mac apps have an "Exit Fullscreen" menu option under View, or the window fills the whole desktop without going fullscreen so buttons remain accessible.

I never saw arbalest running on Mac so I have no idea but I wish to test it out in Mac too but I have no mac. But can you share screenshot of how it looks actually?

view this post on Zulip Himanshu (Nov 17 2022 at 05:29):

@Daniel Rossberg @Sean What you will prefer for publishing Project Report? Should I create in BRL-CAD wiki? or Dev.to? or any?

view this post on Zulip Sean (Nov 17 2022 at 13:15):

@Himanshu Sekhar Nayak I sure can.. I’ll get one to you in a bit later today. Also could probably set you up with Remote Desktop access, if you want to try it that way also but happy to test and retest as needed.

view this post on Zulip Sean (Nov 17 2022 at 13:18):

@Himanshu Sekhar Nayak actually the screenshot I sent before is a perfect example of what it looks like on launch: Screen-Shot-2022-09-25-at-11.40.52-PM.png

view this post on Zulip Sean (Nov 17 2022 at 13:19):

As it’s full screen, there is no window so it fills the view.

view this post on Zulip Himanshu (Nov 17 2022 at 13:20):

Sean said:

Himanshu Sekhar Nayak actually the screenshot I sent before is a perfect example of what it looks like on launch: Screen-Shot-2022-09-25-at-11.40.52-PM.png

Ahh I see, there is no such minimize, maximize and close buttons.

view this post on Zulip Sean (Nov 17 2022 at 13:20):

Yeah it’s not truly going full screen on Windows so it still has the buttons there

view this post on Zulip Sean (Nov 17 2022 at 13:22):

I think I recall there being some Qt hint/preference/call that tells it to keep the Window but not sure..

view this post on Zulip Himanshu (Nov 17 2022 at 13:22):

Sean said:

Yeah it’s not truly going full screen on Windows so it still has the buttons there

Yep, during launch it goes full screen and I can see the buttons in windows. Are we also expecting those buttons on Mac too, right?

view this post on Zulip Himanshu (Nov 17 2022 at 13:23):

I will look into this, why those buttons are not visible in Mac.

view this post on Zulip Sean (Nov 17 2022 at 13:23):

We’ll without them, it’s impossible to minimize or resize.. :)

view this post on Zulip Sean (Nov 17 2022 at 13:23):

Maybe Qt::WindowFullscreenButtonHint

view this post on Zulip Himanshu (Nov 17 2022 at 13:24):

Ok, I am on it.

view this post on Zulip Sean (Nov 17 2022 at 13:25):

It’s actually nice/fine that there’s not buttons displayed, but then there needs to be some menu option to get out of full screen if it stays buttonless

view this post on Zulip Sean (Nov 17 2022 at 13:26):

The Mac application menu is at the top but it’s a permanent fixture on Mac

view this post on Zulip Daniel Rossberg (Nov 17 2022 at 19:14):

My guess from September 25:
Sean said:

Is there a keybinding to get it out of the default fullscreen or resize the window? On mac, I can't seem to minimize it which makes it impossible to get to the Desktop while the app is running.

This is probably caused by the Qt::FramelessWindowHint flag. For the sake of a modern look, the system menu was eliminated and, at least with Windows and KDE, replaced by the main window's menu bar. On these systems, the minimize/maximize/exit icons are however still there.

view this post on Zulip Himanshu (Nov 20 2022 at 07:42):

@Daniel Rossberg Here is the project report. Any suggestions? https://brlcad.org/wiki/User:H1manshu/GSoC2022/Project_Report

view this post on Zulip Himanshu (Nov 28 2022 at 15:48):

Thank you very much @Daniel Rossberg and @Sean. What I accomplished today is all due to you guys. Your guidance, advice and support always helped me to learn more and more. :face_holding_back_tears:

view this post on Zulip Sean (Dec 02 2022 at 05:05):

@Himanshu Sekhar Nayak Thank you for all your hard work. I was very much impressed by both the magnitude and quality of effort you put into the GUI work. Your accomplishments have been outstanding.

view this post on Zulip Sean (Dec 02 2022 at 05:21):

The improvements you made to arbalest's usability made it possible for another team of students to use the GUI as a base for developing an entirely new geometry V&V application. It also will hopefully get us one step closer to that overarching goal of a new modern CAD GUI.

view this post on Zulip Sean (Dec 02 2022 at 05:23):

I like your write-up and noticed your points about GED and MOOSE. If we can figure out how to combine the two, we'll gain the full expressiveness of mged/archer with a vastly more elegant front-end design.

view this post on Zulip Daniel Rossberg (Dec 07 2022 at 11:56):

FYI: I hope to find time to work on the backlog next week.

view this post on Zulip Daniel Rossberg (Dec 17 2022 at 17:54):

@Himanshu Sekhar Nayak, I accepted your PR. It isn't perfect yet, but the form was good, such that nothing was preventing it from being accepted. The remaining work in fine tuning and tweaking.

view this post on Zulip Daniel Rossberg (Dec 17 2022 at 18:48):

I applied Sean's PR which fixes the OpenGL issues on Mac. Maybe, you can test it on Windows.

view this post on Zulip Daniel Rossberg (Dec 17 2022 at 18:51):

And, I renamed the branch from master to main (like it's named in the other BRL-CAD repositories too):

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

view this post on Zulip Himanshu (Dec 18 2022 at 19:20):

Daniel Rossberg said:

I applied Sean's PR which fixes the OpenGL issues on Mac. Maybe, you can test it on Windows.

Tested in Windows and working fine.

view this post on Zulip Daniel Rossberg (Jan 17 2023 at 16:12):

@Himanshu Sekhar Nayak, I moved MOOSE to BRL-CAD:

git remote set-url origin https://github.com/BRL-CAD/MOOSE.git

It contains an example for test too.

view this post on Zulip Himanshu (Jan 19 2023 at 14:31):

Daniel Rossberg said:

Himanshu Sekhar Nayak, I moved MOOSE to BRL-CAD:

git remote set-url origin https://github.com/BRL-CAD/MOOSE.git

It contains an example for test too.

Nice. I will see it and start working soon.

view this post on Zulip Himanshu (Jan 23 2023 at 18:42):

I am little bit busy this week. Will look this weekend.

view this post on Zulip Daniel Rossberg (Jan 24 2023 at 08:48):

Take your time. It looks like, most people here (including myself) are busy.

view this post on Zulip Himanshu (Feb 05 2023 at 20:04):

@Daniel Rossberg Took too much time from my side and got time today to add the feature. Here it is https://github.com/BRL-CAD/arbalest/pull/45.

view this post on Zulip Himanshu (Feb 05 2023 at 20:05):

One think I noticed that select feature doesn't work when the object is not focused. When the object is focused from the object dock, select feature works.

view this post on Zulip Himanshu (Feb 05 2023 at 20:07):

Coming week I will see the first test of MOOSE that you had sent earlier.

view this post on Zulip Daniel Rossberg (Feb 06 2023 at 18:51):

Thanks @Himanshu Sekhar Nayak, I'll have a look at it.

view this post on Zulip Daniel Rossberg (Mar 07 2023 at 18:12):

I've created a moose_port branch in the arbalest repository. You can test it.

view this post on Zulip Himanshu (Mar 08 2023 at 12:37):

Daniel Rossberg said:

I've created a moose_port branch in the arbalest repository. You can test it.

I have an upcoming exam on april 16th to get into master's. After that I will do the left over work.

view this post on Zulip Daniel Rossberg (Mar 08 2023 at 17:00):

Himanshu Sekhar Nayak said:

Daniel Rossberg said:

I've created a moose_port branch in the arbalest repository. You can test it.

I have an upcoming exam on april 16th to get into master's. After that I will do the left over work.

Okay, take the time. But, the actual work should be done :wink:

view this post on Zulip Daniel Rossberg (Mar 21 2023 at 18:58):

The port has some issues. I'm working on them.

view this post on Zulip Himanshu (Mar 23 2023 at 03:58):

Daniel Rossberg said:

The port has some issues. I'm working on them.

Porting arbalest to moose?

view this post on Zulip Daniel Rossberg (Mar 23 2023 at 07:17):

Yes: https://github.com/BRL-CAD/arbalest/tree/moose_port
It's ready for testing again.

view this post on Zulip Himanshu (Mar 23 2023 at 08:14):

I recently like 5 days uninstalled qt 5.14.2 and downloaded qt installer to install again 5.14.2 but damn it always report me to network error like it can't download the archive. Btw 5.14.2 is no more in LTS for Qt.

view this post on Zulip Himanshu (Mar 23 2023 at 08:51):

Okay we can change the mirror through cmd installer(.exe) --mirror http://www.nic.funet.fi/pub/mirrors/download.qt-project.org

view this post on Zulip Daniel Rossberg (Mar 23 2023 at 10:02):

Are you behind a fire wall? In this case, you may need to set the proxy.

view this post on Zulip Sean (Mar 23 2023 at 15:52):

Daniel Rossberg said:

Yes: https://github.com/BRL-CAD/arbalest/tree/moose_port
It's ready for testing again.

Interesting, looks like you're moving away from using inheritance as much? Or just a side effect of restructuring the classes a bit?

view this post on Zulip Daniel Rossberg (Mar 23 2023 at 15:54):

I'm using C++11 features, as for example functional, to simplify the API.

view this post on Zulip Himanshu (Mar 23 2023 at 15:59):

Daniel Rossberg said:

Are you behind a fire wall? In this case, you may need to set the proxy.

Hmm that can be as I am using university internet.

view this post on Zulip Himanshu (Mar 25 2023 at 15:34):

@Daniel Rossberg Qt 5.14.2 is no longer in LTS. Should we concern?

view this post on Zulip Daniel Rossberg (Mar 25 2023 at 15:40):

Qt 5.14.2 should be okay. We don't use features which can be exploited from a distance. And, everybody builds the program for personal use only.

view this post on Zulip Daniel Rossberg (Mar 25 2023 at 15:41):

I.e., only you are building it with 5.14.2 ;)

view this post on Zulip Himanshu (Apr 02 2023 at 19:21):

One interesting thing I found. While opening a .g file, looks like either camera position is not right or the object seems to very zoomed in. It varies from object to object.

view this post on Zulip Himanshu (Apr 02 2023 at 19:21):

So while raytracing, it ray trace according the loaded camera position.

view this post on Zulip Himanshu (Apr 02 2023 at 19:22):

There should be a default position of camera and the object we load. Right?

view this post on Zulip Himanshu (Apr 20 2023 at 08:53):

Successfully built MOOSE but didn't installed and when I tried to built arbalest, and made sure the BRLCAD_MOOSE_DIR is path is given. But during building arbalest, it report fatal error C1083: Cannot open include file: 'brlcad/ConstDatabase.h': No such file or directory and many more which are related to brlcad. @Daniel Rossberg

view this post on Zulip Daniel Rossberg (Apr 20 2023 at 13:03):

Looks like you didn't switched to arbalest's moose_port branch. There should be no brlcad/ConstDatabase.h include in the sources but brlcad/Database/ConstDatabase.h.

view this post on Zulip Himanshu (Apr 21 2023 at 04:55):

Oops, my bad. What I have done that I cloned two separate arbalest for rt-cubed and MOOSE. And didn't realize I'm switching to moose_port branch while staying rt-cubed.

view this post on Zulip Himanshu (Apr 21 2023 at 05:19):

BRLCAD_MOOSE_INCLUDE_DIR not found while configuring? Need to specify explicitly?

view this post on Zulip Daniel Rossberg (Apr 21 2023 at 13:12):

You wrote that you haven't installed MOOSE. This means that CMake won't find the include directory at the expected place? In this case, you have to set it in fact manually.

view this post on Zulip Himanshu (Apr 21 2023 at 15:17):

BRLCAD_MOOSE_LIBRARY not found? Even after install. It's causing arbalest to not run and not able to find brlcad.dll which is present inside lib/ of MOOSE.

view this post on Zulip Himanshu (Apr 21 2023 at 15:18):

During config, BRLCAD_MOOSE_LIBRARY is not set too. Specify explicitly ?

view this post on Zulip Himanshu (Apr 21 2023 at 15:23):

Oh, now the path is set but it is still not able to find brlcad.dll.

view this post on Zulip Himanshu (Apr 21 2023 at 15:31):

Same. Still not able to find that .dll file even if it is present inside lib/

view this post on Zulip Himanshu (Apr 21 2023 at 15:33):

Screenshot-2023-04-21-210250.png
Here are the paths.

view this post on Zulip Daniel Rossberg (Apr 22 2023 at 01:48):

If you changed something, e.g. installed MOOSE, it could be necessary to start from scratch, i.e. to remove the old CMake config.

view this post on Zulip Daniel Rossberg (Apr 22 2023 at 01:51):

The DLL cannot be found, if it's not in the PATH. You could either add the corresponding directory of your MOOSE installation to your PATH variable, or (what I did) copy the DLL to the directory where the arbalest.exe is.

view this post on Zulip Himanshu (Apr 22 2023 at 21:43):

Daniel Rossberg said:

The DLL cannot be found, if it's not in the PATH. You could either add the corresponding directory of your MOOSE installation to your PATH variable, or (what I did) copy the DLL to the directory where the arbalest.exe is.

Hmm, copied the DLL and now arbalest works. Nice.

view this post on Zulip Himanshu (Apr 22 2023 at 21:55):

Tried removing the install/moose/ and done a fresh start but still not able to find DLL file. But anyway now it works after copying it.

view this post on Zulip Himanshu (Apr 25 2023 at 09:17):

Now arbalest is able to run through MOOSE. What's next?

view this post on Zulip Himanshu (Apr 25 2023 at 09:18):

Tested out selection, raytrace and other things on arbalest. It works too.

view this post on Zulip Sean (Apr 26 2023 at 06:50):

Screenshot would be great to see! :)

view this post on Zulip Sean (Apr 26 2023 at 07:00):

Would be great to figure out a proper way to run libged commands via MOOSE. It's not the same architecture as it's a string-based procedural interface and MOOSE is a more proper OO API, but having some sort of executor interface in the API would go a long way towards bridging a massive swath of capability (e.g., so you could run commands in arbalest and have it reflected automatically) ... if it can be done in a way that keeps the OO model in sync. So if you have a comb and a sph, and then you ran "mvall sph sph.new" via moose, that its representation of the comb would correctly reflect a reference to sph.new instead of the sph it originally read from disk.

view this post on Zulip Himanshu (Apr 26 2023 at 07:51):

Sean said:

Screenshot would be great to see! :smile:

Screenshot-123.png
Here is the screenshot of arbalest while selection feature is in action.

view this post on Zulip Daniel Rossberg (Apr 26 2023 at 13:54):

Sean said:

Would be great to figure out a proper way to run libged commands via MOOSE. It's not the same architecture as it's a string-based procedural interface and MOOSE is a more proper OO API, but having some sort of executor interface in the API would go a long way towards bridging a massive swath of capability (e.g., so you could run commands in arbalest and have it reflected automatically) ... if it can be done in a way that keeps the OO model in sync. So if you have a comb and a sph, and then you ran "mvall sph sph.new" via moose, that its representation of the comb would correctly reflect a reference to sph.new instead of the sph it originally read from disk.

MOOSE has a CommandString module (experimental), which serves as interface to libged. Set MODULE_COMMANDSTRING in MOOSE's CMake to on, to activate it.

In Examples/CommandString/PrintTitle.cpp you can find an example, where a database is opened with C++ API and the title is retrieved by sending title to libged.

view this post on Zulip Sean (Apr 26 2023 at 16:13):

Daniel Rossberg said:

MOOSE has a **CommandString** module (experimental), which serves as interface to libged. Set **MODULE_COMMANDSTRING** in MOOSE's CMake to on, to activate it.

In `Examples/CommandString/PrintTitle.cpp` you can find an example, where a database is opened with C++ API and the title is retrieved by sending `title` to libged.

Oh, that's exciting to hear! I missed seeing that addition. Will definitely check that out..

view this post on Zulip Sean (Apr 26 2023 at 16:13):

We've been having internal code reviews on the qged code, so I'm still looking at ways to merge the efforts if we can maintain the clean coding you have in arbalest's design. Maybe leverage the key pieces in qged like the command window widget (which might be super trivial now with a way to call commands), and the quad view (a lot of work went into making it highly performant, so that one might be tricky). Still learning about the two hierarchy views.

view this post on Zulip Daniel Rossberg (Feb 09 2024 at 10:10):

Vidit Jain said:

Hello Sir, my name is Vidit Jain and I am a second year undergrad at BITS Pilani Goa campus. I am exploring open source and open to learn new technologies. Would love some insights on how should I start contributing to BRL-CAD. I was going through GSOC 2024 projects and I am genuinly interested in working on project "New BRL-CAD GUI #27". Looking forward to hear from you. Thank you

Hi @Vidit Jain, welcome at BRL-CAD. Lets do our conversion here, where other mentors can jump in. E.g., @Himanshu Sekhar Nayak did a lot of the GUI development, and he wants to be a mentor this year, if BR_CAD will be accepted for GSoC :wink:

First, you should learn about BRL-CAD, what it is and how it works:

view this post on Zulip Vidit Jain (Feb 09 2024 at 10:18):

@Daniel Rossberg
Thanks a lot! I will go through the material and will get back to you all. If I have some doubts, I will get back to you.

view this post on Zulip Vidit Jain (Feb 09 2024 at 10:21):

Hello @Himanshu Sekhar Nayak!
My name is Vidit Jain. I am a second year undergraduate from BITS Pilani, KK Birla Goa Campus. I am interested in GUI development of BR_CAD. It's great to hear that you will be mentoring us for GSOC 2024. Looking forward to learn a lot from you and all the other mentors.
Thank you

view this post on Zulip Himanshu (Feb 09 2024 at 10:29):

Vidit Jain said:

Hello Himanshu Sekhar Nayak!
My name is Vidit Jain. I am a second year undergraduate from BITS Pilani, KK Birla Goa Campus. I am interested in GUI development of BR_CAD. It's great to hear that you will be mentoring us for GSOC 2024. Looking forward to learn a lot from you and all the other mentors.
Thank you

Hi Vidit, you can go through my progress and where I left it here https://brlcad.org/wiki/User:H1manshu/GSoC2022/Project_Report. But before that make yourself familiar to MGED and Arbalest. Then see if you want to come up with new ideas or find that thing which is missing in Arbalest but is present in MGED.

view this post on Zulip Vidit Jain (Feb 09 2024 at 19:48):

Thank you, sure, I will start reading from tomorrow :blush:

view this post on Zulip Daniel Rossberg (Feb 13 2024 at 08:55):

@Vidit Jain, there is no installation file for Arbalest yet. You have to build it by yourself. On top of that, the build is currently broken. However, you can start setting up your development environment, and maybe, we can fix the build meanwhile.

view this post on Zulip Daniel Rossberg (Feb 13 2024 at 09:07):

As the first step for building Arbalest, you have to build and Install BRL-CAD:

Some additional tips:

view this post on Zulip Vidit Jain (Feb 13 2024 at 09:10):

Thanks a lot for the guidance! Will do all of this as soon as possible.

view this post on Zulip Himanshu (Feb 14 2024 at 17:58):

Vidit Jain said:

Thanks a lot for the guidance! Will do all of this as soon as possible.

Currently I am little bit busy for my ongoing exam. After Saturday, I am free.

view this post on Zulip Daniel Rossberg (Feb 15 2024 at 10:50):

Building arbalest should be possible again. I could do it with Debian bookworm, at least.

view this post on Zulip Daniel Rossberg (Feb 21 2024 at 08:26):

Vidit Jain said:

What should I do next? Should I try installing Arbalest?

There is an issue with building the MOOSE library with Visual Studio, but you can start setting it up nevertheless.

view this post on Zulip Vidit Jain (Feb 23 2024 at 07:15):

@Sean can you please help me with this

view this post on Zulip Vidit Jain (Feb 23 2024 at 07:16):

@Himanshu Sekhar Nayak can you please send me sample proposals from past years. That would be really helpful for me to understand how I am supposed to make my own. Thank you

view this post on Zulip Himanshu (Feb 23 2024 at 07:24):

Vidit Jain said:

Himanshu Sekhar Nayak can you please send me sample proposals from past years. That would be really helpful for me to understand how I am supposed to make my own. Thank you

Here is mine.

view this post on Zulip Himanshu (Feb 23 2024 at 07:25):

You can see for 2022, 2023 also.

view this post on Zulip Vidit Jain (Feb 23 2024 at 09:56):

Himanshu Sekhar Nayak said:

Vidit Jain said:

Himanshu Sekhar Nayak can you please send me sample proposals from past years. That would be really helpful for me to understand how I am supposed to make my own. Thank you

Here is mine.

Thanks a lot.. also can you please help me with heap memory issue while building BRL-CAD

view this post on Zulip Himanshu (Feb 23 2024 at 15:31):

Vidit Jain said:

Himanshu Sekhar Nayak said:

Vidit Jain said:

Himanshu Sekhar Nayak can you please send me sample proposals from past years. That would be really helpful for me to understand how I am supposed to make my own. Thank you

Here is mine.

Thanks a lot.. also can you please help me with heap memory issue while building BRL-CAD

What's the error you are getting while building ?

view this post on Zulip Himanshu (Feb 23 2024 at 15:31):

I did build now and no issue found.

view this post on Zulip Himanshu (Feb 23 2024 at 16:21):

Okay, I am able to build arbalest again and ran it.

view this post on Zulip Himanshu (Feb 23 2024 at 16:22):

If I can see your build errors then I may help you. @Vidit Jain

view this post on Zulip Daniel Rossberg (Feb 23 2024 at 22:17):

Himanshu Sekhar Nayak said:

Okay, I am able to build arbalest again and ran it.

How was the compilation of MOOSE? I got two unresoved functions with MSVS 2019.

view this post on Zulip Himanshu (Feb 24 2024 at 11:54):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

Okay, I am able to build arbalest again and ran it.

How was the compilation of MOOSE? I got two unresoved functions with MSVS 2019.

I didn't get anything unresolved but I used MSVS 2022.

view this post on Zulip Himanshu (Feb 24 2024 at 12:01):

But while building with MSVS 2019 I got unresolved error.
unresolved external symbol __std_find_trivial_1 referenced in function "char const * __cdecl __std_find_trivial<char const ,unsigned char>(char const *,char const *,unsigned char)" (??$__std_find_trivial@$$CBDE@@YAPEBDPEBD0E@Z)

view this post on Zulip Vidit Jain (Feb 24 2024 at 12:02):

These are the issues that I am facing
WhatsApp-Image-2024-02-24-at-17.37.02_b554cceb.jpg
WhatsApp-Image-2024-02-24-at-17.37.33_5f2f976b.jpg

Himanshu Sekhar Nayak said:

If I can see your build errors then I may help you. Vidit Jain

view this post on Zulip Himanshu (Feb 24 2024 at 12:13):

Vidit Jain said:

These are the issues that I am facing
WhatsApp-Image-2024-02-24-at-17.37.02_b554cceb.jpg
WhatsApp-Image-2024-02-24-at-17.37.33_5f2f976b.jpg

Himanshu Sekhar Nayak said:

If I can see your build errors then I may help you. Vidit Jain

Try it in other drive maybe. What I see is you're trying to build where there is admin privilege.

view this post on Zulip Himanshu (Feb 24 2024 at 12:16):

Also take screenshot next time when you're posting your errors.

view this post on Zulip Vidit Jain (Feb 24 2024 at 13:01):

thanks a lot! I will share screenshots from next time

view this post on Zulip Himanshu (Feb 24 2024 at 13:01):

Himanshu Sekhar Nayak said:

Also take screenshot next time when you're posting your errors.

Now the build passed?

view this post on Zulip Vidit Jain (Feb 24 2024 at 13:03):

Himanshu Sekhar Nayak said:

Himanshu Sekhar Nayak said:

Also take screenshot next time when you're posting your errors.

Now the build passed?

Actually my laptop just has one drive.. that is C drive.. so I am creating a partition in my drive.. after that I guess it should work

view this post on Zulip Himanshu (Feb 24 2024 at 13:05):

Vidit Jain said:

Himanshu Sekhar Nayak said:

Himanshu Sekhar Nayak said:

Also take screenshot next time when you're posting your errors.

Now the build passed?

Actually my laptop just has one drive.. that is C drive.. so I am creating a partition in my drive.. after that I guess it should work

You can remove admin privileges I guess.

view this post on Zulip Vidit Jain (Feb 24 2024 at 13:10):

Ohh yaa.. just found it thanks

Himanshu Sekhar Nayak said:

Vidit Jain said:

Himanshu Sekhar Nayak said:

Himanshu Sekhar Nayak said:

Also take screenshot next time when you're posting your errors.

Now the build passed?

Actually my laptop just has one drive.. that is C drive.. so I am creating a partition in my drive.. after that I guess it should work

You can remove admin privileges I guess.

Oh yess! I just found it.. thanks

view this post on Zulip Balraj Dhakad (Feb 24 2024 at 13:14):

Hey,
This is Balraj,
I am willing to contribute to BRL-CAD as of GSOC 2024,
can you please guide me to the 1st step that I acn take to start my journey

view this post on Zulip Vidit Jain (Mar 08 2024 at 09:37):

Hello @Sean @Daniel Rossberg ,
Sorry for being inactive from past few days. My college mid-semester exams were going on so I was not able to work this. But they are over now.

view this post on Zulip Vidit Jain (Mar 08 2024 at 09:38):

I installed Linux in my machine and I build BRL-CAD successfully on it

view this post on Zulip Vidit Jain (Mar 08 2024 at 09:38):

@Himanshu Sekhar Nayak

view this post on Zulip Vidit Jain (Mar 08 2024 at 09:41):

Screenshot-from-2024-03-08-20-40-07.png

While I was runnind the built mged, I was facing this glitch in it.

view this post on Zulip Vidit Jain (Mar 08 2024 at 09:41):

Also, what should I do next to proceed further with it?

view this post on Zulip Himanshu (Mar 08 2024 at 12:10):

Vidit Jain said:

Screenshot-from-2024-03-08-20-40-07.png

While I was runnind the built mged, I was facing this glitch in it.

Glitch?

view this post on Zulip Vidit Jain (Mar 08 2024 at 12:11):

Its not visible on screen but the white background on graphics window was flickering

view this post on Zulip Himanshu (Mar 08 2024 at 12:14):

Vidit Jain said:

Also, what should I do next to proceed further with it?

Install moose first and then arbalest.

view this post on Zulip Vidit Jain (Mar 08 2024 at 12:14):

Vidit Jain said:

Its not visible on screen but the white background on graphics window was flickering

20240308_174301.mp4

view this post on Zulip Himanshu (Mar 08 2024 at 12:15):

Vidit Jain said:

Vidit Jain said:

Its not visible on screen but the white background on graphics window was flickering

20240308_174301.mp4

May be issue with graphics driver I guess.

view this post on Zulip Vidit Jain (Mar 08 2024 at 12:16):

Ohh.. ok
got it

view this post on Zulip Himanshu (Mar 08 2024 at 12:16):

Arbalest is the one where you are going to work on.

view this post on Zulip Vidit Jain (Mar 08 2024 at 12:17):

Oh that sounds great

Himanshu Sekhar Nayak said:

Arbalest is the one where you are going to work on.

view this post on Zulip Himanshu (Mar 08 2024 at 12:24):

You have to specify path of brlcad build in order to build moose. Since you are in linux you have to specify path e.g cmake -DBRLCAD_BASE_DIR=/path/to/your/brlcad /path/to/your/moose

view this post on Zulip Vidit Jain (Mar 08 2024 at 12:26):

Himanshu Sekhar Nayak said:

You have to specify path of brlcad build in order to build moose. Since you are in linux you have to specify path e.g cmake -DBRLCAD_BASE_DIR=/path/to/your/brlcad /path/to/your/moose

Was just going to ask this because I was facing this error.
Thanks!

view this post on Zulip Vidit Jain (Mar 08 2024 at 15:24):

image.png

Himanshu Sekhar Nayak said:

You have to specify path of brlcad build in order to build moose. Since you are in linux you have to specify path e.g cmake -DBRLCAD_BASE_DIR=/path/to/your/brlcad /path/to/your/moose

While running this command, I am facing this issue.. if you can help

view this post on Zulip Sean (Mar 08 2024 at 16:28):

Vidit Jain said:

Vidit Jain said:

Its not visible on screen but the white background on graphics window was flickering

20240308_174301.mp4

That is a bug and initialization/driver related, but see if it still flickers after you open a geometry database. There are a bunch of sample models in the share/db folder. Opening any of them should initialize the window to a dark blue or black background. Then you can see if geometry displays. If it does, then that will confirm it's a startup issue. If nothing displays, then there's a deeper issue with the display manager context on your environment to investigate.

view this post on Zulip Himanshu (Mar 08 2024 at 17:33):

Vidit Jain said:

image.png

Himanshu Sekhar Nayak said:

You have to specify path of brlcad build in order to build moose. Since you are in linux you have to specify path e.g cmake -DBRLCAD_BASE_DIR=/path/to/your/brlcad /path/to/your/moose

While running this command, I am facing this issue.. if you can help

Looks like you have to specify the brlcad version too.

view this post on Zulip Himanshu (Mar 08 2024 at 17:35):

You can add extra variable like this cmake -DBRLCAD_BASE_DIR=/path/to/your/brlcad -DBRLCAD_VERSION=your_version_number /path/to/your/source/code

view this post on Zulip Himanshu (Mar 08 2024 at 17:36):

version_number is 7.38.2

view this post on Zulip Himanshu (Mar 08 2024 at 17:36):

@Sean @Daniel Rossberg I saw that we have to specify version even I tried in windows too. Isn't it suppose to find itself?

view this post on Zulip Vidit Jain (Mar 08 2024 at 17:47):

Himanshu Sekhar Nayak said:

You can add extra variable like this cmake -DBRLCAD_BASE_DIR=/path/to/your/brlcad -DBRLCAD_VERSION=your_version_number /path/to/your/source/code

Yaa.. this worked for me and now I am moving forward to build arbalest

view this post on Zulip Himanshu (Mar 08 2024 at 17:49):

Vidit Jain said:

Himanshu Sekhar Nayak said:

You can add extra variable like this cmake -DBRLCAD_BASE_DIR=/path/to/your/brlcad -DBRLCAD_VERSION=your_version_number /path/to/your/source/code

Yaa.. this worked for me and now I am moving forward to build arbalest

After building moose, install it too by make install

view this post on Zulip Daniel Rossberg (Mar 08 2024 at 17:50):

@Vidit Jain, you have to install brlcad too: make install
Install it to a directory, where you have write rights, e.g. /home/vidit/bin/brlcad. The CMake brlcad detection script expects the directory structure from an installation.

In addition, you should include the brlcad bin directory (/home/vidit/bin/brlcad/bin?) in your PATH shell environment variable. This way, it's easier to work with the many BRL-CAD programs ... and you don't need to set anything in CMake, because the brlcad-config script will automatically detected and all necessary information retrieved from it.

Unfortunately, there is no brlcad-config for Windows.

view this post on Zulip Himanshu (Mar 08 2024 at 17:52):

No brlcad-config for windows due to which I have to specify version :sweat_smile:

view this post on Zulip Vidit Jain (Mar 08 2024 at 18:04):

image.png

I have successfully installed BRLCAD but while installing MOOSE, I am facing this error

view this post on Zulip Vidit Jain (Mar 08 2024 at 18:05):

/usr/bin/ld: libbrlcad.so: undefined reference to brl_deflate' /usr/bin/ld: libbrlcad.so: undefined reference to libregex_regexec'
/usr/bin/ld: libbrlcad.so: undefined reference to brl_inflate' /usr/bin/ld: libbrlcad.so: undefined reference to libregex_regcomp'
/usr/bin/ld: libbrlcad.so: undefined reference to brl_inflateEnd' /usr/bin/ld: libbrlcad.so: undefined reference to libregex_regfree'
/usr/bin/ld: libbrlcad.so: undefined reference to brl_deflateInit_' /usr/bin/ld: libbrlcad.so: undefined reference to brl_deflateEnd'
/usr/bin/ld: libbrlcad.so: undefined reference to `brl_inflateInit_'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/generateDataTest.dir/build.make:111: src/generateDataTest] Error 1
make[1]: *** [CMakeFiles/Makefile2:145: src/CMakeFiles/generateDataTest.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

view this post on Zulip Himanshu (Mar 08 2024 at 18:11):

Again build moose then install it.

view this post on Zulip Himanshu (Mar 08 2024 at 18:12):

Make sure you include brlcad in your path shell.

view this post on Zulip Vidit Jain (Mar 09 2024 at 05:00):

I have built it again and added brlcad build bin directory to the path but still its not installing

view this post on Zulip Vidit Jain (Mar 09 2024 at 05:03):

Daniel Rossberg said:

Vidit Jain, you have to install brlcad too: make install
Install it to a directory, where you have write rights, e.g. /home/vidit/bin/brlcad. The CMake brlcad detection script expects the directory structure from an installation.

In addition, you should include the brlcad bin directory (/home/vidit/bin/brlcad/bin?) in your PATH shell environment variable. This way, it's easier to work with the many BRL-CAD programs ... and you don't need to set anything in CMake, because the brlcad-config script will automatically detected and all necessary information retrieved from it.

Unfortunately, there is no brlcad-config for Windows.

I have shifted everything to this directory as well.. now I am building everything from scratch again

view this post on Zulip Vidit Jain (Mar 09 2024 at 05:03):

ig this time it should work

view this post on Zulip Himanshu (Mar 09 2024 at 05:06):

How you are setting path?

view this post on Zulip Vidit Jain (Mar 09 2024 at 05:07):

Himanshu Sekhar Nayak said:

How you are setting path?

PATH=$PATH:/your/directory/path

by using this command.. is this correct?

view this post on Zulip Vidit Jain (Mar 09 2024 at 05:07):

export PATH=$PATH:/your/directory/path

view this post on Zulip Himanshu (Mar 09 2024 at 05:07):

export PATH="/home/vidit/bin/brlcad/bin:$PATH"

view this post on Zulip Vidit Jain (Mar 09 2024 at 05:08):

my bin folder is in build directory? is this the same bin folder?

view this post on Zulip Himanshu (Mar 09 2024 at 05:10):

Vidit Jain said:

my bin folder is in build directory? is this the same bin folder?

You mean /home/vidit/bin ?

view this post on Zulip Vidit Jain (Mar 09 2024 at 05:11):

No, /home/vidit/bin/brlcad/bin the last bin?

view this post on Zulip Himanshu (Mar 09 2024 at 05:13):

If you did make install after building brlcad then /home/vidit/bin/brlcad/bin should be present. Now only thing you have to do is to set the path and build moose and install.

view this post on Zulip Vidit Jain (Mar 09 2024 at 05:13):

Let me try it

view this post on Zulip Vidit Jain (Mar 09 2024 at 05:15):

should I run

make install

in base directory or build directory?

view this post on Zulip Himanshu (Mar 09 2024 at 05:15):

Vidit Jain said:

should I run

make install

in base directory or build directory?

In build directory.

view this post on Zulip Vidit Jain (Mar 10 2024 at 09:23):

It is successfully executing but its not making any bin directory

view this post on Zulip Vidit Jain (Mar 10 2024 at 09:35):

Can you please help @Himanshu Sekhar Nayak

view this post on Zulip Daniel Rossberg (Mar 10 2024 at 11:21):

Hmm, strange. You are on Linux? Where is your installation directory? How did you set it?

view this post on Zulip Vidit Jain (Mar 10 2024 at 11:47):

Daniel Rossberg said:

Hmm, strange. You are on Linux? Where is your installation directory? How did you set it?

Yes I am on linux. My vase directory is desktop/brlcad . I firstly followed the compiling guidelines to compile brlcad. I than compiled it successfully. Than I installed it using sudo make install. But no bin folder is formed

view this post on Zulip Daniel Rossberg (Mar 10 2024 at 12:35):

In this case, you installed brlcad into a different directory. In fact a directory, where you need install privileges.

The install directory is set in CMake via the CMAKE_INSTALL_PREFIX (I think) variable. What is its value? You can keep it or change it to a folder where you don't need root privileges.

BTW, when running make install, its output tells you where it copies the files.

view this post on Zulip Vidit Jain (Mar 12 2024 at 15:51):

@Himanshu Sekhar Nayak @Daniel Rossberg
after running make installed, it got installed a directory /usr/brlcad/rel-7.38.1/bin and a bin folder was also there.. is this the currect bin?

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:02):

Even after adding it to the path its giving the same error
image.png

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:03):

@Himanshu Sekhar Nayak

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:04):

This is while running make install on moose

view this post on Zulip Himanshu (Mar 12 2024 at 16:05):

Do echo $PATH and see if /usr/brlcad/rel-7.38.1/bin is there or not.

view this post on Zulip Himanshu (Mar 12 2024 at 16:08):

Wait! If you did make install then in /usr/bin/ brlcad should be there.

view this post on Zulip Himanshu (Mar 12 2024 at 16:11):

During install did you see where your files being copied to?

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:22):

Screenshot-from-2024-03-13-02-47-58.png
This is a screenshot which I have

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:22):

Himanshu Sekhar Nayak said:

Wait! If you did make install then in /usr/bin/ brlcad should be there.

No, BRL-CAD is not there

view this post on Zulip Himanshu (Mar 12 2024 at 16:23):

Did you check if that path is set by doing echo $PATH?

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:23):

yes.. its not there

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:23):

ig that command that you told for setting path is not working

view this post on Zulip Himanshu (Mar 12 2024 at 16:24):

Vidit Jain said:

yes.. its not there

That's why moose is complaining about the files not found.

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:24):

Is there any way I can do it through gui?

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:24):

I found it.. wait

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 16:24):

You have probably to start your MOOSE build from scratch. I.e., rerun CMake from scratch.

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 16:25):

brlcad looks okay

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:33):

When I am creating a path, its there in the memory for that terminal, but when I am doing it in another terminal window its not there. Ig the path is not getting stored

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 16:35):

Which shell do you use? Bash?

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:35):

Yes

view this post on Zulip Sean (Mar 12 2024 at 16:35):

How did you create the path?

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:36):

export PATH="/home/vidit/bin/brlcad/bin:$PATH"

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:36):

this way

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 16:36):

There is a file /home/vidit/.bashrc.

view this post on Zulip Sean (Mar 12 2024 at 16:39):

You can put the export in that file and it will be set for all bash sessions

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:39):

yes it is there

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:40):

I am putting it in that

view this post on Zulip Sean (Mar 12 2024 at 16:40):

You can confirm it works by running “rt” with no arguments

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 16:41):

write there

PATH="/usr/brlcad/rel-7.38.1/bin:$PATH"
export PATH

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:45):

Screenshot-from-2024-03-13-03-44-38.png
I did that but still its not there

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 16:46):

Open a new shell ;)

view this post on Zulip Sean (Mar 12 2024 at 16:46):

You didn’t open a new terminal..

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 16:46):

The script is run only once when the shell opens.

view this post on Zulip Sean (Mar 12 2024 at 16:47):

“source .bashrc” to load into an already existing terminal

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:47):

Screenshot-from-2024-03-13-03-46-08.png
Screenshot-from-2024-03-13-03-47-00.png

I opened a new terminal as well, but still

view this post on Zulip Sean (Mar 12 2024 at 16:48):

It’s there at the front

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 16:48):

The path looks good, doesn't it?

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:49):

Ohh yaa, my bad! sorry

view this post on Zulip Sean (Mar 12 2024 at 16:49):

What does rt output?

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:50):

I am not sure about your question. Can you please tell me what is rt?

view this post on Zulip Sean (Mar 12 2024 at 16:50):

Should be vers

view this post on Zulip Sean (Mar 12 2024 at 16:51):

Run “rt”

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:52):

Sean said:

Should be vers

Screenshot-from-2024-03-13-03-51-38.png

view this post on Zulip Sean (Mar 12 2024 at 16:52):

Excellent that’s confirmed

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:53):

Thanks a lot

view this post on Zulip Sean (Mar 12 2024 at 16:53):

Notice the version and build info matches what you’re expecting

view this post on Zulip Sean (Mar 12 2024 at 16:54):

If you run “which rt” that will confirm that it’s coming from the right install t

view this post on Zulip Sean (Mar 12 2024 at 16:55):

Location

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:55):

Yes, after running which rt I got usr/brlcad/rel-7.38.1/bin/rt

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:56):

Also while building should I specify brlcad vcersion?

view this post on Zulip Vidit Jain (Mar 12 2024 at 16:56):

I am talking about moose

Vidit Jain said:

Also while building should I specify brlcad vcersion?

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 16:57):

There should be no need to specify anything, because brlcad-config should be found.

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:07):

Screenshot-from-2024-03-13-04-06-33.png

Still the same error while building moose :sob:

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:10):

You didn't started from scratch. It refers to the header files in your build directory. Instead, it should refer to /usr/brlcad/rel-7.38.1 now.

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:12):

I started from scratch only.. I cloned it in the brlcad folder on my desktop. Should I try it in other location?

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:17):

In your screenshot, I see references to /home/vidit/Desktop/brlcad/include/bu/bitv.h. But, your MOOSE build should not know about /home/vidit/Desktop/brlcad. Instead, it should know /usr/brlcad/rel-7.38.1.

Therefore, clean up your MOOSE build directory before running CMake again.

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:21):

I cloned the moose again, but still its refering to that only.. may be its because of the wrong PATHs that I setup earlier?

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:25):

But when I am checking .bashrc, there are no other variables

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:25):

What do you mean by "clone again"? git clone? That's not necessary, because you didn't change anything. Just remove everything what's not in the repository.

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:26):

Where is your MOOSE source directory? Where is your MOOSE build directory?

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:26):

Daniel Rossberg said:

What do you mean by "clone again"? git clone? That's not necessary, because you didn't change anything. Just remove everything what's not in the repository.

Yaa I did git clone.

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:28):

Daniel Rossberg said:

Where is your MOOSE source directory? Where is your MOOSE build directory?

Base is on my desktop, and build is inside base

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:29):

Then, remove the build.

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:30):

So I should build and install in base directory itself?

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:31):

No. Remove the build directory and recreate it with CMake.

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:37):

Daniel Rossberg said:

No. Remove the build directory and recreate it with CMake.

By "create with CMake" what do you exactly mean? should I make it using mkdir or is there a way by which I can make it directly through CMake

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:38):

How did you your first run of CMake on MOOSE?

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:38):

i made a build folder first

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:39):

than I run "cmake .."

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:40):

Okay, then mkdir build, cd build, and cmake ...

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:40):

yes

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:44):

Still while running make install, refering to desktop one only

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:46):

Did you removed the old build directory first, before recreating it? Are you doing this in a new shell?

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:46):

Daniel Rossberg said:

Did you removed the old build directory first, before recreating it? Are you doing this in a new shell?

Yes I deleted that. I also created a new terminal

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:47):

Let me restart my system, that might help?

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:48):

What does CMake say? There should be a line with "Found BRL-CAD".

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:49):

Did you set en environment variable BRLCAD_ROOT?

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:49):

vidit-vidit-Dell-G15-5520.txt
This is the log that I got

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:50):

Daniel Rossberg said:

Did you set en environment variable BRLCAD_ROOT?

No, I didn't

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:52):

where should that variable say?

Daniel Rossberg said:

Did you set en environment variable BRLCAD_ROOT?

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:53):

The variable could be in the way.

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:53):

Okay, you have Found BRL-CAD 7.38.1 at /usr/brlcad/rel-7.38.1.

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:56):

If possible can we get on a gmeet and fix it? Only if it suits you. I can share my screen there.

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 17:58):

I have to stop for today.

The only issue I see is that you are using gcc 13.2.0 and I use gcc 12.2.0.
Maybe, @Himanshu Sekhar Nayak uses a 13 gcc too?

view this post on Zulip Vidit Jain (Mar 12 2024 at 17:59):

Daniel Rossberg said:

I have to stop for today.

The only issue I see is that you are using gcc 13.2.0 and I use gcc 12.2.0.
Maybe, Himanshu Sekhar Nayak uses a 13 gcc too?

Ohh ok ok.. thanks a lot

view this post on Zulip Himanshu (Mar 12 2024 at 18:00):

Daniel Rossberg said:

I have to stop for today.

The only issue I see is that you are using gcc 13.2.0 and I use gcc 12.2.0.
Maybe, Himanshu Sekhar Nayak uses a 13 gcc too?

Mine is gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0. Using WSL.

view this post on Zulip Himanshu (Mar 12 2024 at 18:01):

@Vidit Jain I can help you to setup. May be not now. Tomorrow probably.

view this post on Zulip Vidit Jain (Mar 12 2024 at 18:02):

Himanshu Sekhar Nayak said:

Vidit Jain I can help you to setup. May be not now. Tomorrow probably.

Works. at what time?

view this post on Zulip Himanshu (Mar 12 2024 at 18:02):

Vidit Jain said:

Himanshu Sekhar Nayak said:

Vidit Jain I can help you to setup. May be not now. Tomorrow probably.

Works. at what time?

I will ping you.

view this post on Zulip Vidit Jain (Mar 12 2024 at 18:02):

Ohkk.. thanks

view this post on Zulip Himanshu (Mar 12 2024 at 18:03):

Strange thing is brl-cad build is failing for gdal for me.

view this post on Zulip Himanshu (Mar 12 2024 at 18:03):

Can't find gdal while building brlcad :face_with_peeking_eye: .

view this post on Zulip Daniel Rossberg (Mar 12 2024 at 18:06):

gdal is in src/other/ext.

view this post on Zulip Himanshu (Mar 12 2024 at 18:07):

Daniel Rossberg said:

gdal is in src/other/ext.

Hmm I see it's present but build failing not able to find. Strange.

view this post on Zulip Himanshu (Mar 12 2024 at 18:08):

Anyway, I am building it again. Reset everything and do cmake and then build.

view this post on Zulip Himanshu (Mar 12 2024 at 18:09):

Strange is that I got 3 times like this today. :neutral:

view this post on Zulip Sean (Mar 12 2024 at 20:17):

When in doubt, delete the build directory and rerun cmake. I think there are some situations where existing files affect subsequent cmake behavior.

view this post on Zulip Himanshu (Mar 13 2024 at 14:44):

@Daniel Rossberg Can you confirm if select mouse action is working in arbalest? I started fresh build of everything(brlcad, moose, arbalest).

view this post on Zulip Himanshu (Mar 13 2024 at 14:44):

From my side, it is not working.

view this post on Zulip Daniel Rossberg (Mar 13 2024 at 15:49):

Himanshu Sekhar Nayak said:

Daniel Rossberg Can you confirm if select mouse action is working in arbalest? I started fresh build of everything(brlcad, moose, arbalest).

It works, at least on Debian bookworm (fresh build). A fresh Windows build is still running.

view this post on Zulip Himanshu (Mar 13 2024 at 17:06):

Daniel Rossberg said:

Himanshu Sekhar Nayak said:

Daniel Rossberg Can you confirm if select mouse action is working in arbalest? I started fresh build of everything(brlcad, moose, arbalest).

It works, at least on Debian bookworm (fresh build). A fresh Windows build is still running.

Okay, it is working for me now. I saw that at that time I didn't hide my taskbar and doing selection and it is not working. Now I hide the taskbar, it works. Strange. :face_with_peeking_eye:

view this post on Zulip Vidit Jain (Mar 15 2024 at 03:38):

image.png
I have built brlcad, moose and arbalest successfully but when I am trying to run arbalest Its showing this error

view this post on Zulip Vidit Jain (Mar 15 2024 at 03:40):

this time I am on windows

view this post on Zulip Daniel Rossberg (Mar 15 2024 at 07:58):

You can find the brlcad.dll in your MOOSE installation directory (lib subdirectory). Copy this DLL to where your arbalest.exe is, or include your ~/MOOSE/lib directory in your path environment variable.

view this post on Zulip Vidit Jain (Mar 15 2024 at 08:33):

Ya its working now.. thanks a lot

view this post on Zulip Vidit Jain (Mar 15 2024 at 08:35):

Do we have some sample databses which I can test on arbalest?

view this post on Zulip Daniel Rossberg (Mar 15 2024 at 08:39):

Look at your brlcad installation directory at share/db.

view this post on Zulip Vidit Jain (Mar 15 2024 at 13:05):

Thanks! Also what will be the length of the "New BRL-CAD GUI" project if I get selected :sweat_smile: .

view this post on Zulip Himanshu (Mar 15 2024 at 13:07):

Vidit Jain said:

Thanks! Also what will be the length of the "New BRL-CAD GUI" project if I get selected :sweat_smile: .

It depends on the complexity of the feature that you propose. If we feel that you can implement a feature which is complex and going to take more time. Then length of the project can be changed.

view this post on Zulip Vidit Jain (Mar 15 2024 at 15:20):

I have been using arbalest for long today, and now I guess I am ready to dive into codebase, can you please help me from where should I start?

view this post on Zulip Vidit Jain (Mar 15 2024 at 15:31):

Where can I find .qmlproject file for arbalest?

view this post on Zulip Himanshu (Mar 15 2024 at 15:41):

The starting point of arbalest is main.cpp and for the interface(GUI) of arbalest you can find in MainWindow.cpp.

Vidit Jain said:

I have been using arbalest for long today, and now I guess I am ready to dive into codebase, can you please help me from where should I start?

view this post on Zulip Vidit Jain (Mar 15 2024 at 15:47):

Himanshu Sekhar Nayak said:

The starting point of arbalest is main.cpp and for the interface(GUI) of arbalest you can find in MainWindow.cpp.

Vidit Jain said:

I have been using arbalest for long today, and now I guess I am ready to dive into codebase, can you please help me from where should I start?

How can I open the project in Qt?

view this post on Zulip Himanshu (Mar 15 2024 at 15:48):

Vidit Jain said:

Himanshu Sekhar Nayak said:

The starting point of arbalest is main.cpp and for the interface(GUI) of arbalest you can find in MainWindow.cpp.

Vidit Jain said:

I have been using arbalest for long today, and now I guess I am ready to dive into codebase, can you please help me from where should I start?

How can I open the project in Qt?

You don't need to open the project in Qt. You can open in visual studio 2022 itself.

view this post on Zulip Himanshu (Mar 15 2024 at 15:49):

Open arbalest solution in visual studio then in your right side you can expand arbalest section to see source files.

view this post on Zulip Himanshu (Mar 15 2024 at 15:51):

You can try these issues https://github.com/BRL-CAD/arbalest/issues.

view this post on Zulip Himanshu (Mar 15 2024 at 15:52):

I know for now that raytrace function is working fine but the raytrace window where it is being displayed is not displaying properly.

view this post on Zulip Himanshu (Mar 15 2024 at 15:54):

You can see what I left during my time so that it will be better for you to start on a task or if you want to propose any new functionality. https://brlcad.org/wiki/User:H1manshu/GSoC2022/Project_Report

view this post on Zulip Vidit Jain (Mar 15 2024 at 17:38):

Thanks a lot

view this post on Zulip Vidit Jain (Mar 15 2024 at 19:11):

Screenshot-88.png
Screenshot-87.png

I was trying out this project. In raytracing view, it was the output. Can you please tell me what exactly is the issue in raytrace?

view this post on Zulip Vidit Jain (Mar 15 2024 at 19:14):

(deleted)

view this post on Zulip Himanshu (Mar 15 2024 at 19:18):

Change the camera view and ray trace.

Vidit Jain said:

Screenshot-88.png
Screenshot-87.png

I was trying out this project. In raytracing view, it was the output. Can you please tell me what exactly is the issue in raytrace?

view this post on Zulip Vidit Jain (Mar 15 2024 at 19:19):

You mean viewport?

view this post on Zulip Himanshu (Mar 15 2024 at 19:20):

Vidit Jain said:

You mean viewport?

Through dragging mouse left click, you can change too.

view this post on Zulip Himanshu (Mar 15 2024 at 19:22):

Idk actually, if it is an intended to function like this. Looks like whatever camera is looking only those things are getting raytraced, rest just got hide.

view this post on Zulip Himanshu (Mar 15 2024 at 19:23):

image.png
image.png

view this post on Zulip Vidit Jain (Mar 15 2024 at 19:24):

Also, for me its working only if one of the cordinate is 0 (when I am looking through one of the axis). On changing angle a little bit its turning all black.

view this post on Zulip Vidit Jain (Mar 15 2024 at 19:25):

Screenshot-89.png
Screenshot-90.png

view this post on Zulip Himanshu (Mar 15 2024 at 19:27):

Hmm, I see. Check if you can find the problem. RaytraceView.cpp might help you.

view this post on Zulip Himanshu (Mar 15 2024 at 19:27):

Is mouse selection working?

view this post on Zulip Vidit Jain (Mar 15 2024 at 19:28):

Himanshu Sekhar Nayak said:

Is mouse selection working?

No, its not working

view this post on Zulip Vidit Jain (Mar 15 2024 at 19:28):

Himanshu Sekhar Nayak said:

Hmm, I see. Check if you can find the problem. RaytraceView.cpp might help you.

I am seeing that only

view this post on Zulip Himanshu (Mar 15 2024 at 19:29):

Vidit Jain said:

Himanshu Sekhar Nayak said:

Is mouse selection working?

No, its not working

Strange. Happening for me too in windows. Idk why.

view this post on Zulip Vidit Jain (Mar 15 2024 at 19:52):

Now its working properly for every angle

view this post on Zulip Vidit Jain (Mar 15 2024 at 19:52):

Himanshu Sekhar Nayak said:

Idk actually, if it is an intended to function like this. Looks like whatever camera is looking only those things are getting raytraced, rest just got hide.

Ig it is intended to function like this only. @Sean @Daniel Rossberg if you can tell

view this post on Zulip Daniel Rossberg (Mar 17 2024 at 11:47):

I don't know if this is related, but there was a problem with the start plane of the ray-trace. It can be inside or behind the geometry.

view this post on Zulip Sean (Mar 23 2024 at 21:28):

@Vidit Jain the raytrace viewport should match what's displayed in the wireframe, at least that would be my expectation. As daniel implied, it might simply be an issue of needing to move the camera backwards, outside of the model. That should be a pretty simple change if it's not doing that already.

view this post on Zulip Daniel Rossberg (Mar 24 2024 at 16:30):

@Vidit Jain, before implementing higher features, you should think about fixing and completing the basic ones. Some keywords:

view this post on Zulip Vidit Jain (Mar 26 2024 at 03:23):

I want to see moc files and for that I have to open the project in qt. Can you please help me with that @Himanshu Sekhar Nayak ?

view this post on Zulip Vidit Jain (Mar 26 2024 at 03:23):

Daniel Rossberg said:

Vidit Jain, before implementing higher features, you should think about fixing and completing the basic ones. Some keywords:

I am updating my proposal, I will send it once I will edit it after adding all these things

view this post on Zulip Daniel Rossberg (Mar 26 2024 at 07:52):

Vidit Jain said:

I want to see moc files and for that I have to open the project in qt. Can you please help me with that Himanshu Sekhar Nayak ?

??? In MS Visual Studio, they are included in the project sources. In Linux with gcc and make, they are in the build directory's include subdirectory.

view this post on Zulip Vidit Jain (Mar 26 2024 at 08:22):

Daniel Rossberg said:

Vidit Jain said:

I want to see moc files and for that I have to open the project in qt. Can you please help me with that Himanshu Sekhar Nayak ?

??? In MS Visual Studio, they are included in the project sources. In Linux with gcc and make, they are in the build directory's include subdirectory.

When I am opening those files in visual studio, a blanck screen is coming, with no code

view this post on Zulip Daniel Rossberg (Mar 26 2024 at 09:48):

Some of them are empty, i.e., there is nothing to moc. However, some of them have code, e.g. moc_CollapsibleWidget.cpp.

view this post on Zulip Daniel Rossberg (Apr 04 2024 at 14:12):

Hi @Vidit Jain, to complete your application, you should provide a patch. Sean came up with some ideas regarding such patches. However, because you want to work on the GUI, I would like to see a patch for arbalest, which shows that you are able to work on it. Is there something, which can easily improved?

view this post on Zulip Vidit Jain (Apr 05 2024 at 03:20):

Daniel Rossberg said:

Hi Vidit Jain, to complete your application, you should provide a patch. Sean came up with some ideas regarding such patches. However, because you want to work on the GUI, I would like to see a patch for arbalest, which shows that you are able to work on it. Is there something, which can easily improved?

Thanks @Daniel Rossberg for considering. I cannot think of anything that can be easily improved as of now. If you have anything, than I can work on that or else I can start working on select primitive feature?

view this post on Zulip Himanshu (Apr 05 2024 at 13:29):

Vidit Jain said:

Daniel Rossberg said:

Hi Vidit Jain, to complete your application, you should provide a patch. Sean came up with some ideas regarding such patches. However, because you want to work on the GUI, I would like to see a patch for arbalest, which shows that you are able to work on it. Is there something, which can easily improved?

Thanks Daniel Rossberg for considering. I cannot think of anything that can be easily improved as of now. If you have anything, than I can work on that or else I can start working on select primitive feature?

One thing you can submit either:

  1. Check why mouse selection is not working in windows. You can debug and see.
  2. Once a new tab is created, you can activate mouse selection button and it stays active even if you close it. Same applies if you open a .obj file and activate the mouse selection and close the tab, the mouse selection stays active. Find a way to disable it.

view this post on Zulip Vidit Jain (Apr 08 2024 at 10:49):

Himanshu Sekhar Nayak said:

Vidit Jain said:

Daniel Rossberg said:

Hi Vidit Jain, to complete your application, you should provide a patch. Sean came up with some ideas regarding such patches. However, because you want to work on the GUI, I would like to see a patch for arbalest, which shows that you are able to work on it. Is there something, which can easily improved?

Thanks Daniel Rossberg for considering. I cannot think of anything that can be easily improved as of now. If you have anything, than I can work on that or else I can start working on select primitive feature?

One thing you can submit either:

  1. Check why mouse selection is not working in windows. You can debug and see.
  2. Once a new tab is created, you can activate mouse selection button and it stays active even if you close it. Same applies if you open a .obj file and activate the mouse selection and close the tab, the mouse selection stays active. Find a way to disable it.

I have started working on first one

view this post on Zulip Sean (Apr 08 2024 at 14:16):

Remember what I put in my earlier post also -- some code submission is vastly more important than no code submission. If you can't figure it out, work on something even simpler that is an improvement. If you can't figure out something GUI, work on something non-GUI. Something is absolutely better than nothing.

view this post on Zulip Vidit Jain (Apr 08 2024 at 17:09):

Sean said:

Remember what I put in my earlier post also -- some code submission is vastly more important than no code submission. If you can't figure it out, work on something even simpler that is an improvement. If you can't figure out something GUI, work on something non-GUI. Something is absolutely better than nothing.

Yes, I will keep it in mind.

view this post on Zulip Vidit Jain (Apr 09 2024 at 01:00):

Hey @Himanshu Sekhar Nayak, can you please tell me what all variables I have to setup in CMake while building Arbalest?

view this post on Zulip Himanshu (Apr 09 2024 at 04:31):

Vidit Jain said:

Hey Himanshu Sekhar Nayak, can you please tell me what all variables I have to setup in CMake while building Arbalest?

BRLCAD_BASE_DIR, BRLCAD_VERSION, BRLCAD_MOOSE_DIR, BRLCAD_MOOSE_INCLUDE_DIR.

view this post on Zulip Daniel Rossberg (Apr 09 2024 at 06:21):

Himanshu Sekhar Nayak said:

Vidit Jain said:

Hey Himanshu Sekhar Nayak, can you please tell me what all variables I have to setup in CMake while building Arbalest?

BRLCAD_BASE_DIR, BRLCAD_VERSION, BRLCAD_MOOSE_DIR, BRLCAD_MOOSE_INCLUDE_DIR.

Not really. Arbalest links with MOOSE. Therefore, you may need to set BRLCAD_MOOSE_DIR. See the error message in your CMake configuration. It should mention it.

view this post on Zulip Daniel Rossberg (Apr 09 2024 at 06:22):

The other variables are used during the MOOSE build.

view this post on Zulip Daniel Rossberg (Apr 09 2024 at 06:22):

... or set automatically.

view this post on Zulip Himanshu (Apr 10 2024 at 04:02):

I gave all the variables from building moose to arbalest :sweat_smile:

view this post on Zulip Vidit Jain (Apr 11 2024 at 06:16):

I was thinking of this one patch where when on home screen, we have list of shortcuts but we can't just click on the text there to use it.. like in vscode we can have that functionality..
Screenshot-2024-04-11-114245.png

view this post on Zulip Vidit Jain (Apr 11 2024 at 06:16):

@Daniel Rossberg

view this post on Zulip Daniel Rossberg (Apr 11 2024 at 06:22):

Hmm, maybe. What shall happen if somebody clicks on "Left Mouse Button"?

view this post on Zulip Vidit Jain (Apr 11 2024 at 06:24):

Ya.. thats something we have to look into but for creating and opening new file.. that will be useull

view this post on Zulip Vidit Jain (Apr 11 2024 at 06:27):

One solution I can think of is we can categories them in some other section. That section will not be clickable.

view this post on Zulip Vidit Jain (Apr 11 2024 at 06:28):

We can use different colours to segregate.

view this post on Zulip Daniel Rossberg (Apr 11 2024 at 06:37):

Currently, it is a simple help page. You want to turn it into a start page. Good.

A "What do you want to do" at the top? Followed by a short help section, with the most important shortcuts ans mouse gestures? Okay, make a proposal (PR, show me your code ;).

view this post on Zulip Vidit Jain (Apr 13 2024 at 06:33):

I started the implenting it. So the way in which I am implementing it was in
HelpWidget.cpp

I added an <a> tag to the Ctrl+N

HelpWidget::HelpWidget() : QVBoxWidget() {

    setObjectName("helpWidget");

    QVBoxWidget* container = new QVBoxWidget();

    QString
        text = "New File  <a href=\"Ctrl+N\" style=\"color:$Color-ColorText\">Ctrl+N</a> <br><br>"
        "Open File  <a href=\"Ctrl+O\" style=\"color:$Color-ColorText\">Ctrl+O</a> <br><br>"
        "Save File  <a href=\"Ctrl+S\" style=\"color:$Color-ColorText\">Ctrl+S</a> <br><br>"
        "<br><br>"
        "Drag with <font style=\"color:$Color-ColorText\">Mouse Left Button</font> to rotate viewport camera<br><br>"
        "Drag with <font style=\"color:$Color-ColorText\">Mouse Right Button</font> to move viewport camera<br><br>"
        "Zoom In / Zoom Out <font style=\"color:$Color-ColorText\">Mouse Wheel</font> <br><br>"
        "<br><br>"
        "Focus camera on selected item <font style=\"color:$Color-ColorText\">F</font> <br><br>"
        "Focus camera on all visible items <font style=\"color:$Color-ColorText\">Ctrl+F</font> <br><br>"
        "Use keys <font style=\"color:$Color-ColorText\">1 2 3 4</font> to switch between viewports<br><br>"
        "Open all viewports in quad view <font style=\"color:$Color-ColorText\">5</font> <br><br>"
        "Toggle grid on / off <font style=\"color:$Color-ColorText\">G</font> <br><br>"
        "<br><br>"
        "Raytrace current viewport <font style=\"color:$Color-ColorText\">Ctrl+R</font> <br><br>";

    text = Globals::theme->process(text);

    QLabel* intro = new QLabel(text);
    //intro->setWordWrap(true);
    intro->setMargin(5);
    intro->setObjectName("helpWidget");
    intro->setTextFormat(Qt::RichText);
    intro->setTextInteractionFlags(Qt::TextBrowserInteraction);
    intro->setOpenExternalLinks(true);
    intro->setMargin(80);

    // Connect the link clicked signal to a slot
    connect(intro, SIGNAL(linkActivated(QString)), this, SLOT(onLinkClicked(QString)));

    container->addWidget(intro);
    QScrollArea* scrollArea = new QScrollArea();
    scrollArea->setObjectName("helpWidget");
    addWidget(scrollArea);
    scrollArea->setWidget(container);
}

void HelpWidget::onLinkClicked(const QString& link) {
    // Check if the link corresponds to Ctrl+N
    if (link == "Ctrl+N") {
        // Call your function for Ctrl+N here
        emit newFileRequested();
    }
}

void HelpWidget::newFileRequested() {

}

and now in MainWindow.cpp

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_mouseAction{nullptr}
{
    loadTheme();
    prepareUi();
    prepareDockables();

    connect(helpWidget, &HelpWidget::newFileRequested, this, &MainWindow::newFile);

    documentArea->addTab(new HelpWidget(), "Quick Start");
    if(QCoreApplication::arguments().length()>1){
        openFile(QString(QCoreApplication::arguments().at(1)));
    }
    Globals::mainWindow = this;
    setCentralWidget(helpWidget);
}

But its giving some weired error in qobject.h file "Unhandled exception at 0x00007FFB65CAA9A5 (Qt5Cored.dll) in arbalest.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF."

I have updated the corresponding .h files for the functions
@Daniel Rossberg can you please help

view this post on Zulip Daniel Rossberg (Apr 13 2024 at 14:48):

Hmm, where does the access violation occur? At which line of which file in arbalest?

view this post on Zulip Daniel Rossberg (Apr 13 2024 at 14:49):

Under which conditions does the access violation occur?

view this post on Zulip Himanshu (Apr 13 2024 at 17:00):

Vidit Jain said:

<a href=\"Ctrl+N\" style=\"color:$Color-ColorText\">Ctrl+N</a>

connect(helpWidget, &HelpWidget::newFileRequested, this, &MainWindow::newFile); how you are accessing helpWidget here?

view this post on Zulip Vidit Jain (Apr 13 2024 at 17:07):

Daniel Rossberg said:

Hmm, where does the access violation occur? At which line of which file in arbalest?

Its in qobject.h line number 264

view this post on Zulip Vidit Jain (Apr 13 2024 at 17:08):

Himanshu Sekhar Nayak said:

Vidit Jain said:

<a href=\"Ctrl+N\" style=\"color:$Color-ColorText\">Ctrl+N</a>

connect(helpWidget, &HelpWidget::newFileRequested, this, &MainWindow::newFile); how you are accessing helpWidget here?

I imported it

view this post on Zulip Vidit Jain (Apr 14 2024 at 08:06):

@Daniel Rossberg , I am not able to figure out anything yet..

view this post on Zulip Daniel Rossberg (Apr 14 2024 at 11:36):

Okay, three points:

  1. Describe, what I have to do, to reproduce the crash. Does it happen at program start? Or, where do I have to click?
  2. Run the program in the debugger. In Visual Studio it's the green triangle. Make sure that you start arbalest with it. How does the call stack look, when the program crashes?
  3. Provide us your full code, not only snippets:

    - Fork arbalest on github.
    - Create a branch in your fork, derived from the main branch, for your development.
    - After pushing the changes to your github fork, create a pull request, which we can evaluate.

BTW, I think I know what's wrong. The cause is in a part of the code, you haven't provided yet :wink:
It is however important for you to learn, how to work with code, treat bugs, give extensive reports... Knowing this, makes it much easier to mentor you.

view this post on Zulip Himanshu (Apr 14 2024 at 14:42):

Vidit Jain said:

Himanshu Sekhar Nayak said:

Vidit Jain said:

<a href=\"Ctrl+N\" style=\"color:$Color-ColorText\">Ctrl+N</a>

connect(helpWidget, &HelpWidget::newFileRequested, this, &MainWindow::newFile); how you are accessing helpWidget here?

I imported it

Imported it ?

view this post on Zulip Himanshu (Apr 14 2024 at 14:43):

As Daniel said, it will be best if you can send a PR in a separate branch. It will be easier to debug whole code instead of partial.

view this post on Zulip Himanshu (Apr 14 2024 at 17:04):

I guess <a href="Ctrl+N"> might not be a good solution here since it completely relies on a link. I tested this replacing Ctrl + N with www.google.com and guess what it is able to open a tab in browser and went to www.google.com but for Ctrl+N it shows ShellExecute 'Ctrl+N' failed (error 2).

view this post on Zulip Vidit Jain (Apr 14 2024 at 17:07):

Himanshu Sekhar Nayak said:

As Daniel said, it will be best if you can send a PR in a separate branch. It will be easier to debug whole code instead of partial.

I am creating a repo

view this post on Zulip Vidit Jain (Apr 14 2024 at 17:08):

Its giving some error.. fixing it and will send

view this post on Zulip Himanshu (Apr 14 2024 at 17:10):

This might be a good solution to implement own Clickable QLabel? I found a src Clickable QLabel - Qt Wiki

view this post on Zulip Vidit Jain (Apr 14 2024 at 17:19):

Himanshu Sekhar Nayak said:

This might be a good solution to implement own Clickable QLabel? I found a src Clickable QLabel - Qt Wiki

Ohh yes.. I am going through it once

view this post on Zulip Vidit Jain (Apr 14 2024 at 17:32):

https://github.com/ViditJain123/arbalest

this is the repo I am working in

view this post on Zulip Daniel Rossberg (Apr 14 2024 at 18:13):

:+1:
You should however create a branch for your development. Doing your changes in the main branch pollutes it and can make your fork unusable for the further development.

view this post on Zulip Vidit Jain (Apr 14 2024 at 18:14):

Ok ok..i will create a branch

view this post on Zulip Vidit Jain (Apr 15 2024 at 16:05):

Daniel Rossberg said:

Okay, three points:

  1. Describe, what I have to do, to reproduce the crash. Does it happen at program start? Or, where do I have to click?
  2. Run the program in the debugger. In Visual Studio it's the green triangle. Make sure that you start arbalest with it. How does the call stack look, when the program crashes?
  3. Provide us your full code, not only snippets:

    - Fork arbalest on github.
    - Create a branch in your fork, derived from the main branch, for your development.
    - After pushing the changes to your github fork, create a pull request, which we can evaluate.

BTW, I think I know what's wrong. The cause is in a part of the code, you haven't provided yet :wink:
It is however important for you to learn, how to work with code, treat bugs, give extensive reports... Knowing this, makes it much easier to mentor you.

Can you please tell me this now:sweat_smile:

view this post on Zulip Vidit Jain (Apr 15 2024 at 16:05):

I am not able to figure out

view this post on Zulip Vidit Jain (Apr 15 2024 at 16:05):

(deleted)

view this post on Zulip Himanshu (Apr 15 2024 at 17:24):

Vidit Jain said:

I am not able to figure out

You didn't send the PR from your branch?

view this post on Zulip Vidit Jain (Apr 15 2024 at 18:07):

Himanshu Sekhar Nayak said:

Vidit Jain said:

I am not able to figure out

You didn't send the PR from your branch?

Just sent it.

view this post on Zulip Vidit Jain (Apr 15 2024 at 18:19):

https://github.com/BRL-CAD/arbalest/pull/47

view this post on Zulip Himanshu (Apr 15 2024 at 18:23):

Vidit Jain said:

https://github.com/BRL-CAD/arbalest/pull/47

Edit your PR name something like Convert help page to start page or anything which is suitable ? Inside that PR, solution and error can remain.

view this post on Zulip Vidit Jain (Apr 15 2024 at 18:29):

Yaa.. I updated everything :sweat_smile:

view this post on Zulip Daniel Rossberg (Apr 15 2024 at 19:44):

I may need some time to review your PR... (other obligations, you know)

view this post on Zulip Vidit Jain (Apr 17 2024 at 17:53):

@Sean @Daniel Rossberg Did you go through my pr?

view this post on Zulip Daniel Rossberg (Apr 18 2024 at 15:14):

Not yet. This week is a very busy one. But, this is not your fault. You have provided a PR - and I hope to be able to review it at the weekend.

view this post on Zulip Vidit Jain (Apr 19 2024 at 04:12):

Daniel Rossberg said:

Not yet. This week is a very busy one. But, this is not your fault. You have provided a PR - and I hope to be able to review it at the weekend.

Ohh, never mind.

view this post on Zulip Himanshu (Apr 19 2024 at 10:09):

Vidit Jain said:

Sean Daniel Rossberg Did you go through my pr?

I am currently looking to your code.

view this post on Zulip Vidit Jain (Apr 20 2024 at 11:50):

@Himanshu Sekhar Nayak as you said in the comment of the pull request that I didn't initiate the pointer, I did so and the application is working fine now, though its not working as expected

view this post on Zulip Daniel Rossberg (Apr 20 2024 at 13:56):

@Vidit Jain, please, update your PR then.

view this post on Zulip Himanshu (Apr 20 2024 at 14:02):

Vidit Jain said:

Himanshu Sekhar Nayak as you said in the comment of the pull request that I didn't initiate the pointer, I did so and the application is working fine now, though its not working as expected

As I said earlier that QLabel::linkActivated might not be the best fit here since it relies on URLs only and it reports ShellExecute 'Ctrl+N' failed (error 2).

view this post on Zulip Himanshu (Apr 20 2024 at 14:03):

If you replace with any URL, it works but it is not what we expected.

view this post on Zulip Vidit Jain (Apr 20 2024 at 17:47):

Himanshu Sekhar Nayak said:

Vidit Jain said:

Himanshu Sekhar Nayak as you said in the comment of the pull request that I didn't initiate the pointer, I did so and the application is working fine now, though its not working as expected

As I said earlier that QLabel::linkActivated might not be the best fit here since it relies on URLs only and it reports ShellExecute 'Ctrl+N' failed (error 2).

Yes, it it reporting that. Should I try implementing it with Clickable QLabel? @Daniel Rossberg

view this post on Zulip Daniel Rossberg (Apr 21 2024 at 10:36):

Vidit Jain said:

Yes, it it reporting that. Should I try implementing it with Clickable QLabel? @Daniel Rossberg

This is not the point (yet) in your code.

Do you remember the three points I posted here? You fulfilled the third one, which es very helpful, but didn't managed the first two. For us, the first one is very important too: Describe in detail, what you did in the program (e.g.: start the program, click in the "X" button, click on the "Y" button) and what the result was (e.g.: crash with access violation).

A bit about your code (we can move this discussion to github, if you prefer this): You introduced a helpWidgetInstance pointer, but why? It's true that if you create a new pointer variable, than it's on you to initialize it. But in this case, I would say, going without it would be the better solution. If you want to know why, look, where the real instance of HelpWidget are created.

view this post on Zulip Vidit Jain (Apr 23 2024 at 16:03):

To reproduce the issue -
After setting up the arbalest properly, when you launch it debug mode, it will crash at the very beginning. This is due to the access violation.

Call stack -
HelpWidget was the last function called in the call stack so far I remember.

Yaa, I realised that creating a new pointer is not really necessary.. we can do it without creating the new pointer. I am thinking of a new approach.

While debugging the code, I realized that the approach that I was using to create the signal is working. The function that's doing that is not getting called only.

view this post on Zulip Vidit Jain (Apr 24 2024 at 05:36):

Vidit Jain said:

To reproduce the issue -
After setting up the arbalest properly, when you launch it debug mode, it will crash at the very beginning. This is due to the access violation.

Call stack -
HelpWidget was the last function called in the call stack so far I remember.

Yaa, I realised that creating a new pointer is not really necessary.. we can do it without creating the new pointer. I am thinking of a new approach.

While debugging the code, I realized that the approach that I was using to create the signal is working. The function that's doing that is not getting called only.

not working*

view this post on Zulip Daniel Rossberg (Apr 24 2024 at 07:26):

Good to hear that you were able to get the call stack.

Regarding the pointer initialization issue: To make it work, you have to make slight changes on your logic. But first, you need to understand, how the HelpWidget is created (used). Therefore, find the lines in the original code, where the HelpWidged is created/initialized (i.e., the calls of the constructor).

view this post on Zulip Amanjot Singh (May 03 2024 at 20:13):

@Vidit Jain firstly, congratulations on getting selected in Google Summer of Code 2024. During your contribution and pre contribution period @Himanshu and I will be directly mentoring you. Of course, Sean and Daniel will add their invaluable advice and suggestions. It's going to be fun working with you on new GUI of BRL-CAD.

We are now in the community bonding period. You will learn about how we will work and communicate throughout the contribution period. Remember, "proactive communication" helps solve and avoid many issues quickly and saves a lot of time. So keep the updates and conversations going here.

view this post on Zulip Vidit Jain (May 04 2024 at 06:58):

Thanks a lot @Amanjot Singh @Himanshu for selecting me. I am really very excited to work with you all and learn.

view this post on Zulip Vidit Jain (May 04 2024 at 06:59):

I will be very active in the community for sure and want to make the most out of this time for sure.

view this post on Zulip Vidit Jain (May 06 2024 at 15:33):

Hello mentors, actually, my end term exams are going on right now, so I am not able to contribute at the moment. Is it fine if I start contributing after 16th?

view this post on Zulip Daniel Rossberg (May 07 2024 at 07:19):

The official coding period starts at May 27th. Therefore, it is okay. You should however start discussing with your mentors earlier, e.g. about your PR, to get into the "flow".

view this post on Zulip Vidit Jain (May 18 2024 at 08:19):

Hey @Himanshu @Amanjot Singh , I am done with my exams now, and now I will start working again with full power. As @Daniel Rossberg said, I will start working on my earlier pr.

view this post on Zulip Amanjot Singh (May 21 2024 at 10:37):

@Vidit Jain I would encourage you to keep sharing your progress

view this post on Zulip Vidit Jain (May 21 2024 at 18:36):

Amanjot Singh said:

Vidit Jain I would encourage you to keep sharing your progress

I am working on the landing page.. mostly I will update the pr tomorrow

view this post on Zulip Vidit Jain (May 21 2024 at 18:37):

Himanshu said:

I have updated GSoC 2024 wiki page where you can add your dev log, project plan and abstract. Here are some samples you can see from past years. 2023, 2022.

Ohh thanks

view this post on Zulip Vidit Jain (May 23 2024 at 12:30):

I wanted to make a new header file for clickable text, how can I include it in the build process?
@Amanjot Singh @Himanshu

view this post on Zulip Himanshu (May 24 2024 at 03:30):

Vidit Jain said:

I wanted to make a new header file for clickable text, how can I include it in the build process?
Amanjot Singh Himanshu

You have to add the .cpp file inside CMakeLists.txt to add it into the build process.

view this post on Zulip Vidit Jain (May 24 2024 at 03:30):

What about .h files?

view this post on Zulip Himanshu (May 24 2024 at 03:32):

Vidit Jain said:

What about .h files?

You don't have to explicitly list header files.

view this post on Zulip Himanshu (May 24 2024 at 03:34):

CMake manages dependencies and its primary focus on building executables and libraries from source files. Header files are included by source files, and the compiler automatically processes them as part of the source file compilation. So, header files don’t need separate compilation rules.

view this post on Zulip Himanshu (May 24 2024 at 17:14):

@Vidit Jain what's the current progress?

view this post on Zulip Vidit Jain (May 24 2024 at 17:24):

I am currently working on my pr only, but I am stuck on the part where I have to send a signal from HelpWidget.cpp to MainWindow.cpp

view this post on Zulip Vidit Jain (May 24 2024 at 17:25):

There is some or another error whenever I am trying any way to do the same

view this post on Zulip Vidit Jain (May 25 2024 at 11:26):

Can you please tell what should be the best approach to do that.. I can't figure it out.
Thanks

view this post on Zulip Himanshu (May 25 2024 at 13:20):

Vidit Jain said:

Can you please tell what should be the best approach to do that.. I can't figure it out.
Thanks

Did you find the places where HelpWidget will be created?

view this post on Zulip Vidit Jain (May 25 2024 at 13:25):

What do you mean by places?

view this post on Zulip Vidit Jain (May 25 2024 at 13:26):

Helpwidget is rendering at the start of application. Thats the only place where I can see it

view this post on Zulip Himanshu (May 25 2024 at 13:30):

I mean where the connection between ctrlNPressed() and newFile() can be made there.

view this post on Zulip Vidit Jain (May 25 2024 at 13:56):

So my was when Ctrl+N will be clicked, it will create a signal and the MainWindow.cpp will catch it and will execute a functin which it already has which is newFile, but the signal is not emitting only and there is no connection that's getting established :(.. there are no logs in terminal so I can't figure out anything while even debugging

view this post on Zulip Himanshu (May 25 2024 at 14:14):

Vidit Jain said:

So my was when Ctrl+N will be clicked, it will create a signal and the MainWindow.cpp will catch it and will execute a functin which it already has which is newFile, but the signal is not emitting only and there is no connection that's getting established :frown:.. there are no logs in terminal so I can't figure out anything while even debugging

If you want to see logs in terminal. Use qDebug() << "Check"; and include QDebug. In this way, you can check if a connection is made or not.

view this post on Zulip Himanshu (May 25 2024 at 14:19):

@Vidit Jain okay I debugged it now and found something.

view this post on Zulip Himanshu (May 25 2024 at 14:21):

I saw intro->setOpenExternalLinks(true); which is set to true in HelpWidget.cpp. Making it false enables us that the QLabel handles link clicks internally rather than delegating them to the system's default web browser.

view this post on Zulip Himanshu (May 25 2024 at 14:23):

When setOpenExternalLinks is set to true, the QLabel opens the link in an external web browser, bypassing the linkActivated signal and preventing our custom slot from being called.

view this post on Zulip Himanshu (May 25 2024 at 14:24):

@Vidit Jain Now your code will work as expected I guess because I guess so far you have already made the connection.

view this post on Zulip Himanshu (May 25 2024 at 14:26):

For your reference setOpenExternalLinks QLabel Class | Qt Widgets 5.15.17

view this post on Zulip Vidit Jain (May 25 2024 at 15:37):

Thanks, finally it worked!

view this post on Zulip Vidit Jain (May 25 2024 at 15:37):

Thanks a lot

view this post on Zulip Vidit Jain (May 25 2024 at 15:49):

In my final commit I have updated the code.. looking forward for the review.
Thanks

view this post on Zulip Daniel Rossberg (May 25 2024 at 16:29):

Okay, a first review. @Vidit Jain, I start always with a look at formal things. There I see, that you mixed stylistic with functional changes. You should not do this. Create separate pull requests for stylistic and functional changes. Because your PR is about adding new functionality, you should revert all stylistic/white space changes.

view this post on Zulip Himanshu (May 25 2024 at 19:35):

@Vidit Jain I want something you to move that connect inside MainWindow constructor to HelpWidget constructor. So that HelpWidget takes its parent widget as a parameter in its constructor, and the signal-slot connection is made within the HelpWidget itself. This makes HelpWidget more self-contained and easier to manage.

view this post on Zulip Himanshu (May 26 2024 at 05:55):

@Vidit Jain I made a review on your PR. Make those changes and then we can focus on next things.

view this post on Zulip Himanshu (May 26 2024 at 06:03):

@Daniel Rossberg Since MainWindow::newFile() is private. So how we are going to connect inside HelpWidgetconstructor so that it can call newFile() whenever Ctrl+N is clicked?

view this post on Zulip Daniel Rossberg (May 26 2024 at 13:40):

Himanshu said:

Daniel Rossberg Since MainWindow::newFile() is private. So how we are going to connect inside HelpWidgetconstructor so that it can call newFile() whenever Ctrl+N is clicked?

You, or @Vidit Jain, should move newFile() to the public slots.

view this post on Zulip Vidit Jain (May 27 2024 at 12:28):

(deleted)

view this post on Zulip Vidit Jain (May 27 2024 at 12:53):

Can I create a new pull request? My older one is a little messed up :)

view this post on Zulip Daniel Rossberg (May 27 2024 at 16:01):

Sure.

view this post on Zulip Vidit Jain (May 27 2024 at 16:48):

I have created a more cleaner pull request

view this post on Zulip Himanshu (May 27 2024 at 17:00):

Vidit Jain said:

I have created a more cleaner pull request

What about the changes that I commented in the review? Did you see it? I saw whitespace thing is gone. I guess you are already working on it that I gave feedback.

view this post on Zulip Himanshu (May 27 2024 at 17:01):

Also close that old PR too.

view this post on Zulip Vidit Jain (May 27 2024 at 17:08):

I am working on the changes you asked me to make. I will close the older PR.

view this post on Zulip Vidit Jain (May 28 2024 at 03:09):

I have made all the changes that were suggested in my latest commit. @Himanshu @Daniel Rossberg

view this post on Zulip Himanshu (May 28 2024 at 06:07):

@Daniel Rossberg I had tested the new changes and it's working as expected. I saw the code too and it's fine. You can check the PR and merge it.

view this post on Zulip Daniel Rossberg (May 28 2024 at 07:24):

Hmm, couldn't line 45 in MainWindow.cpp simply be documentArea->addTab(new HelpWidget(this), "Quick Start");?

The HelpWidget* helpWidget; in MainWindow.h isn't needed, or? It isn't updated in MainWindow.cpp line 595 anyway.

In HelpWidget.cpp, parent is casted to MainWindow. I would prefer using the SIGNAL and SLOT macros here: connect(this, SIGNAL(ctrlNClicked), parent, SLOT(newFile));.

view this post on Zulip Himanshu (May 28 2024 at 07:37):

Daniel Rossberg said:

Hmm, couldn't line 45 in MainWindow.cpp simply be documentArea->addTab(new HelpWidget(this), "Quick Start");?

The HelpWidget* helpWidget; in MainWindow.h isn't needed, or? It isn't updated in MainWindow.cpp line 595 anyway.

In HelpWidget.cpp, parent is casted to MainWindow. I would prefer using the SIGNAL and SLOT macros here: connect(this, SIGNAL(ctrlNClicked), parent, SLOT(newFile));.

Hmm, I see. Unnecessarily we are taking HelpWidget* helpWidget;. It can be removed. And regarding dynamic casting that thing is also not needed I see now. Both can be removed.

view this post on Zulip Himanshu (May 28 2024 at 07:57):

@Daniel Rossberg I wrote like this connect(this, &HelpWidget::ctrlNClicked, parent, &MainWindow::newFile); and got error 'QObject::connect': no overloaded function could convert all the argument types. I guess there is no context in which this conversion is possible so it throws error.

view this post on Zulip Daniel Rossberg (May 28 2024 at 08:41):

Himanshu said:

Daniel Rossberg I wrote like this connect(this, &HelpWidget::ctrlNClicked, parent, &MainWindow::newFile); and got error 'QObject::connect': no overloaded function could convert all the argument types. I guess there is no context in which this conversion is possible so it throws error.

Of course, we have to use the SIGNAL and SLOT macros then, as I did in my example. (Okay, which isn't correct to, because I omitted the parameters of the signal and slot.)

view this post on Zulip Vidit Jain (May 28 2024 at 10:16):

I made all the suggested changes in my latest commit

view this post on Zulip Daniel Rossberg (May 28 2024 at 12:38):

Almost:

        MainWindow* mainWindow = qobject_cast<MainWindow*>(parent);
            if (mainWindow) {

in HelpWidget.cpp anymore. The SIGNAL and SLOT macros will take care that it connects with existing functions only.

view this post on Zulip Vidit Jain (May 28 2024 at 14:47):

I have fixed everything in this commit

view this post on Zulip Vidit Jain (May 28 2024 at 15:10):

I was trying to use the select primitive feature of arbalest. For me its working fine.. can you tell me what exactly the issue is?
I am thinking of taking up that issue next. If you all want we can work on something else as well. @Himanshu @Daniel Rossberg @Amanjot Singh

view this post on Zulip Himanshu (May 28 2024 at 15:16):

Vidit Jain said:

I was trying to use the select primitive feature of arbalest. For me its working fine.. can you tell me what exactly the issue is?
I am thinking of taking up that issue next. If you all want we can work on something else as well. Himanshu Daniel Rossberg Amanjot Singh

Yes, the mouse select option is working I saw it today. It doesn't work for me when it is full screen idk why but works fine when I restore down.

view this post on Zulip Daniel Rossberg (May 28 2024 at 16:51):

Vidit Jain said:

I have fixed everything in this commit

Hmm, MainWindow.h has still the #include "HelpWidget.h".

And in HelpWidget.h:

view this post on Zulip Daniel Rossberg (May 28 2024 at 16:59):

Vidit Jain said:

I was trying to use the select primitive feature of arbalest. For me its working fine.. can you tell me what exactly the issue is?
I am thinking of taking up that issue next. If you all want we can work on something else as well. Himanshu Daniel Rossberg Amanjot Singh

Yes, it works, but it could do better. E.g., show all regions on the ray (in a dialog box?), and highlight the selected regions in the graphics view.

view this post on Zulip Himanshu (May 29 2024 at 04:52):

@Vidit Jain You can also start on after selecting the primitive there should be an option to resize the primitive too. This idea is also good.

view this post on Zulip Himanshu (May 29 2024 at 04:54):

@Daniel Rossberg I noticed we can extend object-oriented C++ Geometry API. But I forgot where to look on to start with.

view this post on Zulip Daniel Rossberg (May 29 2024 at 06:41):

Do you refer to MOOSE? Its build is currently broken, because of the changes for externals in the brlcad repository. I've a work-around, which works at least for Linux, but haven't committed it yet. The real fix needs some time.

view this post on Zulip Vidit Jain (May 29 2024 at 11:34):

Daniel Rossberg said:

Vidit Jain said:

I have fixed everything in this commit

Hmm, MainWindow.h has still the #include "HelpWidget.h".

And in HelpWidget.h:

When I am removing import "Helpwidget.h" from MainWindow.h, its giving error in MainWindow.cpp at All places where we are using new HelpWidget(this).

view this post on Zulip Himanshu (May 29 2024 at 11:44):

Daniel Rossberg said:

Do you refer to MOOSE? Its build is currently broken, because of the changes for externals in the brlcad repository. I've a work-around, which works at least for Linux, but haven't committed it yet. The real fix needs some time.

Yes, but idk that moose build is currently broken for linux. Working fine in Windows.

view this post on Zulip Himanshu (May 29 2024 at 11:55):

Vidit Jain said:

Daniel Rossberg said:

Vidit Jain said:

I have fixed everything in this commit

Hmm, MainWindow.h has still the #include "HelpWidget.h".

And in HelpWidget.h:

When I am removing import "Helpwidget.h" from MainWindow.h, its giving error in MainWindow.cpp at All places where we are using new HelpWidget(this).

Remove MainWindow.h from HelpWidget.cpp. Now it will work.

view this post on Zulip Daniel Rossberg (May 29 2024 at 13:08):

Himanshu said:

Daniel Rossberg said:

Do you refer to MOOSE? Its build is currently broken, because of the changes for externals in the brlcad repository. I've a work-around, which works at least for Linux, but haven't committed it yet. The real fix needs some time.

Yes, but idk that moose build is currently broken for linux. Working fine in Windows.

With the new build, some static libraries are missing. If you haven't cleaned up your your install directory, they may be still there. So, be happy that it still works for you :wink:

view this post on Zulip Vidit Jain (Jun 01 2024 at 04:52):

I have updated the PR here

view this post on Zulip Daniel Rossberg (Jun 01 2024 at 12:28):

@Vidit Jain: See my first comment in https://brlcad.zulipchat.com/#narrow/stream/111975-Google-Summer-of-Code/topic/New.20BRL-CAD.20GUI/near/441078691
Beside this, it looks okay.

view this post on Zulip Himanshu (Jun 01 2024 at 13:37):

If we are removing that default constructor from HelpWidget then I see creating HelpWidget object by dynamically casting from documentArea will be useless. Here in this code:

connect(helpAct, &QAction::triggered, this, [this](){
    HelpWidget * helpWidget = dynamic_cast<HelpWidget*>(documentArea->widget(0));
    if (helpWidget== nullptr){
        documentArea->insertTab(0, new HelpWidget(this), "Quick Start");
    }
    documentArea->setCurrentIndex(0);
});

view this post on Zulip Daniel Rossberg (Jun 01 2024 at 15:56):

Hmm, can you explain this in more detail? A cast doesn't create an object, and it seems to work well without the default constructor. Removing it shall prevent accidentally calling it.

view this post on Zulip Himanshu (Jun 02 2024 at 19:42):

Daniel Rossberg said:

Hmm, can you explain this in more detail? A cast doesn't create an object, and it seems to work well without the default constructor. Removing it shall prevent accidentally calling it.

So that portion of code looks like after removing casting,

connect(helpAct, &QAction::triggered, this, [this](){
    documentArea->insertTab(0, new HelpWidget(this), "Quick Start");
    documentArea->setCurrentIndex(0);
});

view this post on Zulip Himanshu (Jun 02 2024 at 19:50):

So whenever we are going to create new HelpWidget we have to pass an object of type QWidget.

view this post on Zulip Daniel Rossberg (Jun 02 2024 at 20:49):

I still don't get it. The cast is to test, if there is a help widget in documentArea, and if there is one, if the first one is the help widget. If there is no help widget in documentArea, one will be created. This ensures that there is one help widget and it is the first one (index 0). Your code would always create a new help widget, ending up with many of them in the document area.

Passing this (which is of type MainWindow) ensures, that the correct actions will happen, if the user clicks on a link.

view this post on Zulip Himanshu (Jun 02 2024 at 20:53):

Daniel Rossberg said:

I still don't get it. The cast is to test, if there is a widget in documentArea, and if there is one, if the first one is the help widget. If there is no help widget in documentArea, one will be created. This ensures that there is a help widget and it is the first one (index 0). You code would always create a new help widget, ending up with many of them in the document area.

Passing this (which is of type MainWindow) ensures, that the correct actions will happen, if the user clicks on the links.

Oh, I understand now. That we need to check if already there is a Quick Start tab opened.

view this post on Zulip Vidit Jain (Jun 04 2024 at 09:35):

Hey @Daniel Rossberg ,
What should I work on next? I have these two options in my mind. Firstly, I noticed a bug with select primitive feature. It's not getting off when we are either changing or closing a document. Is it supposed to work like this, or is it a bug. Or I can start working on improving the same. There are some glitches going on in there.

view this post on Zulip Daniel Rossberg (Jun 04 2024 at 16:26):

I'm still waiting for the update of your PR regarding https://brlcad.zulipchat.com/#narrow/stream/111975-Google-Summer-of-Code/topic/New.20BRL-CAD.20GUI/near/441899050

view this post on Zulip Daniel Rossberg (Jun 04 2024 at 16:29):

Vidit Jain said:

Hey Daniel Rossberg ,
What should I work on next? I have these two options in my mind. Firstly, I noticed a bug with select primitive feature. It's not getting off when we are either changing or closing a document. Is it supposed to work like this, or is it a bug. Or I can start working on improving the same. There are some glitches going on in there.

@Himanshu, can you say something about the primitive select feature? Sounds like a bug to me(?)

view this post on Zulip Himanshu (Jun 04 2024 at 18:05):

Daniel Rossberg said:

Vidit Jain said:

Hey Daniel Rossberg ,
What should I work on next? I have these two options in my mind. Firstly, I noticed a bug with select primitive feature. It's not getting off when we are either changing or closing a document. Is it supposed to work like this, or is it a bug. Or I can start working on improving the same. There are some glitches going on in there.

Himanshu, can you say something about the primitive select feature? Sounds like a bug to me(?)

Yes, that select primitive button remains active even after document gets closed. I saw this problem during my gsoc time.

view this post on Zulip Himanshu (Jun 05 2024 at 21:29):

Daniel Rossberg said:

Vidit Jain said:

I have fixed everything in this commit

Hmm, MainWindow.h has still the #include "HelpWidget.h".

And in HelpWidget.h:

Now I understand what you asked :sweat_smile:. So if we are removing default HelpWidget constructor then in scenarios where a parent is not necessary or the widget is intended to be a top-level widget, having to always pass nullptr can be inconvenient and add verbosity to the code.

view this post on Zulip Himanshu (Jun 05 2024 at 21:30):

By not providing a default nullptr value for the parent parameter, we make it mandatory for users to always specify a parent or explicitly pass nullptr, which can reduce the convenience and readability of the code.

view this post on Zulip Himanshu (Jun 05 2024 at 21:37):

So we will face problem here:

connect(this, SIGNAL(ctrlNClicked()), parent, SLOT(newFile()));
connect(this, SIGNAL(ctrlOClicked()), parent, SLOT(openFileDialog()));

view this post on Zulip Daniel Rossberg (Jun 06 2024 at 07:37):

My point is that we think that every HelpWidget is a child of MainWindow. By not providing a default constructor for HelpWidged, the compiler will complain whenever this assumption isn't fulfilled.

In a previous version, parent was tested for nullptr. Then, I wanted a cast to be changed to the SIGNAL and SLOT macros ... but not the test for nullptr to be removed. It was however removed, but because we provide parent explicitly, I don't consider this as a problem. BTW, how does connect() handle nullptr?

view this post on Zulip Vidit Jain (Jun 06 2024 at 08:38):

I have updated my pr here

view this post on Zulip Daniel Rossberg (Jun 06 2024 at 09:02):

Thanks, I'll have a look at it.

view this post on Zulip Himanshu (Jun 06 2024 at 09:31):

Daniel Rossberg said:

My point is that we think that every HelpWidget is a child of MainWindow. By not providing a default constructor for HelpWidged, the compiler will complain whenever this assumption isn't fulfilled.

In a previous version, parent was tested for nullptr. Then, I wanted a cast to be changed to the SIGNAL and SLOT macros ... but not the test for nullptr to be removed. It was however removed, but because we provide parent explicitly, I don't consider this as a problem. BTW, how does connect() handle nullptr?

Here what I got if I pass nullptr:
image.png

view this post on Zulip Daniel Rossberg (Jun 06 2024 at 09:51):

That's okay. connect() checks the input and complains in the debug log, if there is something wrong with it, but doesn't crash.

view this post on Zulip Vidit Jain (Jun 07 2024 at 11:59):

When I building the latest merge.. its giving some errors after building .. I am looking into it

view this post on Zulip Vidit Jain (Jun 07 2024 at 12:05):

The only fix I can see is by adding "#include "HelpWidget.h" " in "MainWindow.h" . I don't why it is happening..
@Daniel Rossberg if you can help

view this post on Zulip Daniel Rossberg (Jun 07 2024 at 16:32):

Unfortunately, you removed the #include <include/HelpWidget.h> from MainWindow.cpp. I readded it.

view this post on Zulip Vidit Jain (Jun 07 2024 at 17:35):

Daniel Rossberg said:

Unfortunately, you removed the #include <include/HelpWidget.h> from MainWindow.cpp. I readded it.

I am really sorry, by mistake I removed it from MainWindow.cpp instead of MainWindow.h :smiling_face_with_tear:

view this post on Zulip Vidit Jain (Jun 07 2024 at 17:55):

I have created a new PR here

view this post on Zulip Vidit Jain (Jun 07 2024 at 17:55):

I am really sorry for the mistake

view this post on Zulip Vidit Jain (Jun 07 2024 at 17:56):

Now I am starting to work on select primitive feature

view this post on Zulip Himanshu (Jun 07 2024 at 21:21):

@Vidit Jain you can delete your new PR that is for including missing HelpWidget because it is fixed now.

view this post on Zulip Vidit Jain (Jun 08 2024 at 10:49):

@Daniel Rossberg @Himanshu the approach I am thinking to fix this bug is by emmiting a signal from wherever the document is getting its id. So whenever activeDocumentId is changing, it will emit a signal which will connect to MainWindow.cpp and from there we can turn off the toggle.

view this post on Zulip Vidit Jain (Jun 08 2024 at 10:49):

But I cannot find the function which assigning a document its id.. can you please help me with that

view this post on Zulip Daniel Rossberg (Jun 08 2024 at 15:39):

The documents are organized in the documentArea member variable of MainWindow of type QTabWidget. When the active Tab is changed, MainWindow::onActiveDocumentChanged() is called.

view this post on Zulip Vidit Jain (Jun 09 2024 at 14:01):

I created a new Pull request addressing the Select Object not turning off when changing document bug here

view this post on Zulip Vidit Jain (Jun 09 2024 at 14:17):

Vidit Jain said:

I created a new Pull request addressing the Select Object not turning off when changing document bug here

Looking for review on it.

view this post on Zulip Vidit Jain (Jun 10 2024 at 08:01):

@Daniel Rossberg @Himanshu I am looking for review on my latest pr

view this post on Zulip Vidit Jain (Jun 10 2024 at 18:07):

@Daniel Rossberg @Himanshu , now I am planning to start working on outlining the object that's being selected by the select object feature. But I don't have much idea on how to proceed. Can you please help me with that?
Thanks

view this post on Zulip Daniel Rossberg (Jun 10 2024 at 18:40):

Hmm, you could get the wireframe from the selected object and paint it on top of the general wireframe?

view this post on Zulip Himanshu (Jun 11 2024 at 05:08):

Vidit Jain said:

I created a new Pull request addressing the Select Object not turning off when changing document bug here

I was busy in some other work. I will check your PR by today or tomorrow.

view this post on Zulip Himanshu (Jun 14 2024 at 12:46):

@Vidit Jain There is some inconsistency in setChecked() when I switch tabs.
What I found:

  1. Open a .g file and click on select button, now you see checked is true and button is active. Now I open another .g file and I saw that the select button have checked to false which is fine. But when I switch back to previous .g file, the button is active and it's working when I select any object but the button UI itself is turned off because you setChecked(false). So the button is still active but button UI shows it's off.

view this post on Zulip Himanshu (Jun 14 2024 at 12:47):

Only doing setChecked(false) when document is changed is not going to work because the button still remains active showing select button UI to off.

view this post on Zulip Himanshu (Jun 14 2024 at 12:48):

@Daniel Rossberg Btw which behavior you suggest for select button when we switch tabs? So that we can implement that behavior for select button.

view this post on Zulip Vidit Jain (Jun 14 2024 at 12:49):

Himanshu said:

Only doing setChecked(false) when document is changed is not going to work because the button still remains active showing select button UI to off.

I am not able to debug properly because the select primitive feature is not working for me.

view this post on Zulip Himanshu (Jun 14 2024 at 12:56):

Vidit Jain said:

Himanshu said:

Only doing setChecked(false) when document is changed is not going to work because the button still remains active showing select button UI to off.

I am not able to debug properly because the select primitive feature is not working for me.

Is your taskbar hided in windows? Then turn it off. Or make that arbalest window size down by clicking on the maximize button. This way works for me.

view this post on Zulip Daniel Rossberg (Jun 15 2024 at 14:08):

Himanshu said:

Daniel Rossberg Btw which behavior you suggest for select button when we switch tabs? So that we can implement that behavior for select button.

Hmm, couldn't the button stay active and the selection will be made in the active document? (I haven't looked at the code yet, therefore I don't know, if this is in fact an option.)

view this post on Zulip Himanshu (Jun 16 2024 at 19:58):

Daniel Rossberg said:

Himanshu said:

Daniel Rossberg Btw which behavior you suggest for select button when we switch tabs? So that we can implement that behavior for select button.

Hmm, couldn't the button stay active and the selection will be made in the active document? (I haven't looked at the code yet, therefore I don't know, if this is in fact an option.)

Yes, the select button stays active even if I switch to another document. So what will happen to that another document that I switched?

view this post on Zulip Daniel Rossberg (Jun 17 2024 at 03:08):

If you click on the graphics display, an object (usually a region) will be selected.

view this post on Zulip Himanshu (Jun 17 2024 at 07:34):

Daniel Rossberg said:

If you click on the graphics display, an object (usually a region) will be selected.

Okay then we will go with this one. @Vidit Jain So make sure that select button stays active for every document and the button UI shouldn't show off state even after document is changed.

view this post on Zulip Vidit Jain (Jun 19 2024 at 12:50):

Himanshu said:

Daniel Rossberg said:

If you click on the graphics display, an object (usually a region) will be selected.

Okay then we will go with this one. Vidit Jain So make sure that select button stays active for every document and the button UI shouldn't show off state even after document is changed.

I was trying to look to get the feature running as mentioned but I am not able to figure out whats going wrong, If @Daniel Rossberg @Himanshu have any idea what's wrong then can you please help me with that.

view this post on Zulip Himanshu (Jun 20 2024 at 12:24):

We wanted to make sure that select button UI stays active even after document or tab is changed once select button is clicked. So your PR does opposite. The select button UI remains off after a tab is changed. So make sure to make it active and select is working even after tab is changed.

view this post on Zulip Daniel Rossberg (Jun 23 2024 at 13:09):

@Vidit Jain, you have to understand, what the select-object-action selectObjectAct does. E.g., it uses the activeDocumentId and it calls selectObjectButtonAction() or moveCameraButtonAction(), which use the activeDocumentId too.

view this post on Zulip Vidit Jain (Jun 23 2024 at 14:12):

Ya, I got that, but the thing is, I am not able to figure out why it is not always working. The logic I am seeing there seems fine, but it does not always work..

view this post on Zulip Vidit Jain (Jun 23 2024 at 14:13):

The original behavior of the button exactly matches the behavior you are expecting..

view this post on Zulip Daniel Rossberg (Jun 23 2024 at 15:03):

Probably, the structures have to be updated with the current activeDocumentId, which changes when the document changes.

view this post on Zulip Himanshu (Jun 26 2024 at 15:50):

@Vidit Jain Did you tested your PR? Why there is two connect when document is changing? Btw when the select button is off, I saw it still calls two connects when a document is changed and calls selectObjectButtonAction() and then moveCameraButtonAction().

view this post on Zulip Himanshu (Jun 26 2024 at 15:51):

I will test your PR after some time, I just checked the code only.

view this post on Zulip Vidit Jain (Jun 26 2024 at 15:56):

Himanshu said:

Vidit Jain Did you tested your PR? Why there is two connect when document is changing? Btw when the select button is off, I saw it still calls two connects when a document is changed and calls selectObjectButtonAction() and then moveCameraButtonAction().

The code is working fine. I have added these two connects because that was the only way I could figure out to make it work.

view this post on Zulip Vidit Jain (Jun 30 2024 at 03:08):

@Daniel Rossberg , I have updated my pr. The problem we are facing is that in the selectObjectAct, the activeDocumentId is not updating automatically. That's why we have to use another connect. If you have any better alternative to that, we can use that.

view this post on Zulip Vidit Jain (Jun 30 2024 at 03:10):

Also, I have noticed this bug that, until we are not clicking the focus button (which is present right to the name of object), we are not able to select the primitive and once we are clicking on that, then after only we are able to start using it. Is this a bug or this is how it is supposed to work?

view this post on Zulip Himanshu (Jun 30 2024 at 09:31):

Vidit Jain said:

Daniel Rossberg , I have updated my pr. The problem we are facing is that in the selectObjectAct, the activeDocumentId is not updating automatically. That's why we have to use another connect. If you have any better alternative to that, we can use that.

I suggested this way to Vidit because I thought that in future if we are creating many buttons where its state should be active even if document is switched. So that for every document change(when we switch tabs), we will check what buttons are active so that we can again call those button functions.

view this post on Zulip Himanshu (Jun 30 2024 at 09:32):

For now, select button is implemented for documents but if we going for any other buttons, we can do same for those buttons too.

view this post on Zulip Daniel Rossberg (Jun 30 2024 at 14:42):

Hmm, why haven't you made a slot function from updateSelectObjectState? This function could be simply called from onActiveDocumentChanged().

view this post on Zulip Daniel Rossberg (Jun 30 2024 at 14:44):

Vidit Jain said:

Also, I have noticed this bug that, until we are not clicking the focus button (which is present right to the name of object), we are not able to select the primitive and once we are clicking on that, then after only we are able to start using it. Is this a bug or this is how it is supposed to work?

Sounds like a bug. The focus button should change the displayed area only.

view this post on Zulip Himanshu (Jun 30 2024 at 14:45):

Daniel Rossberg said:

Hmm, why haven't you made a slot function from updateSelectObjectState? This function could be simply called from onActiveDocumentChanged().

Ah ha, how I can forget this that for every document change onActiveDocumentChanged() is called. :dizzy:

view this post on Zulip Himanshu (Jul 02 2024 at 21:25):

@Daniel Rossberg @Vidit Jain I created a patch for the above issue. Let me know what you guys think.
Changes-On-64ac3f.patch

view this post on Zulip Himanshu (Jul 02 2024 at 21:41):

So what I did:

  1. Created a bool moveObjectEnabled = false; in Display.h.
  2. Earlier every time a document is created or switched, setMoveCameraMouseAction() was called inside DisplayGrid::DisplayGrid(Document* document). Now setMoveCameraMouseAction() is removed from there. So every time we change a document or switch, connect(documentArea, &QTabWidget::currentChanged, this, &MainWindow::updateMouseButtonObjectState); will be used now and inside MainWindow::updateMouseButtonObjectState, it is already calling setMoveCameraMouseAction(). I change it like to this way to suit for new changes because once a document is created or switched, setMoveCameraMouseAction() being called for 2 times so we are allocating and deallocating memory. So I thought to go this way.

view this post on Zulip Himanshu (Jul 02 2024 at 21:52):

Previously also 2 times memory is being allocated and deallocated for move action.

  1. When a document is created or switched, memory is allocated for move action.
  2. Again move action get deallocated and again allocated because select button was turned off.

view this post on Zulip Himanshu (Jul 02 2024 at 23:46):

(deleted)

view this post on Zulip Daniel Rossberg (Jul 03 2024 at 16:03):

Hmm, do you mean "move object" or "move camera"?

view this post on Zulip Himanshu (Jul 03 2024 at 16:20):

move camera

Daniel Rossberg said:

Hmm, do you mean "move object" or "move camera"?

view this post on Zulip Vidit Jain (Jul 06 2024 at 11:12):

@Daniel Rossberg @Himanshu I have started working on highlting the stuff that have been selected and for that I have started working on the approach that @Daniel Rossberg suggested.

The approach that I am planning is, I will be painting the selected object again that has been selected by the select object button. In SelectMouseAction.cpp, its returing m_selected.. I am planning to paint over it with different color and increse the width of the paint

view this post on Zulip Vidit Jain (Jul 06 2024 at 11:17):

I am not sure, how can I draw over the selected region? Is there any internal BRL-CAD stuff that we have to use to paint over it?

view this post on Zulip Daniel Rossberg (Jul 06 2024 at 14:03):

The rendering is done in the arbalest code. The GeometryRenderer class is a good start point to learn it.

However, you need a geometric representation of the selected object as a VectorList, which can be generated with BRLCAD::ConstDatabase::Plot().

view this post on Zulip Vidit Jain (Jul 07 2024 at 09:07):

How can I get FullobjectPath to rerender it? @Daniel Rossberg @Himanshu if you have any idea?

view this post on Zulip Daniel Rossberg (Jul 07 2024 at 11:53):

The result of the SelectMouseAction (getSelected()) is in fact not only a region but its full path. I.e., you have it it DisplayGrid::setSelectObjectMouseAction(). With document->getObjectTreeWidget()->select(regionName) the tree widget is adjusted to it. Now, you need something similar for the graphics.

view this post on Zulip Vidit Jain (Jul 07 2024 at 15:21):

@Daniel Rossberg @Himanshu

Himanshu said:

Daniel Rossberg Vidit Jain I created a patch for the above issue. Let me know what you guys think.
Changes-On-64ac3f.patch

I guess this patch is working fine.. I don't think we can improve it any further. @Daniel Rossberg if you have any other inputs?

view this post on Zulip Vidit Jain (Jul 07 2024 at 15:23):

Also I have created a new pull request for highlight feature here. I have created a vectorList, its value is also getting updated but its color and width is not changing. I am not sure whats going wrong. If you can help @Daniel Rossberg @Himanshu

view this post on Zulip Daniel Rossberg (Jul 08 2024 at 11:45):

Vidit Jain said:

Daniel Rossberg Himanshu

Himanshu said:

Daniel Rossberg Vidit Jain I created a patch for the above issue. Let me know what you guys think.
Changes-On-64ac3f.patch

I guess this patch is working fine.. I don't think we can improve it any further. Daniel Rossberg if you have any other inputs?

My only comment was regarding the moveObjectEnabled variable name. I would prefer moveCameraEnabled.

view this post on Zulip Daniel Rossberg (Jul 08 2024 at 11:48):

However, there is no pull request with this, or?

view this post on Zulip Daniel Rossberg (Jul 08 2024 at 11:49):

Vidit Jain said:

Also I have created a new pull request for highlight feature here. I have created a vectorList, its value is also getting updated but its color and width is not changing. I am not sure whats going wrong. If you can help Daniel Rossberg Himanshu

Hmm, you modified the SelectMouseAction class, which is the wrong place.

view this post on Zulip Himanshu (Jul 08 2024 at 12:17):

Daniel Rossberg said:

However, there is no pull request with this, or?

Who's going to send pr? Me or Vidit? I am okay to transfer my patch to him so that he can create a pr and send it.

view this post on Zulip Vidit Jain (Jul 08 2024 at 16:46):

Daniel Rossberg said:

Vidit Jain said:

Also I have created a new pull request for highlight feature here. I have created a vectorList, its value is also getting updated but its color and width is not changing. I am not sure whats going wrong. If you can help Daniel Rossberg Himanshu

Hmm, you modified the SelectMouseAction class, which is the wrong place.

Should I create a new file for this or should I put it in GeometryRenderer.cpp?

view this post on Zulip Daniel Rossberg (Aug 02 2024 at 16:36):

@Vidit Jain, did you noticed my comment to your PR #123 5 days ago?

view this post on Zulip Vidit Jain (Aug 02 2024 at 16:38):

Oh.. I am really sorry.. I missed the notification

view this post on Zulip Vidit Jain (Aug 06 2024 at 13:13):

@Daniel Rossberg @Himanshu , I am working on the highlight selected object feature from the past few days. I am facing this issue (you can check the current pr for it), the code is traversing through the rerendering part but its never rendering it.. I am not sure why this is happening.. maybe i guess its the issue of z-index?

view this post on Zulip Vidit Jain (Aug 06 2024 at 13:14):

If you have any idea.. can you please tell me

view this post on Zulip Daniel Rossberg (Aug 06 2024 at 18:59):

I'll have a look at it tomorrow.

view this post on Zulip Daniel Rossberg (Aug 07 2024 at 13:39):

@Vidit Jain, your PR #52 has still the state from July 7th, i.e. before we talked about how to do it right.

view this post on Zulip Himanshu (Aug 07 2024 at 15:41):

Vidit Jain said:

Daniel Rossberg Himanshu , I am working on the highlight selected object feature from the past few days. I am facing this issue (you can check the current pr for it), the code is traversing through the rerendering part but its never rendering it.. I am not sure why this is happening.. maybe i guess its the issue of z-index?

I will check it in coming Saturday and Sunday. I am little bit busy in internship and getting less time. So mostly Saturday and Sunday, I will see.

view this post on Zulip Vidit Jain (Aug 07 2024 at 15:44):

Daniel Rossberg said:

Vidit Jain, your PR #52 has still the state from July 7th, i.e. before we talked about how to do it right.

Actually I haven't updated the pr because I am facing the same issue again and again after all different ways that I am trying to do for the rerendering part and that is, something is rerendering the original color over the highlighted yellow render that I am creating after selecting the object. I am not able to figure out when is the last render of the selected object happening and have to rerender it. But I am not able to figure that out..

view this post on Zulip Daniel Rossberg (Aug 07 2024 at 16:04):

Did you modified DisplayManager like we talked about?

view this post on Zulip Vidit Jain (Aug 08 2024 at 19:15):

Daniel Rossberg said:

Did you modified DisplayManager like we talked about?

I have tried doing the stuff that you said.. can you please tell me in a little brief what all that you said?

view this post on Zulip Vidit Jain (Aug 09 2024 at 16:58):

@Daniel Rossberg Can you pleasae tell me in a little brief what all functions I am suppose to use from DisplayManager.. I am trying to do so.. but I am not able to figure out why the re-rendered part not visible.

view this post on Zulip Daniel Rossberg (Aug 09 2024 at 17:04):

The basic OpenGL widgets are of type Display (derived from QOpenGLWidget). If they shall refresh their content, paintGL() will be called. This function calls render() from GeometryRenderer, which again uses the functions provided with DisplayManager.

The idea was to add functions to DisplayManager, which set and clear a BRLCAD::VectorList. Then, this vector list will be drawn after the usual objects by GeometryRenderer::render().

To set and clear the vector list by SelectMouseAction, m_watched->getDisplayManager() could be used there.

view this post on Zulip Himanshu (Aug 11 2024 at 20:03):

@Daniel Rossberg @Vidit Jain Is this the way we should proceed? I wrote a template like this.

void DisplayManager::setVectorList(const QString &objectFullPath, BRLCAD::VectorList *vectorList) {
    display.getDocument()->getDatabase()->Plot(objectFullPath.toUtf8(), *vectorList);

    display.getDisplayManager()->setFGColor(1.0f, 1.0f, 0.0f, 1.0f); // Set color to yellow

    /*
        Do something that new vector list will be drawn after the current objects by GeometryRenderer::render().
    */

    display.update();
}

void DisplayManager::clearVectorList(BRLCAD::VectorList *vectorList) {
    vectorList->Clear();
}

view this post on Zulip Vidit Jain (Aug 12 2024 at 06:20):

The structure looks fine to me

view this post on Zulip Daniel Rossberg (Aug 12 2024 at 15:49):

I'm afraid, this won't do it. To take effect, QOpenGLWidget::paintGL() or a function called inside has to be touched. E.g.

void GeometryRenderer::render() {
    document->getDisplay()->getDisplayManager()->saveState();
    if (!objectsToBeDisplayedIds.empty()) {
        for (int objectId : objectsToBeDisplayedIds) {
            if (!objectIdDisplayListIdMap.contains(objectId)) {
                drawSolid(objectId);
            }
            visibleDisplayListIds.append(objectIdDisplayListIdMap[objectId]);
        }
        objectsToBeDisplayedIds.clear();
    }

    for (int displayListId : visibleDisplayListIds) {
        document->getDisplay()->getDisplayManager()->drawDList(displayListId);
    }
    document->getDisplay()->getDisplayManager()->drawSuffix();
    document->getDisplay()->getDisplayManager()->restoreState();
}

void DisplayManager::setSuffix(const BRLCAD::VectorList& vectorList) {
    suffix = vectorList;
}

void DisplayManager::clearSuffix(void) {
    suffix.Clear();
}

void DisplayManager::drawSuffix(void) {
    drawVList(&suffix);
}

No idea if this works, but it should point to the right direction.

view this post on Zulip Vidit Jain (Aug 14 2024 at 17:44):

@Daniel Rossberg @Himanshu I have created a new pull request here

Its working fine but the issue is its not going back to its normal state after turning off the select object button.
I will look into it.

view this post on Zulip Daniel Rossberg (Aug 15 2024 at 15:29):

Nice to hear that you got closer to the solution. Some thought about your PR:

view this post on Zulip Vidit Jain (Aug 16 2024 at 05:06):

@Daniel Rossberg @Himanshu , I have updated the pr here.

Daniel Rossberg said:

Nice to hear that you got closer to the solution. Some thought about your PR:

I am not sure about protection with saveState() and restoreState because drawSuffix() is already protected by that in GeometryRenderer::render()

view this post on Zulip Vidit Jain (Aug 16 2024 at 05:06):

(deleted)

view this post on Zulip Daniel Rossberg (Aug 16 2024 at 17:27):

You are right: The way drawSuffix() is called does not need a saveState()/restoreState().

view this post on Zulip Himanshu (Aug 17 2024 at 18:19):

@Vidit Jain There is a bug I saw now in your PR. Highlight feature doesn't work for other document. For example if I have 2 tabs opened then it doesn't work for 2nd tab. Can you check that?

view this post on Zulip Vidit Jain (Aug 18 2024 at 12:35):

Himanshu said:

Vidit Jain There is a bug I saw now in your PR. Highlight feature doesn't work for other document. For example if I have 2 tabs opened then it doesn't work for 2nd tab. Can you check that?

I was not working on the latest commit of the arbalest, that's why the bug was there. I have shifted to the latest commit now and its working perfectly fine now.

view this post on Zulip Vidit Jain (Aug 19 2024 at 17:22):

(deleted)

view this post on Zulip Vidit Jain (Aug 20 2024 at 04:20):

@Daniel Rossberg @Himanshu I guess we can move to solve some different problem since we are done with the Highlight feature. Do you have some suggestions on what should I start working on after this?

view this post on Zulip Daniel Rossberg (Aug 20 2024 at 17:08):

For example: https://github.com/BRL-CAD/arbalest/issues

view this post on Zulip Vidit Jain (Aug 20 2024 at 18:12):

I also noticed this one bug that selectObject only works when we are focusing on it through the focus button. Without clicking on the focus button, it will not work but once you click on the focus button, it will start working.

Daniel Rossberg said:

For example: https://github.com/BRL-CAD/arbalest/issues

view this post on Zulip Daniel Rossberg (Aug 20 2024 at 18:34):

This could be connected to https://github.com/BRL-CAD/arbalest/issues/18. I'ts probable because the start point of the rays is behind the scene. Maybe, you can fix this.

view this post on Zulip Himanshu (Aug 21 2024 at 18:23):

@Vidit Jain I reviewed your PR. Can you make some changes that I asked here https://github.com/BRL-CAD/arbalest/pull/52#pullrequestreview-2251575775

view this post on Zulip Vidit Jain (Aug 23 2024 at 10:04):

@Himanshu I have updated the PR with all the suggested changes here

view this post on Zulip Vidit Jain (Aug 23 2024 at 10:07):

I am thinking of starting to work on the issue . Can you please tell me where should I start from @Daniel Rossberg @Himanshu

view this post on Zulip Daniel Rossberg (Aug 23 2024 at 17:11):

Can you reproduce the issue?

view this post on Zulip Himanshu (Aug 24 2024 at 05:55):

Himanshu said:

Daniel Rossberg I am able to produce fully ray traced image by clicking on Reset the viewports and focus on the visible button having Z-axis to 0. Screenshot-12.png

@Vidit Jain Here what I found previously for https://github.com/BRL-CAD/arbalest/issues/18. You can see my older messages, you will get some idea.

view this post on Zulip Himanshu (Aug 24 2024 at 05:57):

Here is the .g file: brlcadInstall\share\db\castle.g

view this post on Zulip Himanshu (Aug 24 2024 at 06:02):

Here what I got without clicking Focus on Selected Object.
image.png

view this post on Zulip Vidit Jain (Sep 01 2024 at 11:43):

Hello @Daniel Rossberg ,
I was able to reproduce the issue. I was able to conclude that without centering the object, raytracing is not working properly and same is the case with select object feature. The function responsible for the same is "centerToCurrentSelection()" . I am not able to figure out the reason for the same. Can you please help.

view this post on Zulip Daniel Rossberg (Sep 02 2024 at 13:51):

The ray-trace is done in RaytraceView::UpdateImage(). There, m_transformation mediates between two coordinate systems: The dot-matrix-system of the screen and the model-coordinate-system of the geometry.

For example:

QVector3D     imagePoint(column, h - row - 1., 0.);
QVector3D     modelPoint = m_transformation.map(imagePoint);
...
ray.origin.coordinates[0]    = modelPoint.x();
ray.origin.coordinates[1]    = modelPoint.y();
ray.origin.coordinates[2]    = modelPoint.z();

The ray-trace is done with BRL-CAD in the model-coordinate-system. The start point of a ray is modelPoint. Its coordinates were determined from imagePoint, a point in the dot-coordinate-system of the screen. (Why is the y-coordinate reversed? Find it out ;) But, why is the z-coordinate 0?

To understand its consequences, you have to determine the direction of the ray:

QVector3D directionStart = m_transformation.map(QVector3D(0., 0., 1.));
QVector3D directionEnd   = m_transformation.map(QVector3D(0., 0., 0.));

i.e., the direction of the ray is in the virtual z-direction of the screen, in -z direction.

Until here, there is no good reason, why there should be no geometric objects with positive z coordinate, when transferred to the screen coordinate system - which produces the raytracing issue.

Now, OrthographicCamera::centerToCurrentSelection() comes into play. This ends up in a transformation, which centers(?) the geometry around the origin ... this wouldn't be very helpful ... but wait, where is it created:

The transformation is created in RaytraceView::raytrace(), with a lot of reasonable operations - and a

transformation.translate(0, 0, 10000);

This looks like a shift on the z-axis with the hope, that this will move all geometric objects behind the screen's z=0 plane. I wouldn't be so optimistic that this will always be the case.

Can you follow my argumentation until here?

view this post on Zulip Vidit Jain (Sep 08 2024 at 11:40):

Hello, I have created a Medium post as my GSOC final Submission.. You all can read it here

view this post on Zulip Vidit Jain (Sep 29 2024 at 21:55):

Hello @Daniel Rossberg @Himanshu , I have finally successfully completed my GSOC. It’s been an incredible experience, and I’m truly grateful for the opportunity to work with such amazing mentors. I’ve learned so much throughout this journey, and I couldn’t have done it without your guidance and support.

Looking forward to continuing my contributions to Arbalest. Thank you all so much!


Last updated: Nov 15 2024 at 00:49 UTC