ganimtron_10's Blog

Week 13 - Separating tests and fixing bugs

ganimtron_10
Published: 09/16/2022

What did you do this week?


This week I managed to fix the translation issue in PR #653. This was happening because of the calculation error while repositioning the shapes. Now it works as intended.

Also, the PR #623 got merged as now the tests were passing after the update.

As we are now adding new features to the DrawPanel, the current tests are becoming bigger and bigger.
Due to this creating, debugging, and managing tests are becoming harder.
So to keep things simple, separating the tests to validate individual parts and features of the DrawPanel. This was done in PR #674.

Along this, there was a redundant parameter called in_progress, which was used to keep a check whether the shapes are added to the panel or not, but it was confusing, and discarding it didn't affect the codebase. So PR #673 removed that parameter and separated the two functions.

Did you get stuck anywhere?


Debugging the issue in PR #653 took most of the time this week. I had to manually calculate and check whether the calculations were correct or not. 

What is coming up next?


Currently, the borders around the shapes are not actually the borders, they are the bounding box of that shape. So I have to find out some ways to highlight the shapes when selected by the user.

View Blog Post

Week 12 - Fixing translating issues and updating tests

ganimtron_10
Published: 09/10/2022

What did you do this week?


I started with updating the tests for PR #623 as some of the tests weren't covering all the aspects in the code.
Previously I was just creating the DrawShape and adding it to the scene but now I had to analyze the scene to see whether they were properly added or not.

Then I moved on to PR #653 to resolve the clamping issue. As you can see below, the shapes overlappes when they move nearer to the panel border.

To solve this, I am thinking of calculating the center of the group and clipping it according to the panel, which may give us the required result. I tried doing the same, and it worked partially.

As we can see above, the shapes are kind of clamping but there's some issue with positioning. It would be good to go once this is fixed.

Along this, I tried to integrate shaders with the Rectangle2D but there's something which I am missing. When I tried executing that program, it executed successfully but I am not getting the desired output. I tried debugging the code as well using the debug flag on the shader_to_actor function but still, it doesn't throw any error.

Did you get stuck anywhere?


While updating the tests for PR #623 the quad shape wasn't getting analyzed by the analyse_snapshot method. I tried various approaches to fix it, but it didn't work.

What is coming up next?


Merging the PRs #623, #653 and working on the freehand drawing.

View Blog Post

Week 11 - Creating a base for Freehand Drawing

ganimtron_10
Published: 09/06/2022

What did you do this week?

 


This week I tried to imitate the working of vtkImageTracer. Previously, I had created a small prototype for freehand drawing by adding points at the mouse position (which you can check out here). As mentioned, there were some drawback of this method.
So to overcome these issues, I tried combining both methods. Considering points using the previous method and instead of adding points I tried creating lines between them which looks promising. Below you can see a demo.

Freehand Drawing:

While doing this, I started working on how I could efficiently draw the lines and smoothen them out. My mentors referred me this to learn more about constructing and rendering lines.

Along with this, I updated a few tests and some small bugs in PR #623 and #653.
​​

Did you get stuck anywhere?


No, I didn't get stuck anywhere.

What is coming up next?


Enhancing the freehand drawing feature.

View Blog Post

Week 10 - Understanding Codes and Playing with Animation

ganimtron_10
Published: 08/29/2022

What did you do this week?


I started working on the PR #645 created last week and tested a few more corner cases such as What happens if the maximum value is exceeded?? What if we give a value less than the minimum value range??
Most of these worked as intended.

Then I moved on to vtkImageTracer, I tried implementing this locally. It required an ImageSource on which the tracing was done. As you can see below, I managed to implement the pure VTK version of the widget. After this, I tried integrating this with FURY and besides the ImageSource all things were successfully handled by FURY.

As per the suggestions from the mentors, I started looking at the implementation of the vtkImageTracer to see how they manage the widget. My prior experience with C++ helped me a lot with this because the original implementation of vtk is in C++.

Here, I found an approach similar to the polyline. They first grab the current point, check whether it's inside the area, and then use the last point to draw a line by calculating some kind of motion vector.

Using the Animation Architecture created by Mohamed, I created a Bouncing Text Animation using UI elements to check the compatibility of the UI System with the Animation.

Bouncing text animation:

Did you get stuck anywhere?


Proper tutorials weren't there to implement vtkImageTracer, which took time to make it work locally.

What is coming up next?


Working on the Freehand Drawing.
View Blog Post

Week 9 - Grouping and Transforming Shapes

ganimtron_10
Published: 08/18/2022

What did you do this week?


I started this week by creating a quick PR #645 for the UI sliders. The sliders raised ZeroDivsionError when the min and max values were the same. To solve this, I handled the case where the value_range becomes zero and then manually set the handle position to zero.

Then I updated the implementation of the Grouping Shapes feature to support the translation and rotation of the shapes grouped together, as you can see below.

After this, I worked on the PolyLine and removed the extra point being added to the start of the PolyLine whenever a new instance was created.

Did you get stuck anywhere?


No, everything went well.

What is coming up next?


Completing the PR #623 and #653.
Searching different approaches for implementing the freehand drawing.
View Blog Post