Google Summer of Code 2021 Final Work Product
- Name: Antriksh Misri
- Organisation: Python Software Foundation
- Sub-Organisation: FURY
- Project: FURY: Create new user interface widget
Proposed Objectives
- Add support for Layouts in UI elements
- Add support for Horizontal Layout
- Add support for Vertical Layout
- Add support for Layout along
X
,Y
,Z
axes. - Stretch Goals:
- Add
Tree2D
UI element to theUI
sub-module - Add
Accordion2D
UI element to theUI
sub-module - Add
SpinBox2D
UI element to theUI
sub-module
- Add
Objectives Completed
Add support for Horizontal Layout
Added support for Horizontal Layout in the
layout
module. This layout allows the user to stack actors in a horizontal fashion. Primarilty, should be used for laying out UI elements as there is no meaning of horizontal/vertical in 3D space.Pull Requests:
- Horizontal Layout: https://github.com/fury-gl/fury/pull/480
- Horizontal Layout demo: https://github.com/fury-gl/fury/pull/480
Add support for Vertical Layout
Added support for Vertical Layout in the
layout
module. This layout allows the user to stack actors in a vertical fashion. Primarilty, should be used for laying out UI elements as there is no meaning of horizontal/vertical in 3D space.Pull Requests:
- Vertical Layout: https://github.com/fury-gl/fury/pull/479
- Vertical Layout demo: https://github.com/fury-gl/fury/pull/479
Add support for Layout along
X
,Y
,Z
axesAdded support for Layout along
x
,y
,z
axes. Allows user to layout different actors along any given axes. Also allows users to switch the stacking order by passing aaxis+
oraxis-
to the constructor.Pull Requests:
- X, Y, Z axes Layout: https://github.com/fury-gl/fury/pull/486
- X, Y, Z axes Layout demo: https://github.com/fury-gl/fury/pull/486
Add
Tree2D
UI element to theUI
sub-moduleAdded
Tree2D
UI element to theUI
sub-module. This allows user to visualize some data in a hierarchical fashion. Each node inside the tree can haveN
child nodes and the depth can be infinite. Each node can be clicked to trigger a user defined callback to perform some action. Tests and two demos were added for this UI element. Below is a screenshot for reference:-Pull Requests:
- Tree2D UI element: https://github.com/fury-gl/fury/pull/460
- Tree2D UI element demo: https://github.com/fury-gl/fury/pull/460
Add
Accordion2D
UI element to theUI
sub-moduleAdded
Accordion2D
to theUI
sub-module. This Ui element allows users to visulize data in a tree with depth of one. Each node has a title and a content panel. The children for each node can beN
if and only if the children are not nodes themselves. The child UIs can be placed inside the content panel by passing some coordinates, which can be absolute or normalized w.r.t the node content panel size. Tests and two demos were added for this UI element. Below is a screenshot for reference:-Pull Requests:
- Accordion2D UI element: https://github.com/fury-gl/fury/pull/487
- Accordion2D UI element demo: https://github.com/fury-gl/fury/pull/487
Objectives in Progress
Add support for
Layout
in UI elementsCurrently all the available layouts are only available for actors i.e. of type
vtkActor2D
. In order to add support for the layouts in UI elements there needs to be some tweaking in the base Layout class. Currently, the PR that adds these functionalities in stalling because of some circular imports. These will hopefully be fixed soon and as soon as the circular imports are fixed, the PR will be merged.Pull Requests:
- Add support for
Layout
in UI elements: https://github.com/fury-gl/fury/pull/443
- Add support for
Method to process and load sprite sheets
This method adds support for loading and processing a sprite sheet. This will be very useful in playing animations from a
n*m
sprite sheet. This also has a flag to convert the processed chunks intovtkimageData
which can be directly used to update the texture in some UI elements. The primary use of this method will in a tutorial forCard2D
, wherein, the image panel of the card will play the animation directly from the sprite sheet.Pull Requests:
- Method to process and load sprite sheets : https://github.com/fury-gl/fury/pull/491
Other Objectives
Add
Card2D
UI element toUI
sub-moduleAdded
Card2D
UI element to theUI
sub-module. ACard2D
is generally divided into two parts i.e. the image content and the text content. This version of card has an image which can be fetched from a URL and the text content which is yet again divided into two parts i.e. thetitle
and thebody
. The space distribution between the image and the text content is decided by a float between 0 and 1. A value of 0 means the image takes up no space and a value of 1 means the image consumes the whole space. Below is a demonstration:-Pull Requests:
- Add
Card2D
UI element toUI
sub-module: https://github.com/fury-gl/fury/pull/398
- Add
Resize
Panel2D
withWindowResizeEvent
or from corner placeholderCurrently, the size of the
Panel2D
is static and cannot be changed dynamically. The size is passed in during the initialization and cannot be changed easily at runtime. This PR adds support for resizing thePanel2D
dynamically by adding a placeholder icon at the bottom right corner of the panel. This icon canbe click and dragged on to change the size accordingly. Other than this, the panel also retains a specific size ratio when the window is resized. This means if the window is resized in any direction the panel adapts itself w.r.t the updated size. This is done by adding relevant observers for theWindowResizeEvent
and binding the relevant callback to it. Below is a quick demonstration:-Pull Requests:
- Resize
Panel2D
withWindowResizeEvent
or from corner placeholder: https://github.com/fury-gl/fury/pull/446
- Resize
Added the watcher class to UI
This PR adds support for a watcher class in the UI elements. The purpose of this class is to monitor a particular attribute from the UI element after it has been added to the scene. If the attribute changes in the real time, a user defined callback is triggered and the scene is force rendered. Below is the code example demonstrating how the wathcer works:-
Pull Requests:
- Added wathcer class to the UI sub-module: https://github.com/fury-gl/fury/pull/448
Added support for borders in
Panel2D
The
Panel2D
previously, didn't support any sort of effect, the main reason behind this is that, all UI elements are individual entities that are comprised of different actors. These are not the widgets provided byvtk
and in order to have some effects provided byvtk
shaders must be involved. This obviously makes the whole system very complicated. The border on the other hand uses 4Rectangle2D
s to draw the 4 borders. This makes the whole process easier but makes thePanel2D
very performance heavy as we are adding 5 actors to the scene. Future iterations will replace these rectangles by textures, that way we don't compromise performance and we can have different patterns in the border. Below is a demonstration:-Pull Requests:
- Added support for borders in
Panel2D
: https://github.com/fury-gl/fury/pull/441
- Added support for borders in
GSoC weekly Blogs
Weekly blogs were added for FURY's Website.
Pull Requests:
- First Evaluation: https://github.com/fury-gl/fury/pull/477
- Second Evaluation: TBD
Timeline
Date Description Blog Link Week 1
(08-06-2021)Welcome to my weekly Blogs! Weekly Check-in #1 Week 2
(14-06-2021)Feature additions in UI and IO modules Weekly Check-in #2 Week 3
(21-06-2021)Adapting GridLayout to work with UI Weekly Check-in #3 Week 4
(28-06-2020)Adding Tree UI to the UI module Weekly Check-in #4 Week 5
(05-07-2021)Rebasing all PR's w.r.t the UI restructuring, Tree2D, Bug Fixes Weekly Check-in #5 Week 6
(12-07-2020)Bug fixes, Working on Tree2D UI Weekly Check-in #6 Week 7
(19-07-2020)Finalizing the stalling PR's, finishing up Tree2D UI. Weekly Check-in #7 Week 8
(26-07-2020)Code Cleanup, Finishing up open PR's, Continuing work on Tree2D Weekly Check-in #8 Week 9
(02-08-2020)More Layouts! Weekly Check-in #9 Week 10
(09-08-2020)Accordion UI, Support for sprite sheet animations Weekly Check-in #10 Week 11
(16-08-2020)More tutorials for Accordion2D, Finalizing remaining PRs Weekly Check-in #11 Detailed weekly tasks, progress and work done can be found here.