I am trying to lay down foundation for the storage of entities. This storage of points would be used to know if there is already a point on the drawing widget. With storage class made, I am working on implementing the point detection part.
I also found that I need to make the drawing widget and tabs more modular so as to avoid memory leaks and stuff that happens because my pointer won’t point to the correct drawing area when a new tab is created.
This is another stuff on my to do list.
I have created a container class that’d store the points’ coordinates.
And these values would be stored in a container, vector, for now. Though this may be changed later.
Next step would be to detect the mouse coordinates to see if the point exists.
The basic rough algorithm that I think for detecting the points on the drawingArea is to store the drawn points in some container as a stack or list.
Then I can get the current coordinates of the mouse and check with my container to see if it matches any existing point.
If it does then I can select that point and others in a similar manner and then use them for operations like drawing rest of the entities, selecting, transforming, modifying, etc.
The gui part now supports the point drawing but other entities will be drawn when the mouse can detect if there is already a point underneath it.
This will enable us to draw other entities like line, segment, circle, vector, etc because they’ll be created from the points (their specific placements on the drawingArea).
So, next step is to handle storage of these points in the memory. But how to store them, in array, vector or map container? Which would be useful and efficient for the application?
I have some basic idea but I’ll discuss this with my mentor and then start implementing it.
I added more cairo stuff in painter class that would be used to create entities and other shapes in drgeo.
Also changed the shape of point from rectangular to circular.
Instead of using arc to make a small circle and filling it to make a point, I’ve used a line with rounded line cap with same end points. So, a very short line is a dot in this case. This improves the time efficiency to create a point.
It’s quite similar if we need to use cairo in clutter and which in return just seems to add a lot of extra code.
So I am putting clutter on a sideline for a while and just moving on with simple cairo in Gtk.
I added click event to draw point on the drawing area.
Tomorrow I’ll take this point draw a bit further and might even start on some other entity,
It’s been rough couple of days with bad health.
Right now I am trying to achieve each different draw as an actor on the stage.
It is taking a lot of my time as I am not getting what I am trying to do.
If this doesn’t go the way I want it to then I’ll fallback on my backup to just use cairo and finish the gui work as soon as possible.
Still working on adding those actors to the stage.
Although mouse events are working and I am getting the correct position as an output.
I hope I finish this real soon.
Added a canvas actor to the stage which is embedded in our drawingarea GtkWidget.
Soon entities will be drawn as actors on the canvas.
I think it’s safe to say that stage is set now. 🙂
Also thinking on how to implement the kernel part, where entities will be processed and stored in a list or a vector, in a storage space.
Decided to make use of Clutter Library for 2D drawings in Dr. Geo.
Started integrating it in the project.
Working on creating entities through this.