OpendTect
6.6
|
Class to provide coordinate conversion between a cartesian coordinate system (or any other transformed cartesian) and UI coordinate system(screen coordinate system.) More...
Public Member Functions | |
uiWorld2Ui () | |
uiWorld2Ui (const uiRect &rc, const uiWorldRect &wr) | |
uiWorld2Ui (const uiSize &sz, const uiWorldRect &wr) | |
uiWorld2Ui (const uiWorldRect &wr, const uiSize &sz) | |
uiWorld2Ui (const World2UiData &w) | |
void | getWorldXRange (float &xmin, float &xmax) const |
void | getWorldYRange (float &ymin, float &ymax) const |
bool | operator== (const uiWorld2Ui &) const |
uiWorldPoint | origin () const |
void | resetUiRect (const uiRect &rc) |
void | set (const uiRect &rc, const uiWorldRect &wr) |
void | set (const uiSize &sz, const uiWorldRect &wr) |
void | set (const uiWorldRect &wr, const uiSize &sz) |
void | set (const World2UiData &w) |
void | set (uiRect rc, const SurveyInfo &si) |
void | setCartesianRemap (const uiRect &rc, float minx, float maxx, float miny, float maxy) |
void | setCartesianRemap (const uiSize &sz, float minx, float maxx, float miny, float maxy) |
void | setRemap (const uiRect &rc, const uiWorldRect &wrdrc) |
void | setRemap (const uiSize &sz, const uiWorldRect &wrdrc) |
Quite useful for survey level maps. More... | |
int | toUiX (float wrdx) const |
int | toUiY (float wrdy) const |
float | toWorldX (int uix) const |
float | toWorldY (int uiy) const |
void | transform (const Geom::Point2D< float > &pt, uiPoint &upt) const |
template<class TT , class FT > | |
Geom::Point2D< TT > | transform (const Geom::Point2D< FT > &, bool toworld) const |
void | transform (const uiPoint &upt, Geom::Point2D< float > &pt) const |
uiWorldPoint | transform (uiPoint p) const |
uiWorldRect | transform (uiRect area) const |
uiPoint | transform (uiWorldPoint p) const |
uiRect | transform (uiWorldRect area) const |
template<class TT , class FT > | |
TT | transformX (FT x, bool toworld) const |
template<class TT , class FT > | |
TT | transformY (FT y, bool toworld) const |
const World2UiData & | world2UiData () const |
uiWorldPoint | worldPerPixel () const |
numbers may be negative More... | |
Protected Attributes | |
uiWorldPoint | fac |
uiWorldPoint | p0 |
uiPoint | uiorigin |
uiSize | uisize_ |
World2UiData | w2ud |
uiWorldRect | wrdrect_ |
the world rect used for coord. conv. More... | |
Private Member Functions | |
void | getAppropriateRange (float min, float max, float &newmin, float &newmax) |
Class to provide coordinate conversion between a cartesian coordinate system (or any other transformed cartesian) and UI coordinate system(screen coordinate system.)
Use the constructor or call set() to set up the two coordinate systems. 1) If the origin of UI is not at (0,0), use uiRect instead of uiSize to set up the UI coordinates. 2) In many cases the 'border' of world coordinate system is not at a good place, e.x. X ( 0.047 - 0.987 ). we would prefer to set it to an more appropriate range ( 0 - 1 ) and re-map this range to the UI window. This is done by calling setRemap() or setCartesianRemap(). The proper range is estimated by these functions and coordinate conversion will be based on the new world X/Y range.
<>
uiWorld2Ui::uiWorld2Ui | ( | ) |
uiWorld2Ui::uiWorld2Ui | ( | const uiSize & | sz, |
const uiWorldRect & | wr | ||
) |
uiWorld2Ui::uiWorld2Ui | ( | const uiRect & | rc, |
const uiWorldRect & | wr | ||
) |
uiWorld2Ui::uiWorld2Ui | ( | const uiWorldRect & | wr, |
const uiSize & | sz | ||
) |
uiWorld2Ui::uiWorld2Ui | ( | const World2UiData & | w | ) |
|
private |
void uiWorld2Ui::getWorldXRange | ( | float & | xmin, |
float & | xmax | ||
) | const |
If the world X/Y range has been re-calculated by calling setRemap() or setCartesianRemap(), call these two functions to get the new value
void uiWorld2Ui::getWorldYRange | ( | float & | ymin, |
float & | ymax | ||
) | const |
bool uiWorld2Ui::operator== | ( | const uiWorld2Ui & | ) | const |
uiWorldPoint uiWorld2Ui::origin | ( | ) | const |
void uiWorld2Ui::resetUiRect | ( | const uiRect & | rc | ) |
The following reset...() functions must be called ONLY AFTER a call to set...() is made.
void uiWorld2Ui::set | ( | const uiRect & | rc, |
const uiWorldRect & | wr | ||
) |
void uiWorld2Ui::set | ( | const uiSize & | sz, |
const uiWorldRect & | wr | ||
) |
void uiWorld2Ui::set | ( | const uiWorldRect & | wr, |
const uiSize & | sz | ||
) |
void uiWorld2Ui::set | ( | const World2UiData & | w | ) |
void uiWorld2Ui::set | ( | uiRect | rc, |
const SurveyInfo & | si | ||
) |
void uiWorld2Ui::setCartesianRemap | ( | const uiRect & | rc, |
float | minx, | ||
float | maxx, | ||
float | miny, | ||
float | maxy | ||
) |
void uiWorld2Ui::setCartesianRemap | ( | const uiSize & | sz, |
float | minx, | ||
float | maxx, | ||
float | miny, | ||
float | maxy | ||
) |
For most cases we are dealing with cartesian coord. system. Just pass the X/Y range to set up
void uiWorld2Ui::setRemap | ( | const uiRect & | rc, |
const uiWorldRect & | wrdrc | ||
) |
void uiWorld2Ui::setRemap | ( | const uiSize & | sz, |
const uiWorldRect & | wrdrc | ||
) |
Quite useful for survey level maps.
int uiWorld2Ui::toUiX | ( | float | wrdx | ) | const |
int uiWorld2Ui::toUiY | ( | float | wrdy | ) | const |
float uiWorld2Ui::toWorldX | ( | int | uix | ) | const |
float uiWorld2Ui::toWorldY | ( | int | uiy | ) | const |
void uiWorld2Ui::transform | ( | const Geom::Point2D< float > & | pt, |
uiPoint & | upt | ||
) | const |
Geom::Point2D< TT > uiWorld2Ui::transform | ( | const Geom::Point2D< FT > & | ptin, |
bool | toworld | ||
) | const |
void uiWorld2Ui::transform | ( | const uiPoint & | upt, |
Geom::Point2D< float > & | pt | ||
) | const |
uiWorldPoint uiWorld2Ui::transform | ( | uiPoint | p | ) | const |
uiWorldRect uiWorld2Ui::transform | ( | uiRect | area | ) | const |
uiPoint uiWorld2Ui::transform | ( | uiWorldPoint | p | ) | const |
uiRect uiWorld2Ui::transform | ( | uiWorldRect | area | ) | const |
TT uiWorld2Ui::transformX | ( | FT | x, |
bool | toworld | ||
) | const |
TT uiWorld2Ui::transformY | ( | FT | y, |
bool | toworld | ||
) | const |
const World2UiData& uiWorld2Ui::world2UiData | ( | ) | const |
uiWorldPoint uiWorld2Ui::worldPerPixel | ( | ) | const |
numbers may be negative
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
the world rect used for coord. conv.
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2022