cache function

Let Sim Innovations know about your Air Manager experience and let us know about your dream feature addition

Moderators: russ, Ralph

Message
Author
User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

cache function

#1 Post by Keith Baxter »

@Corjan

Possible to have a cache() function for cache-ing large data loaded like canvas_draw() items.

Looking to load ONCE a canvas_draw() and store to cache for recall. If my investigation is anything to go by it is in the lua library.
Should be a quick and easy one to implement for us . Right :lol: :lol: :lol:

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: cache function

#2 Post by Corjan »

Hi,

All variables etc in lua are already stored in memory, no need to cache that.

Corjan

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: cache function

#3 Post by Keith Baxter »

@Corjan

Maybe my terminology is incorrect.

If we cannot resize the contents of a canvas using the move() function, then I will need to be able to store old drawn canvases. How do you suggest this is done?
Create multiple canvases for each zoom level?

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: cache function

#4 Post by Corjan »

Hi,


Creating multiple canvasses for each zoom level is going to use a lot of resources, I would not suggest you doing that.
You can scale the content within the canvas already with _scale function.


But I will change the move function, so canvas will scale with it. You are right in that that makes more sense,

Corjan

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: cache function

#5 Post by Keith Baxter »

Corjan wrote: Thu Sep 03, 2020 11:32 am Hi,


Creating multiple canvasses for each zoom level is going to use a lot of resources, I would not suggest you doing that.
You can scale the content within the canvas already with _scale function.


But I will change the move function, so canvas will scale with it. You are right in that that makes more sense,

Corjan
Thank you for considering changing/fixing the canvas to scale with the move() function Corjan.

That is going to be a game changer for shifting and zooming around vector maps and their layers.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: cache function

#6 Post by Keith Baxter »

@Corjan

Somewhere I asked for a _polygon() function. This has resurfaced. :lol: and I attempt to rejuvenate your appetite for this function or a compromise.

Reason being, I also want a smoothing factor to be added. So that polygons can have rounded corners and not straight lines.

Else something along the lines of a radius to be added to the _line_to() and _arc_to() functions like we have in the _rect() function.

@Sling your thought as well please.

Of course not restricted to those mentioned.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: cache function

#7 Post by Corjan »

That is exactly what the bezier_to and arc_to are for.

Corjan

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: cache function

#8 Post by Keith Baxter »

Corjan wrote: Fri Sep 04, 2020 2:16 pm That is exactly what the bezier_to and arc_to are for.

Corjan
@Corjan

No that is not what I am referring to.

I just want to add a simple radius to each junction point. What you suggest makes manipulating data way to complected and the extra points will have to be set. KISS

I just want something like in the _rect() where we can add a radius to the corners.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: cache function

#9 Post by Corjan »

The arc_to does exactly the same as the rect corner radius:
http://siminnovations.com/wiki/index.php?title=Arc_to

Corjan

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: cache function

#10 Post by Keith Baxter »

Corjan wrote: Fri Sep 04, 2020 2:34 pm The arc_to does exactly the same as the rect corner radius:
http://siminnovations.com/wiki/index.php?title=Arc_to

Corjan
Sorry for slow responding. I am churning and manipulating data, so the reaction time is lethargic.

Ok so it looks like no appetite for simplicity. I respect. Maybe i am also not understanding correct and we are not finding each other on this point.

I just thought, for guys like "ME" a simple _line_to(x,y,corner) would be a lot easier than going the _bezier_to(cp1x, cp1y, cp2x, cp2y, x, y) route. That can be used for other applications where one is not relying on complex programming and math to draw sophisticated shapes.

Or first prize _polygon(x,y,x,y,x,y,x,y,x,y,corner)

Sleep on it. It has been a long week. :mrgreen:

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply