expose more coordinate transform methods, allowing projecting box2d<double> into screen coordinates at the same time as reprojecting geographical coordinates
This commit is contained in:
parent
13d192f255
commit
f5ed4305f4
1 changed files with 28 additions and 0 deletions
|
@ -186,6 +186,20 @@ public:
|
|||
return c;
|
||||
}
|
||||
|
||||
inline box2d<double> forward(const box2d<double>& e,proj_transform const& prj_trans) const
|
||||
{
|
||||
double x0 = e.minx();
|
||||
double y0 = e.miny();
|
||||
double x1 = e.maxx();
|
||||
double y1 = e.maxy();
|
||||
double z = 0.0;
|
||||
prj_trans.backward(x0,y0,z);
|
||||
forward(&x0,&y0);
|
||||
prj_trans.backward(x1,y1,z);
|
||||
forward(&x1,&y1);
|
||||
return box2d<double>(x0,y0,x1,y1);
|
||||
}
|
||||
|
||||
inline box2d<double> forward(const box2d<double>& e) const
|
||||
{
|
||||
double x0 = e.minx();
|
||||
|
@ -197,6 +211,20 @@ public:
|
|||
return box2d<double>(x0,y0,x1,y1);
|
||||
}
|
||||
|
||||
inline box2d<double> backward(const box2d<double>& e,proj_transform const& prj_trans) const
|
||||
{
|
||||
double x0 = e.minx();
|
||||
double y0 = e.miny();
|
||||
double x1 = e.maxx();
|
||||
double y1 = e.maxy();
|
||||
double z = 0.0;
|
||||
backward(&x0,&y0);
|
||||
prj_trans.forward(x0,y0,z);
|
||||
backward(&x1,&y1);
|
||||
prj_trans.forward(x1,y1,z);
|
||||
return box2d<double>(x0,y0,x1,y1);
|
||||
}
|
||||
|
||||
inline box2d<double> backward(const box2d<double>& e) const
|
||||
{
|
||||
double x0 = e.minx();
|
||||
|
|
Loading…
Reference in a new issue