S
Sims
Hi,
I know this is slightly OT but before i can get to the programming part i
want to make sure that i have the structure covered.
I have a 2D map and items in my list/vector will be lines on the map, with a
start and finish point within the map, so an item would have a start pos
S(x,y) and an end pos E(x,y).
so my structure would be something like
struct _POS{
int x;
int y;
};
struct _ITEMLOC{
_POS pos_start;
_POS pos_end;
};
So in effect it would be a straight line going from one point to another.
If i have a vector with hundreds of items i want to retrieve all the items
that fall within a certain square.
something like Search( top, left, bottom, right). And that would return all
the items whose line are within that square, (either partially or totally).
Does anybody know how i could achieve that?
Many thanks in advance.
Sims
I know this is slightly OT but before i can get to the programming part i
want to make sure that i have the structure covered.
I have a 2D map and items in my list/vector will be lines on the map, with a
start and finish point within the map, so an item would have a start pos
S(x,y) and an end pos E(x,y).
so my structure would be something like
struct _POS{
int x;
int y;
};
struct _ITEMLOC{
_POS pos_start;
_POS pos_end;
};
So in effect it would be a straight line going from one point to another.
If i have a vector with hundreds of items i want to retrieve all the items
that fall within a certain square.
something like Search( top, left, bottom, right). And that would return all
the items whose line are within that square, (either partially or totally).
Does anybody know how i could achieve that?
Many thanks in advance.
Sims