OpendTect-6_4  6.4
uiworld2ui.h
Go to the documentation of this file.
1 #ifndef uiworld2ui_h
2 #define uiworld2ui_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Bril
9  Date: 13/8/2000
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 #include "uitoolsmod.h"
15 #include "uigeom.h"
16 
17 class SurveyInfo;
18 
24 {
25 public:
26 
27  World2UiData();
28  World2UiData( uiSize s, const uiWorldRect& w );
29  World2UiData( const uiWorldRect& w, uiSize s );
30 
31  bool operator ==( const World2UiData& w2ud ) const;
32  bool operator !=( const World2UiData& w2ud ) const;
33 
36 };
37 
38 
56 {
57 public:
58 
59  uiWorld2Ui();
60  uiWorld2Ui( const uiSize& sz, const uiWorldRect& wr );
61  uiWorld2Ui( const uiRect& rc, const uiWorldRect& wr );
62  uiWorld2Ui( const uiWorldRect& wr, const uiSize& sz );
63  uiWorld2Ui( const World2UiData& w );
64 
65  bool operator==(const uiWorld2Ui& ) const;
66 
67  void set( const World2UiData& w );
68  void set( const uiWorldRect& wr, const uiSize& sz );
69  void set( const uiSize& sz, const uiWorldRect& wr );
70  void set( const uiRect& rc, const uiWorldRect& wr );
71  void set( uiRect rc, const SurveyInfo& si );
73 
74  void setRemap( const uiSize& sz, const uiWorldRect& wrdrc );
75  void setRemap( const uiRect& rc, const uiWorldRect& wrdrc );
78  void setCartesianRemap( const uiSize& sz,
79  float minx, float maxx, float miny, float maxy );
80  void setCartesianRemap( const uiRect& rc,
81  float minx, float maxx, float miny, float maxy );
82 
85  void resetUiRect( const uiRect& rc );
86 
87  const World2UiData& world2UiData() const;
88 
89 
90  uiWorldPoint transform( uiPoint p ) const;
91  uiWorldRect transform( uiRect area ) const;
92  uiPoint transform( uiWorldPoint p ) const;
93  uiRect transform( uiWorldRect area ) const;
94  // Since the compiler will be confused if two functions
95  // only differ in return type, Geom::Point2D<float> is
96  // set rather than be returned.
97  void transform( const uiPoint& upt,
98  Geom::Point2D<float>& pt ) const;
99  void transform( const Geom::Point2D<float>& pt,
100  uiPoint& upt) const;
101 
102  int toUiX( float wrdx ) const;
103  int toUiY( float wrdy ) const;
104  float toWorldX( int uix ) const;
105  float toWorldY( int uiy ) const;
106 
107  uiWorldPoint origin() const;
108  uiWorldPoint worldPerPixel() const;
110 
114  void getWorldXRange( float& xmin, float& xmax ) const;
115  void getWorldYRange( float& ymin, float& ymax ) const;
116 
117 protected:
118 
120 
123 
127 
128 private:
129  void getAppropriateRange( float min, float max,
130  float& newmin, float& newmax );
131 };
132 
133 
134 #endif
Class to provide coordinate conversion between a cartesian coordinate system (or any other transforme...
Definition: uiworld2ui.h:55
#define mExpClass(module)
Definition: commondefs.h:160
Definition: uigeom.h:42
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
uiSize sz
Definition: uiworld2ui.h:34
uiSize uisize_
Definition: uiworld2ui.h:125
uiPoint uiorigin
Definition: uiworld2ui.h:126
Holds survey general information.
Definition: survinfo.h:45
Definition: uigeom.h:25
World2UiData w2ud
Definition: uiworld2ui.h:119
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:62
uiWorldPoint fac
Definition: uiworld2ui.h:122
uiWorldRect wrdrect_
the world rect used for coord. conv.
Definition: uiworld2ui.h:124
Coord transform(const BinID &b) const
Definition: uiworld2ui.h:23
uiWorldPoint p0
Definition: uiworld2ui.h:121
uiWorldRect wr
Definition: uiworld2ui.h:35

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