OpendTect  7.0
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
uiWorld2Ui Class Reference

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)
 
virtual ~uiWorld2Ui ()
 
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 World2UiDataworld2UiData () 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)
 

Detailed Description

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.

<>

Constructor & Destructor Documentation

◆ uiWorld2Ui() [1/5]

uiWorld2Ui::uiWorld2Ui ( )

◆ uiWorld2Ui() [2/5]

uiWorld2Ui::uiWorld2Ui ( const uiSize sz,
const uiWorldRect wr 
)

◆ uiWorld2Ui() [3/5]

uiWorld2Ui::uiWorld2Ui ( const uiRect rc,
const uiWorldRect wr 
)

◆ uiWorld2Ui() [4/5]

uiWorld2Ui::uiWorld2Ui ( const uiWorldRect wr,
const uiSize sz 
)

◆ uiWorld2Ui() [5/5]

uiWorld2Ui::uiWorld2Ui ( const World2UiData w)

◆ ~uiWorld2Ui()

virtual uiWorld2Ui::~uiWorld2Ui ( )
virtual

Member Function Documentation

◆ getAppropriateRange()

void uiWorld2Ui::getAppropriateRange ( float  min,
float  max,
float &  newmin,
float &  newmax 
)
private

◆ getWorldXRange()

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

◆ getWorldYRange()

void uiWorld2Ui::getWorldYRange ( float &  ymin,
float &  ymax 
) const

◆ operator==()

bool uiWorld2Ui::operator== ( const uiWorld2Ui ) const

◆ origin()

uiWorldPoint uiWorld2Ui::origin ( ) const

◆ resetUiRect()

void uiWorld2Ui::resetUiRect ( const uiRect rc)

The following reset...() functions must be called ONLY AFTER a call to set...() is made.

◆ set() [1/5]

void uiWorld2Ui::set ( const uiRect rc,
const uiWorldRect wr 
)

◆ set() [2/5]

void uiWorld2Ui::set ( const uiSize sz,
const uiWorldRect wr 
)

◆ set() [3/5]

void uiWorld2Ui::set ( const uiWorldRect wr,
const uiSize sz 
)

◆ set() [4/5]

void uiWorld2Ui::set ( const World2UiData w)

◆ set() [5/5]

void uiWorld2Ui::set ( uiRect  rc,
const SurveyInfo si 
)

◆ setCartesianRemap() [1/2]

void uiWorld2Ui::setCartesianRemap ( const uiRect rc,
float  minx,
float  maxx,
float  miny,
float  maxy 
)

◆ setCartesianRemap() [2/2]

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

◆ setRemap() [1/2]

void uiWorld2Ui::setRemap ( const uiRect rc,
const uiWorldRect wrdrc 
)

◆ setRemap() [2/2]

void uiWorld2Ui::setRemap ( const uiSize sz,
const uiWorldRect wrdrc 
)

Quite useful for survey level maps.

◆ toUiX()

int uiWorld2Ui::toUiX ( float  wrdx) const

◆ toUiY()

int uiWorld2Ui::toUiY ( float  wrdy) const

◆ toWorldX()

float uiWorld2Ui::toWorldX ( int  uix) const

◆ toWorldY()

float uiWorld2Ui::toWorldY ( int  uiy) const

◆ transform() [1/7]

void uiWorld2Ui::transform ( const Geom::Point2D< float > &  pt,
uiPoint upt 
) const

◆ transform() [2/7]

template<class TT , class FT >
Geom::Point2D< TT > uiWorld2Ui::transform ( const Geom::Point2D< FT > &  ptin,
bool  toworld 
) const

◆ transform() [3/7]

void uiWorld2Ui::transform ( const uiPoint upt,
Geom::Point2D< float > &  pt 
) const

◆ transform() [4/7]

uiWorldPoint uiWorld2Ui::transform ( uiPoint  p) const

◆ transform() [5/7]

uiWorldRect uiWorld2Ui::transform ( uiRect  area) const

◆ transform() [6/7]

uiPoint uiWorld2Ui::transform ( uiWorldPoint  p) const

◆ transform() [7/7]

uiRect uiWorld2Ui::transform ( uiWorldRect  area) const

◆ transformX()

template<class TT , class FT >
TT uiWorld2Ui::transformX ( FT  x,
bool  toworld 
) const

◆ transformY()

template<class TT , class FT >
TT uiWorld2Ui::transformY ( FT  y,
bool  toworld 
) const

◆ world2UiData()

const World2UiData& uiWorld2Ui::world2UiData ( ) const

◆ worldPerPixel()

uiWorldPoint uiWorld2Ui::worldPerPixel ( ) const

numbers may be negative

Member Data Documentation

◆ fac

uiWorldPoint uiWorld2Ui::fac
protected

◆ p0

uiWorldPoint uiWorld2Ui::p0
protected

◆ uiorigin

uiPoint uiWorld2Ui::uiorigin
protected

◆ uisize_

uiSize uiWorld2Ui::uisize_
protected

◆ w2ud

World2UiData uiWorld2Ui::w2ud
protected

◆ wrdrect_

uiWorldRect uiWorld2Ui::wrdrect_
protected

the world rect used for coord. conv.


Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024