1 : /******************************************************************************
2 : *
3 : * Purpose: Declaration of the Airphoto segment interface and the helper
4 : * storage objects.
5 : *
6 : ******************************************************************************
7 : * Copyright (c) 2010
8 : * PCI Geomatics, 50 West Wilmot Street, Richmond Hill, Ont, Canada
9 : *
10 : * Permission is hereby granted, free of charge, to any person obtaining a
11 : * copy of this software and associated documentation files (the "Software"),
12 : * to deal in the Software without restriction, including without limitation
13 : * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 : * and/or sell copies of the Software, and to permit persons to whom the
15 : * Software is furnished to do so, subject to the following conditions:
16 : *
17 : * The above copyright notice and this permission notice shall be included
18 : * in all copies or substantial portions of the Software.
19 : *
20 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 : * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 : * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 : * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 : * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 : * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 : * DEALINGS IN THE SOFTWARE.
27 : ****************************************************************************/
28 : #ifndef __INCLUDE_PCIDSK_SRC_PCIDSK_AIRPHOTO_H
29 : #define __INCLUDE_PCIDSK_SRC_PCIDSK_AIRPHOTO_H
30 :
31 : #include "pcidsk_config.h"
32 :
33 : #include <vector>
34 : #include <string>
35 : #include <utility>
36 :
37 : namespace PCIDSK {
38 : /**
39 : * Structure for storing interior orientation parameters associated
40 : * with the APModel
41 : */
42 : class PCIDSK_DLL PCIDSKAPModelIOParams
43 0 : {
44 : public:
45 : PCIDSKAPModelIOParams(std::vector<double> const& imgtofocalx,
46 : std::vector<double> const& imgtofocaly,
47 : std::vector<double> const& focaltocolumn,
48 : std::vector<double> const& focaltorow,
49 : double focal_len,
50 : std::pair<double, double> const& prin_pt,
51 : std::vector<double> const& radial_dist);
52 : std::vector<double> const& GetImageToFocalPlaneXCoeffs(void) const;
53 : std::vector<double> const& GetImageToFocalPlaneYCoeffs(void) const;
54 : std::vector<double> const& GetFocalPlaneToColumnCoeffs(void) const;
55 : std::vector<double> const& GetFocalPlaneToRowCoeffs(void) const;
56 :
57 : double GetFocalLength(void) const;
58 : std::pair<double, double> const& GetPrincipalPoint(void) const;
59 : std::vector<double> const& GetRadialDistortionCoeffs(void) const;
60 : private:
61 : std::vector<double> imgtofocalx_;
62 : std::vector<double> imgtofocaly_;
63 : std::vector<double> focaltocolumn_;
64 : std::vector<double> focaltorow_;
65 : double focal_len_;
66 : std::pair<double, double> prin_point_;
67 : std::vector<double> rad_dist_coeff_;
68 : };
69 :
70 : /**
71 : * Structure for storing exterior orientation parameters associated
72 : * with the APModel
73 : */
74 : class PCIDSK_DLL PCIDSKAPModelEOParams
75 0 : {
76 : public:
77 : PCIDSKAPModelEOParams(std::string const& rotation_type,
78 : std::vector<double> const& earth_to_body,
79 : std::vector<double> const& perspect_cen,
80 : unsigned int epsg_code = 0);
81 : std::string GetEarthToBodyRotationType(void) const;
82 : std::vector<double> const& GetEarthToBodyRotation(void) const;
83 : std::vector<double> const& GetPerspectiveCentrePosition(void) const;
84 : unsigned int GetEPSGCode(void) const;
85 : private:
86 : std::string rot_type_;
87 : std::vector<double> earth_to_body_;
88 : std::vector<double> perspective_centre_pos_;
89 : unsigned int epsg_code_;
90 : };
91 :
92 : class PCIDSK_DLL PCIDSKAPModelMiscParams
93 0 : {
94 : public:
95 : PCIDSKAPModelMiscParams(std::vector<double> const& decentering_coeffs,
96 : std::vector<double> const& x3dcoord,
97 : std::vector<double> const& y3dcoord,
98 : std::vector<double> const& z3dcoord,
99 : double radius,
100 : double rff,
101 : double min_gcp_hgt,
102 : double max_gcp_hgt,
103 : bool is_prin_pt_off,
104 : bool has_dist,
105 : bool has_decent,
106 : bool has_radius);
107 : std::vector<double> const& GetDecenteringDistortionCoeffs(void) const;
108 : std::vector<double> const& GetX3DCoord(void) const;
109 : std::vector<double> const& GetY3DCoord(void) const;
110 : std::vector<double> const& GetZ3DCoord(void) const;
111 : double GetRadius(void) const;
112 : double GetRFF(void) const; // radius * focal * focal
113 : double GetGCPMinHeight(void) const;
114 : double GetGCPMaxHeight(void) const;
115 : bool IsPrincipalPointOffset(void) const;
116 : bool HasDistortion(void) const;
117 : bool HasDecentering(void) const;
118 : bool HasRadius(void) const;
119 : private:
120 : std::vector<double> decentering_coeffs_;
121 : std::vector<double> x3dcoord_;
122 : std::vector<double> y3dcoord_;
123 : std::vector<double> z3dcoord_;
124 : double radius_, rff_, min_gcp_hgt_, max_gcp_hgt_;
125 : bool is_prin_pt_off_;
126 : bool has_dist_;
127 : bool has_decent_;
128 : bool has_radius_;
129 : };
130 :
131 : /**
132 : * Interface for accessing the contents of the Airphoto Model
133 : * segment.
134 : */
135 : class PCIDSKAPModelSegment
136 0 : {
137 : public:
138 0 : virtual ~PCIDSKAPModelSegment() {}
139 :
140 : virtual unsigned int GetWidth(void) const = 0;
141 : virtual unsigned int GetHeight(void) const = 0;
142 : virtual unsigned int GetDownsampleFactor(void) const = 0;
143 :
144 : // Interior Orientation Parameters
145 : virtual PCIDSKAPModelIOParams const& GetInteriorOrientationParams(void) const = 0;
146 :
147 : // Exterior Orientation Parameters
148 : virtual PCIDSKAPModelEOParams const& GetExteriorOrientationParams(void) const = 0;
149 :
150 : // ProjInfo
151 : virtual PCIDSKAPModelMiscParams const& GetAdditionalParams(void) const = 0;
152 :
153 : virtual std::string GetMapUnitsString(void) const = 0;
154 : virtual std::string GetUTMUnitsString(void) const = 0;
155 : virtual std::vector<double> const& GetProjParams(void) const = 0;
156 :
157 : };
158 :
159 : } // end namespace PCIDSK
160 :
161 : #endif // __INCLUDE_PCIDSK_SRC_PCIDSK_AIRPHOTO_H
162 :
|