1 // Copyright (c) 2018, ETH Zurich and UNC Chapel Hill.
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are met:
6 //
7 //     * Redistributions of source code must retain the above copyright
8 //       notice, this list of conditions and the following disclaimer.
9 //
10 //     * Redistributions in binary form must reproduce the above copyright
11 //       notice, this list of conditions and the following disclaimer in the
12 //       documentation and/or other materials provided with the distribution.
13 //
14 //     * Neither the name of ETH Zurich and UNC Chapel Hill nor the names of
15 //       its contributors may be used to endorse or promote products derived
16 //       from this software without specific prior written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
22 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 // POSSIBILITY OF SUCH DAMAGE.
29 //
30 // Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)
31 
32 #include "ui/license_widget.h"
33 
34 namespace colmap {
35 
LicenseWidget(QWidget * parent)36 LicenseWidget::LicenseWidget(QWidget* parent) : QTextEdit(parent) {
37   setReadOnly(true);
38   setWindowFlags(Qt::Dialog);
39   resize(parent->width() - 20, parent->height() - 20);
40   setWindowTitle("License");
41 
42   QString licenses;
43   licenses += "<h2>COLMAP</h2>";
44   licenses += GetCOLMAPLicense();
45   licenses += "<h2>External</h2>";
46   licenses += "<h3>FLANN</h3>";
47   licenses += GetFLANNLicense();
48   licenses += "<h3>Graclus</h3>";
49   licenses += GetGraclusLicense();
50   licenses += "<h3>LSD</h3>";
51   licenses += GetLSDLicense();
52   licenses += "<h3>PBA</h3>";
53   licenses += GetPBALicense();
54   licenses += "<h3>PoissonRecon</h3>";
55   licenses += GetPoissonReconLicense();
56   licenses += "<h3>SiftGPU</h3>";
57   licenses += GetSiftGPULicense();
58   licenses += "<h3>SQLite</h3>";
59   licenses += GetSQLiteLicense();
60   licenses += "<h3>VLFeat</h3>";
61   licenses += GetVLFeatLicense();
62   setHtml(licenses);
63 }
64 
GetCOLMAPLicense() const65 QString LicenseWidget::GetCOLMAPLicense() const {
66   const QString license =
67       "Copyright (c) 2018, ETH Zurich and UNC Chapel Hill.<br>"
68       "All rights reserved.<br>"
69       "<br>"
70       "Redistribution and use in source and binary forms, with or without<br>"
71       "modification, are permitted provided that the following conditions are "
72       "met:<br>"
73       "<br>"
74       "    * Redistributions of source code must retain the above copyright<br>"
75       "      notice, this list of conditions and the following disclaimer.<br>"
76       "<br>"
77       "    * Redistributions in binary form must reproduce the above "
78       "copyright<br>"
79       "      notice, this list of conditions and the following disclaimer in "
80       "the<br>"
81       "      documentation and/or other materials provided with the "
82       "distribution.<br>"
83       "<br>"
84       "    * Neither the name of ETH Zurich and UNC Chapel Hill nor the names "
85       "of<br>"
86       "      its contributors may be used to endorse or promote products "
87       "derived<br>"
88       "      from this software without specific prior written permission.<br>"
89       "<br>"
90       "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "
91       "\"AS IS\"<br>"
92       "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, "
93       "THE<br>"
94       "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR "
95       "PURPOSE<br>"
96       "ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS "
97       "BE<br>"
98       "LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>"
99       "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>"
100       "SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR "
101       "BUSINESS<br>"
102       "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER "
103       "IN<br>"
104       "CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR "
105       "OTHERWISE)<br>"
106       "ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF "
107       "THE<br>"
108       "POSSIBILITY OF SUCH DAMAGE.<br>"
109       "<br>"
110       "Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de)";
111   return license;
112 }
113 
GetFLANNLicense() const114 QString LicenseWidget::GetFLANNLicense() const {
115   const QString license =
116       "The BSD License<br>"
117       "<br>"
118       "Copyright (c) 2008-2011  Marius Muja (mariusm@cs.ubc.ca). "
119       "All rights reserved.<br>"
120       "Copyright (c) 2008-2011  David G. Lowe (lowe@cs.ubc.ca). "
121       "All rights reserved.<br>"
122       "<br>"
123       "Redistribution and use in source and binary forms, with or without<br>"
124       "modification, are permitted provided that the following conditions<br>"
125       "are met:<br>"
126       "<br>"
127       " * Redistributions of source code must retain the above copyright<br>"
128       "   notice, this list of conditions and the following disclaimer.<br>"
129       " * Redistributions in binary form must reproduce the above copyright<br>"
130       "   notice, this list of conditions and the following disclaimer in<br>"
131       "   the documentation and/or other materials provided with the<br>"
132       "   distribution.<br>"
133       " * Neither the name of the \"University of British Columbia\" nor<br>"
134       "   the names of its contributors may be used to endorse or promote<br>"
135       "   products derived from this software without specific prior<br>"
136       "   written permission.<br>"
137       "<br>"
138       "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS<br>"
139       "\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT<br>"
140       "LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS<br>"
141       "FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE<br>"
142       "COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,<br>"
143       "INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES<br>"
144       "(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS<br>"
145       "OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>"
146       "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,<br>"
147       "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE<br>"
148       "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,<br>"
149       "EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
150   return license;
151 }
152 
GetGraclusLicense() const153 QString LicenseWidget::GetGraclusLicense() const {
154   const QString license =
155       "Copyright(c) 2008 Brian Kulis, Yuqiang Guan (version 1.2)<br>"
156       "This program is free software: you can redistribute it and/or modify<br>"
157       "it under the terms of the GNU General Public License as published by<br>"
158       "the Free Software Foundation, either version 3 of the License, or<br>"
159       "(at your option) any later version.<br><br>"
160       "This program is distributed in the hope that it will be useful,<br>"
161       "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>"
162       "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>"
163       "GNU General Public License for more details.<br><br>"
164       "You should have received a copy of the GNU General Public License<br>"
165       "along with this program.  If not, see http://www.gnu.org/licenses/.";
166   return license;
167 }
168 
GetLSDLicense() const169 QString LicenseWidget::GetLSDLicense() const {
170   const QString license =
171       "LSD - Line Segment Detector on digital images<br>"
172       "<br>"
173       "This code is part of the following publication and was subject<br>"
174       "to peer review:"
175       "<br>"
176       "  \"LSD: a Line Segment Detector\" by Rafael Grompone von Gioi,<br>"
177       "  Jeremie Jakubowicz, Jean-Michel Morel, and Gregory Randall,<br>"
178       "  Image Processing On Line, 2012. DOI:10.5201/ipol.2012.gjmr-lsd<br>"
179       "  http://dx.doi.org/10.5201/ipol.2012.gjmr-lsd<br>"
180       "<br>"
181       "Copyright(c) 2007-2011 rafael grompone von gioi <grompone@gmail.com><br>"
182       "<br>"
183       "This program is free software: you can redistribute it and/or<br>"
184       "modify it under the terms of the GNU Affero General Public License<br>"
185       "as published by the Free Software Foundation, either version 3 of<br>"
186       "the License, or (at your option) any later version.<br>"
187       "<br>"
188       "This program is distributed in the hope that it will be useful,<br>"
189       "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>"
190       "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>"
191       "GNU Affero General Public License for more details.<br>"
192       "<br>"
193       "You should have received a copy of the GNU Affero General Public<br>"
194       "License along with this program.<br>"
195       "If not, see http://www.gnu.org/licenses/.";
196   return license;
197 }
198 
GetPBALicense() const199 QString LicenseWidget::GetPBALicense() const {
200   const QString license =
201       "Copyright (c) 2011  Changchang Wu (ccwu@cs.washington.edu)<br>"
202       "and the University of Washington at Seattle<br>"
203       "<br>"
204       "This library is free software; you can redistribute it and/or<br>"
205       "modify it under the terms of the GNU General Public<br>"
206       "License as published by the Free Software Foundation; either<br>"
207       "Version 3 of the License, or (at your option) any later version.<br>"
208       "<br>"
209       "This library is distributed in the hope that it will be useful,<br>"
210       "but WITHOUT ANY WARRANTY; without even the implied warranty of<br>"
211       "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>"
212       "General Public License for more details.";
213   return license;
214 }
215 
GetPoissonReconLicense() const216 QString LicenseWidget::GetPoissonReconLicense() const {
217   const QString license =
218       "The MIT License (MIT)<br>"
219       "<br>"
220       "Copyright (c) 2015 mkazhdan<br>"
221       "<br>"
222       "Permission is hereby granted, free of charge, to any person<br>"
223       "obtaining a copy of this software and associated documentation<br>"
224       "files (the \"Software\"), to deal in the Software without<br>"
225       "restriction, including without limitation the rights to use, copy,<br>"
226       "modify, merge, publish, distribute, sublicense, and/or sell copies<br>"
227       "of the Software, and to permit persons to whom the Software is<br>"
228       "furnished to do so, subject to the following conditions:<br>"
229       "<br>"
230       "The above copyright notice and this permission notice shall be<br>"
231       "included in all copies or substantial portions of the Software.<br>"
232       "<br>"
233       "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,<br>"
234       "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF<br>"
235       "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND<br>"
236       "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS<br>"
237       "BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN<br>"
238       "ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN<br>"
239       "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br>"
240       "SOFTWARE.";
241   return license;
242 }
243 
GetSiftGPULicense() const244 QString LicenseWidget::GetSiftGPULicense() const {
245   const QString license =
246       "Copyright (c) 2007 University of North Carolina at Chapel Hill<br>"
247       "All Rights Reserved<br>"
248       "<br>"
249       "Permission to use, copy, modify and distribute this software and its<br>"
250       "documentation for educational, research and non-profit purposes,<br>"
251       "without fee, and without a written agreement is hereby granted,<br>"
252       "provided that the above copyright notice and the following paragraph<br>"
253       "appear in all copies.<br>"
254       "<br>"
255       "The University of North Carolina at Chapel Hill make no<br>"
256       "representations about the suitability of this software for any<br>"
257       "purpose. It is provided 'as is' without express or implied warranty.";
258   return license;
259 }
260 
GetSQLiteLicense() const261 QString LicenseWidget::GetSQLiteLicense() const {
262   const QString license =
263       "The author disclaims copyright to this source code. In place of<br>"
264       "a legal notice, here is a blessing:<br>"
265       "May you do good and not evil.<br>"
266       "May you find forgiveness for yourself and forgive others.<br>"
267       "May you share freely, never taking more than you give.";
268   return license;
269 }
270 
GetVLFeatLicense() const271 QString LicenseWidget::GetVLFeatLicense() const {
272   const QString license =
273       "Copyright (C) 2007-11, Andrea Vedaldi and Brian Fulkerson<br>"
274       "Copyright (C) 2012-13, The VLFeat Team<br>"
275       "All rights reserved.<br>"
276       "<br>"
277       "Redistribution and use in source and binary forms, with or without<br>"
278       "modification, are permitted provided that the following conditions <br>"
279       "are met:<br>"
280       "1. Redistributions of source code must retain the above copyright<br>"
281       "   notice, this list of conditions and the following disclaimer.<br>"
282       "2. Redistributions in binary form must reproduce the above copyright<br>"
283       "   notice, this list of conditions and the following disclaimer in<br>"
284       "   the documentation and/or other materials provided with the<br>"
285       "   distribution.<br>"
286       "<br>"
287       "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS<br>"
288       "AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT<br>"
289       "LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS<br>"
290       "FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE<br>"
291       "COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,<br>"
292       "INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,<br>"
293       "BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;<br>"
294       "LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER<br>"
295       "CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT<br>"
296       "LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN<br>"
297       "ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>"
298       "POSSIBILITY OF SUCH DAMAGE.";
299   return license;
300 }
301 
302 }  // namespace colmap
303