OpendTect 8.0
Loading...
Searching...
No Matches
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...

#include <uiworld2ui.h>

Public Member Functions

 uiWorld2Ui ()
 
 uiWorld2Ui (const uiRect &, const uiWorldRect &)
 
 uiWorld2Ui (const uiSize &, const uiWorldRect &)
 
 uiWorld2Ui (const uiWorldRect &, const uiSize &)
 
 uiWorld2Ui (const World2UiData &)
 
virtual ~uiWorld2Ui ()
 
void getWorldXRange (float &xmin, float &xmax) const
 
void getWorldYRange (float &ymin, float &ymax) const
 
uiWorld2Uioperator= (const uiWorld2Ui &)
 
bool operator== (const uiWorld2Ui &) const
 
uiWorldPoint origin () const
 
void resetUiRect (const uiRect &)
 
void set (const uiRect &rc, const SurveyInfo &)
 
void set (const uiRect &rc, const uiWorldRect &)
 
void set (const uiSize &sz, const uiWorldRect &)
 
void set (const uiWorldRect &, const uiSize &)
 
void set (const World2UiData &)
 
void setCartesianRemap (const uiRect &, float minx, float maxx, float miny, float maxy)
 
void setCartesianRemap (const uiSize &, float minx, float maxx, float miny, float maxy)
 
void setRemap (const uiRect &, const uiWorldRect &)
 
void setRemap (const uiSize &, const uiWorldRect &)
 Quite useful for survey level maps.
 
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 > &, uiPoint &) const
 
template<class TT , class FT >
Geom::Point2D< TT > transform (const Geom::Point2D< FT > &, bool toworld) const
 
uiWorldPoint transform (const uiPoint &) const
 
void transform (const uiPoint &, Geom::Point2D< float > &) const
 
uiWorldRect transform (const uiRect &) const
 
uiPoint transform (const uiWorldPoint &) const
 
uiRect transform (const uiWorldRect &) 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
 

Protected Attributes

uiWorldPoint fac_
 
uiWorldPoint p0_
 
uiPoint uiorigin_
 
uiSize uisize_
 
World2UiData w2ud_
 
uiWorldRect wrdrect_
 the world rect used for coord. conv.
 

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 & ,
const uiWorldRect &  )

◆ uiWorld2Ui() [3/5]

uiWorld2Ui::uiWorld2Ui ( const uiRect & ,
const uiWorldRect &  )

◆ uiWorld2Ui() [4/5]

uiWorld2Ui::uiWorld2Ui ( const uiWorldRect & ,
const uiSize &  )

◆ uiWorld2Ui() [5/5]

uiWorld2Ui::uiWorld2Ui ( const World2UiData & )

◆ ~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=()

uiWorld2Ui & uiWorld2Ui::operator= ( const uiWorld2Ui & )

◆ operator==()

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

◆ origin()

uiWorldPoint uiWorld2Ui::origin ( ) const

◆ resetUiRect()

void uiWorld2Ui::resetUiRect ( const uiRect & )

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 SurveyInfo &  )

◆ set() [2/5]

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

◆ set() [3/5]

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

◆ set() [4/5]

void uiWorld2Ui::set ( const uiWorldRect & ,
const uiSize &  )

◆ set() [5/5]

void uiWorld2Ui::set ( const World2UiData & )

◆ setCartesianRemap() [1/2]

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

◆ setCartesianRemap() [2/2]

void uiWorld2Ui::setCartesianRemap ( const uiSize & ,
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 & ,
const uiWorldRect &  )

◆ setRemap() [2/2]

void uiWorld2Ui::setRemap ( const uiSize & ,
const uiWorldRect &  )

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 > & ,
uiPoint &  ) 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]

uiWorldPoint uiWorld2Ui::transform ( const uiPoint & ) const

◆ transform() [4/7]

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

◆ transform() [5/7]

uiWorldRect uiWorld2Ui::transform ( const uiRect & ) const

◆ transform() [6/7]

uiPoint uiWorld2Ui::transform ( const uiWorldPoint & ) const

◆ transform() [7/7]

uiRect uiWorld2Ui::transform ( const uiWorldRect & ) 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-2025