OpendTect  6.6
crsproj.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Raman Singh
8  Date: April 2017
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "crsmod.h"
14 #include "latlong.h"
15 #include "manobjectset.h"
16 #include "uistring.h"
17 
18 class BufferStringSet;
19 
20 namespace Coords
21 {
22 
23 typedef int ProjectionID;
24 
26 {
27 public:
28  AuthorityCode(const char* auth,ProjectionID i)
29  : authority_(auth),id_(i) {}
31  : authority_(oth.authority_),id_(oth.id_) {}
32 
33  BufferString authority() const { return authority_; }
34  ProjectionID id() const { return id_; }
35 
36  bool operator ==(const AuthorityCode&) const;
37 
38  static AuthorityCode fromString(const char*);
40 
41 protected:
42 
45 };
46 
47 
50 public:
51 
52  Projection(AuthorityCode,const char* usernm,
53  const char* defstr);
54  virtual ~Projection();
55 
56  AuthorityCode authCode() const { return authcode_; }
57  BufferString userName() const { return usernm_; }
58  BufferString defStr() const { return defstr_; }
59 
60  virtual bool isOK() const;
61  virtual bool getReady() const { return true; }
62 
63  virtual bool isOrthogonal() const;
64  virtual bool isLatLong() const { return false; }
65  virtual bool isFeet() const;
66  virtual bool isMeter() const;
67 
69  BufferStringSet& names,
70  BufferStringSet& defstrs,
71  bool orthogonalonly=false );
73  static const Projection* getByName(const char*);
74  static BufferString getInfoText(const char* defstr);
75 
76 protected:
77 
78  virtual LatLong toGeographic(const Coord&,
79  bool wgs84=false) const;
80  virtual Coord fromGeographic(const LatLong&,
81  bool wgs84=false) const;
82 
84 
85 private:
86 
87  virtual Coord transformTo(const Projection& target,
88  LatLong) const;
89  virtual LatLong transformTo(const Projection& target,
90  Coord) const;
91 
94 
95  friend class ProjectionBasedSystem;
96 };
97 
98 
101 public:
102 
103  ProjectionRepos(const char* key,
104  uiString desc);
105 
106  const char* key() const { return key_.buf(); }
107  uiString description() const { return desc_; }
108 
109  bool readFromFile(const char* fnm);
110 
112  const Projection* getByName(const char*) const;
113 
114  static void addRepos(ProjectionRepos*);
115  static const ProjectionRepos* getRepos(const char* key);
117  { return reposset_; }
119  static void initStdRepos();
120 
121 protected:
122 
125 
127 
128 };
129 
130 }; //namespace
Coords::Projection::transformTo
virtual Coord transformTo(const Projection &target, LatLong) const
Coords::Projection::isOK
virtual bool isOK() const
Coords::Projection::usernm_
BufferString usernm_
Definition: crsproj.h:93
Coords::AuthorityCode::authority_
BufferString authority_
Definition: crsproj.h:43
uistring.h
Coords::ProjectionRepos::getByName
const Projection * getByName(const char *) const
Coords::ProjectionRepos::description
uiString description() const
Definition: crsproj.h:107
Coords::Projection::defstr_
BufferString defstr_
Definition: crsproj.h:83
Coords::AuthorityCode::id
ProjectionID id() const
Definition: crsproj.h:34
Coords::Projection::getInfoText
static BufferString getInfoText(const char *defstr)
ObjectSet
Set of pointers to objects.
Definition: commontypes.h:31
BufferStringSet
Set of BufferString objects.
Definition: bufstringset.h:26
Coords::Projection::isLatLong
virtual bool isLatLong() const
Definition: crsproj.h:64
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
Coords::Projection::fromGeographic
virtual Coord fromGeographic(const LatLong &, bool wgs84=false) const
Coords::ProjectionRepos::ProjectionRepos
ProjectionRepos(const char *key, uiString desc)
Coords::Projection::~Projection
virtual ~Projection()
Coords::Projection::authCode
AuthorityCode authCode() const
Definition: crsproj.h:56
Coords::Projection::authcode_
AuthorityCode authcode_
Definition: crsproj.h:92
operator==
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:81
Coords::AuthorityCode::toString
BufferString toString() const
Coords::ProjectionRepos::initStdRepos
static void initStdRepos()
Coords::ProjectionRepos::mODTextTranslationClass
mODTextTranslationClass(ProjectionRepos)
ManagedObjectSet< Projection >
Coords::ProjectionRepos::addRepos
static void addRepos(ProjectionRepos *)
Coords::Projection::toGeographic
virtual LatLong toGeographic(const Coord &, bool wgs84=false) const
Coord
A cartesian coordinate in 2D space.
Definition: coord.h:25
Coords::Projection
Definition: crsproj.h:49
Coords::Projection::isFeet
virtual bool isFeet() const
latlong.h
Coords::ProjectionRepos::desc_
uiString desc_
Definition: crsproj.h:124
Coords::ProjectionID
int ProjectionID
Definition: crsproj.h:23
Coords::AuthorityCode::id_
ProjectionID id_
Definition: crsproj.h:44
Coords::ProjectionRepos::key_
BufferString key_
Definition: crsproj.h:123
Coords::Projection::isMeter
virtual bool isMeter() const
Coords::Projection::mODTextTranslationClass
mODTextTranslationClass(Projection)
Coords::ProjectionRepos::reposSet
static const ObjectSet< ProjectionRepos > & reposSet()
Definition: crsproj.h:116
Coords::Projection::transformTo
virtual LatLong transformTo(const Projection &target, Coord) const
Coords::Projection::userName
BufferString userName() const
Definition: crsproj.h:57
Coords::AuthorityCode::authority
BufferString authority() const
Definition: crsproj.h:33
Coords::AuthorityCode::AuthorityCode
AuthorityCode(const char *auth, ProjectionID i)
Definition: crsproj.h:28
Coords::ProjectionRepos::getAuthKeys
static void getAuthKeys(BufferStringSet &)
Coords
Definition: coordsystem.h:22
Coords::ProjectionRepos::readFromFile
bool readFromFile(const char *fnm)
Coords::ProjectionRepos::getRepos
static const ProjectionRepos * getRepos(const char *key)
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
Coords::Projection::Projection
Projection(AuthorityCode, const char *usernm, const char *defstr)
Coords::Projection::getReady
virtual bool getReady() const
Definition: crsproj.h:61
uiString
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
Coords::ProjectionBasedSystem
Definition: crssystem.h:21
Coords::AuthorityCode
Definition: crsproj.h:26
Coords::ProjectionRepos::getByAuthCode
const Projection * getByAuthCode(AuthorityCode) const
Coords::Projection::getAll
static void getAll(TypeSet< AuthorityCode > &, BufferStringSet &names, BufferStringSet &defstrs, bool orthogonalonly=false)
Coords::Projection::getByAuthCode
static const Projection * getByAuthCode(AuthorityCode)
Coords::ProjectionRepos::key
const char * key() const
Definition: crsproj.h:106
LatLong
Geographical coordinates in Decimal Degrees but with conv to deg, min, sec.
Definition: latlong.h:27
Coords::Projection::getByName
static const Projection * getByName(const char *)
manobjectset.h
Coords::Projection::isOrthogonal
virtual bool isOrthogonal() const
Coords::AuthorityCode::AuthorityCode
AuthorityCode(const AuthorityCode &oth)
Definition: crsproj.h:30
Coords::AuthorityCode::fromString
static AuthorityCode fromString(const char *)
Coords::ProjectionRepos::reposset_
static ObjectSet< ProjectionRepos > reposset_
Definition: crsproj.h:126
Coords::ProjectionRepos
Definition: crsproj.h:100
Coords::Projection::defStr
BufferString defStr() const
Definition: crsproj.h:58
TypeSet
Sets of (small) copyable elements.
Definition: commontypes.h:29

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