antrikshmisri's Blog

Week #3: Adapting GridLayout to work with UI

antrikshmisri
Published: 06/21/2021

What did I do this week?

This week my tasks revolved around layout and UI elements. The primary goal for this week was to adapt the GridLayout to work with different UI elements. Currently, GridLayout just supports vtk actors and not UI elements, my task was to modify the class to support UI elements. The other tasks for this week are described below in detail:-
  1. Adapt GridLayout to support UI elements: This was the main task for the week and the aim for this was to actually modify GridLayout to support UI elements. This was not possible before because GridLayout only supported vtk actors (because of certain methods only being provided by vtk actors). I modified the main class itself along with some utility functions. The problem that I faced during this was circular imports. Currently, the structure of FURY doesn't allow certain modules to be imported into other modules because of circular imports. A way to get around this was to actually import the modules inside the methods but this is not ideal always. This will be fixed in the future PRs where the UI module will be redesigned. I also added support for grid position offsetting, which basically means that the position of the UI elements that are placed in the Grid can be offset by a global offset passed in the constructor of GridLayout class. Below is an example showing the current state of GridLayout with different UI elements:- . I also created a brief example to demonstrate how to use GridLayout of different cellshapes with UI elements link to which is here
  2. Reviewed the FileDialog2D PR: This PR added support for FileDialog2D in the UI module. The PR needed to be reviewed in order to merge it as soon as other required PRs were merged. One of the mentors already reviewed the PR briefly my job was to review the PR for any remaining bugs.
  3. Study #422 PR to understand contours around the drawn markers: In my previous week's tasks I created a PR to add support for borders in Panel2D. The borders were individually customizable just like in CSS which meant 4 Rectangle2D objects were needed to represent border in each direction. This is not ideal for a scenario where a lot of Panel2D are present in the scene as it can be performance taxing. A possible solution for this was to actually look how this was implemented in the #422. This PR allowed drawing millions of markers in one call that too from the GPU. Interestingly, each marker had a contour surrounding it which is exactly what we needed for Panle2D. This is something that can be considered in the future for border implementation in other complex UI elements.
  4. I also continued my work on the watcher class that I mentioned in the previous week's blog. The work for this is almost done and just needs some tests implemented, which should be done soon

Did I get stuck anywhere?

Fortunately, I did not get stuck this week.

What is coming up next?

Next week I would probably continue to work on GridLayout and possibly other layouts as well, other tasks will be decided in the next meeting.

See you guys next week!
View Blog Post

Week #2: Feature additions in UI and IO modules

antrikshmisri
Published: 06/13/2021

What did I do this week?

This week I had to work on 3 PR's as well as some documentation. I really enjoyed this week's work as the tasks were really interesting. The aim for these PR's were to actually add a couple of features in the UI as well as the IO module, which includes, adding support for border in Panel2D, adding support for network/URL images in load_image method in IO module, adding resizing Panel2D from bottom right corner, completing the document with layout solutions provided by Unity/Unreal engine. Below are the PR's that I worked on:-
  1. Added support for URL image in load_image: The load_image of IO module didn't support network /URL images, so I made this PR to add support for the same.
  2. Added support for border in Panel2D: This PR was made in association with the Card2D PR. This PR adds support for border in Panel2D. The borders are individually customizable just like in CSS. This PR needs a little tweaking in terms of getters/setters. The same support needs to be added in Rectangle2D
  3. Complete the document with layout solutions provided by Unity/Unreal engine: Completed the document with layout solutions provided by Unity/Unreal Engine
  4. Behind the scenes I also worked on a Watcher class for the UI elements. The purpose of the watcher would be to monitor the UI elements for any changes after they have been added to the scene. A PR should be up by 2-3 days.

Did I get stuck anywhere?

I had a minor issue with the tests for the IO module. When running the tests for IO module using pytest 5.0.0 resulted in Window fatal error, this was a sideeffect of pytest 5.0.0 wherein support for faulthandler was added. This error was suppressed by using certain flags while running the tests.

What is coming up next?

Next week I would probably work on adapting the GridLayout with UI elements, some other tasks that will be decided in the next meeting.

See you guys next week!
View Blog Post

Week #1: Welcome to my weekly Blogs!

antrikshmisri
Published: 06/08/2021

Hi everyone! I am Antriksh Misri. I am a Pre-Final year student at MIT Pune. This summer, I will be working on Layout Management under FURY's UI module as my primary goal. This includes addition of different classes under Layout Management to provide different layouts/arrangements in which the UI elements can be arranged. As my stretch goals, I will be working on a couple of UI components for FURY’s UI module. These 2D and 3D components will be sci-fi like as seen in the movie “Guardians of The Galaxy”. My objective for the stretch goals would be to develop these UI components with their respective test and tutorials such that it adds on to the UI module of FURY and doesn’t hinder existing functionalities/performance.

What did I do this week?

During the community bonding period I got to know the mentors as well as other participants. We had an introductory meeting, in which the rules and code of conduct was explained. Also, my proposal was reviewed and modified slightly. Initially, I had to develop UI elements as my primary goal and I had to work on layout management as my stretch goals but the tasks were switched. Now I have to work on Layout Management as my primary task and develop UI in the stretch goals period. I also started coding before hand to actually make use of this free period. I worked on different PR's which are described below:-
  1. Added tests for Layout module: The layout module of FURY didn't had any tests implemented, so I made this PR to add tests for Layout & GridLayout class.
  2. Complied available classes for Layout Management in different libraries: In order to decide the behavior and functionality of Layout Management in FURY, I made a document that has all classes available in different libraries to manage layout of UI elements. This document also contains code snippets for these classes
  3. Resize Panel2D UI on WindowResizeEvent: Currently, the Panel2D UI is not responsive to window resizing which means its size is static. In this branch I implemented this feature.

Did I get stuck anywhere?

I got stuck at Panel resizing feature. I couldn't figure out how to propagate the window invoked events to a specific actor. Fortunately, the mentors helped me to solve this problem by using partial from functools

What is coming up next?

The next tasks will be decided in this week's open meeting with the mentors.
See you guys next week!
View Blog Post