[Geometry] Registering the Windows RECT structure
Hi all, Does anybody know whether the Windows RECT structure is known to the boost geometry library. The RECT structure is declared as follows: typedef struct _RECT { LONG left; LONG top; LONG right; LONG bottom; } RECT, *PRECT; Members left The x-coordinate of the upper-left corner of the rectangle. top The y-coordinate of the upper-left corner of the rectangle. right The x-coordinate of the lower-right corner of the rectangle. bottom The y-coordinate of the lower-right corner of the rectangle. If there is no registration, is there an example that shows how to do this? Any help appreciated. Regards Sean.
Hi Sean, Sean Farrow wrote On 18-1-2014 14:24:
Hi all,
Does anybody know whether the Windows RECT structure is known to the boost geometry library. The RECT structure is declared as follows:
typedefstruct_RECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT, *PRECT;
*Members*
*left*
The x-coordinate of the upper-left corner of the rectangle.
*top*
The y-coordinate of the upper-left corner of the rectangle.
*right*
The x-coordinate of the lower-right corner of the rectangle.
*bottom*
The y-coordinate of the lower-right corner of the rectangle.
If there is no registration, is there an example that shows how to do this?
Any help appreciated.
You can use BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES http://www.boost.org/doc/libs/1_55_0/libs/geometry/doc/html/geometry/referen... You should have a suitable point-struct too. Regards, Barend
On 19/01/2014 04:57, Quoth Barend Gehrels:
Does anybody know whether the Windows RECT structure is known to the boost geometry library. The RECT structure is declared as follows: [...] You can use BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES
I'm not really familiar enough with Boost.Geometry to know if this is an issue or not, but something that might trip you up is that WinAPI RECTs are normally only half-closed -- ie. the bottom-right point is not actually contained in the rectangle. I had a brief look through the Geometry docs but couldn't find anything specific, but I would imagine that it probably assumes inclusive boxes.
participants (3)
-
Barend Gehrels
-
Gavin Lambert
-
Sean Farrow