Jump to content
  • Advertisement
Sign in to follow this  
LonelyStar

maximum free rectangle space

This topic is 3249 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, This sounds like I want to program my own window manager, but I do not . I just want to contribute to PyTyle! I am wondering if there exist a free implementation of a "maximum free recangle" algorithm, that I could use. With this I mean an algorithm, which gets a set of rectangles as inputs and calculates the the biggest free space between them (given a bounding box). With the bounding box set to the viewport and the set of recangles set to the other windows, this should be a common problem for WMs, should it not? I searched without luck. I found a lot algorithms explained, but all with a little different setting (most free space without any of a given point set in it). Anyone knows a algorithm or implementation suited for this? Thank! Nathan

Share this post


Link to post
Share on other sites
Advertisement
Cycle through the windows and note the max (left, top) edge and min (right, bottom) edge that you encounter.

Share this post


Link to post
Share on other sites
Hi,

I think this is a misunderstanding. I do not want to find the biggest rectangle/window but the biggest free space not occupied by any window/rectangle.

Sorry for beeing unclear.

Regards,
Nathan

Share this post


Link to post
Share on other sites
Quote:
Original post by LonelyStarI think this is a misunderstanding. I do not want to find the biggest rectangle/window but the biggest free space not occupied by any window/rectangle.

Sorry for beeing unclear.


Not to be rude, but you're still unclear. [smile] Do you mean the biggest space where you can put a new rectangle without it overlapping any others?

Share this post


Link to post
Share on other sites
Quote:
Original post by theOcelot

Not to be rude, but you're still unclear. [smile] Do you mean the biggest space where you can put a new rectangle without it overlapping any others?


Exactly!

Share this post


Link to post
Share on other sites
I think that most WM's just don't worry about overlapping. You might have to take a similar approach. Beyond that, I'm not nearly clever enough in that area to help you much. Read about the bin packing problem to find out what kind of water you're getting into.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!