OpenZGY/C++ API and Internals (ALPHA)
Access seismic data stored in ZGY format.
cornerpoints.h
Go to the documentation of this file.
1 // Copyright 2017-2020, Schlumberger
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 //Adapted from: Zgy/FileAccess/OrderedCornerPoints
16 #pragma once
17 
18 #include "../declspec.h"
19 
20 #include <stddef.h>
21 #include <array>
22 #include <cstdint>
23 
29 namespace InternalZGY {
30 #if 0
31 }
32 #endif
33 
47 class OPENZGY_TEST_API OrderedCornerPoints
48 {
49 public:
50 
52  enum
53  {
54  Min0Min1,
57  Max0Max1
58  };
59 
60  typedef std::int64_t index_type;
61  typedef float annot_type;
62  typedef double coord_type;
65  struct OPENZGY_TEST_API Element
66  {
67  index_type i;
68  index_type j;
75  Element();
76 
78  Element(index_type _i, index_type _j);
79 
81  Element(index_type _i, index_type _j, annot_type _il, annot_type _xl, coord_type _x, coord_type _y);
82  };
83 
86 
98  (
99  annot_type il0, annot_type ilinc, size_t ilcnt,
100  annot_type xl0, annot_type xlinc, size_t xlcnt,
101  const std::array<std::array<coord_type,2>,4>& ocp
102  );
103 
126  (
127  annot_type il0, annot_type ilinc, size_t ilcnt,
128  annot_type xl0, annot_type xlinc, size_t xlcnt,
129  annot_type acp0il, annot_type acp0xl, coord_type acp0x, coord_type acp0y,
130  annot_type acp1il, annot_type acp1xl, coord_type acp1x, coord_type acp1y,
131  annot_type acp2il, annot_type acp2xl, coord_type acp2x, coord_type acp2y
132  );
133 
139  const Element& operator[](size_t i) const { return m_element[i]; }
140 
142  std::array<std::array<coord_type,2>,4> index_coords() const;
144  std::array<std::array<coord_type,2>,4> annot_coords() const;
146  std::array<std::array<coord_type,2>,4> world_coords() const;
147 
148 private:
149 
150  std::array<Element,4> m_element;
151 };
152 
153 } // end namespace
InternalZGY::OrderedCornerPoints::Element::xl
annot_type xl
Definition: cornerpoints.h:70
InternalZGY::OrderedCornerPoints::operator[]
const Element & operator[](size_t i) const
Definition: cornerpoints.h:139
InternalZGY::OrderedCornerPoints::Element::il
annot_type il
Definition: cornerpoints.h:69
InternalZGY::OrderedCornerPoints::Max0Min1
@ Max0Min1
Definition: cornerpoints.h:55
InternalZGY::OrderedCornerPoints
Definition: cornerpoints.h:47
InternalZGY::OrderedCornerPoints::Element::y
coord_type y
Definition: cornerpoints.h:72
InternalZGY::OrderedCornerPoints::coord_type
double coord_type
Definition: cornerpoints.h:62
InternalZGY::OrderedCornerPoints::annot_type
float annot_type
Definition: cornerpoints.h:61
InternalZGY::OrderedCornerPoints::Element
Definition: cornerpoints.h:65
InternalZGY
Implementation not visible to clients.
InternalZGY::OrderedCornerPoints::Min0Max1
@ Min0Max1
Definition: cornerpoints.h:56
InternalZGY::OrderedCornerPoints::Element::x
coord_type x
Definition: cornerpoints.h:71
InternalZGY::OrderedCornerPoints::Element::j
index_type j
Definition: cornerpoints.h:68