initial commit -- gpligc 1.10.1

This commit is contained in:
Solomon Peachy 2017-08-10 20:33:14 -04:00
commit 8a331e0025
64 changed files with 50751 additions and 0 deletions

674
COPYING Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

878
ChangeLog Normal file
View File

@ -0,0 +1,878 @@
ChangeLog of the gpligc & ogie project
********************************************************************************
Version 1.10 03/2016
+ license changed to GPLv3
+ package migrated to autotools (./configure && make && make install)
+ gpsd / osmesa are optional (--without-gpsd, --disable-osmesa)
+ Windows build platform changed to MinGW32/MSYS
using freeglut 2.8.1, jpeg-9a
new makedist (packaging skript for windows-dist)
- "official" MacOSX support dropped
MacOSX: have a look at the instructions in the 1.9 manual, you can try to
apply them to newer versions. I just dont have time (and Mac-ware) to do
testing.
GPLIGC
+ gui integrated into one main window
+ map features improved
+ window_width, window_height added to config
+ resize (key-y) repaired
+ startup / introtext (info, if no file opened)
+ check_config repaired
+ gnuplot terminal modes updated / checked (qt/x11) added
+ adapted to perl >5.16 (deprecated defined (@array) warnings removed)
+ memory leak in accuracy plotting removed
+ display of "start" and "finish" in barogram fixed
+ task waypoints with coordinates 0.0N/0.0E/W will be ignored
+ task editor takes radius factors to scale each waypoints cylinder-size
+ $config{'starting_line'} length of starting line in km
+ Task editor bugs fixed (append on empty task, etc)
+ warning on double alt calibration
ogie
+ -32768 in DEM is recognised as 'no-data' (ocean), e.g. for use with srtm3 (v4.1)
+ code adapted to freeglut 2.8.1
+ gps live-mode repaired, switched to libgpsmm and GPSD_API_MAJOR_VERSION 5
this requires gpsd >= 2.96
+ --gpsd--server and --gpsd-port (connect to local or remote gpsd's)
docs
+ new installation procedure
+ manual updated
VCS
+ moved to git (last CVS tag: last-CVS-before-svn)
********************************************************************************
===> branch-1.9 (tag gpligc-1)
Version 1.9.1 x/201y
GPLIGC:
+ bugfix: fvw map-on "M" after zooming in map display fail
+ mapdownload URLs changed (probs with gm terrain and sat)
+ #-key re-downloads maps
+ known Bugs: freeglut 2.8. menus dont work
********************************************************************************
Version 1.9 3/2011
+ configfile renamed (.ogierc and .gpligcrc) unix-platforms
on win it is gpligc.ini and ogie.ini
GPLIGC:
+ openstreetmaps can be used now! (needs internet connection and Imager module)
+ geo-tagging feature added (using ExifTool)
+ scrolling in FVW disabled
+ B-record extensions SIU (sats in use), FXA, VXA (hor./Vert. Accuracy) and RPM
used plots added. Info in FVW.
+ gpsbabel can be used to download tracks (config{'gpsbabel_tdownload'})
+ fvw has some layout options
ogie:
+ win32 build platform changed to Cygwin 1.7 (win95/98/Me support discontinued)
+ menu-bugs fixed (flying renamed to movie, help and about)
+ doubled lines in info-text fixed
+ lat/lon in info text
+ unwanted movements (leaving menus etc) filtered
+ automatic landscape reload in gpsd mode
+ switched to new gpsd protocol (gpsd 2.95)
+ waypoints can be displayed from waypoints-file
+ edges of maps improved
********************************************************************************
Version 1.8 2/2010
+ install_windows.pl script recognises WinVista now
GPLIGC/ogie successfully tested on WinVista Home
+ install.sh checks for gmake and uses make as fallback (thanks florian)
ogie:
+ --gpsd (ogie needs to be build with gpsd support)
install.sh asks for compilation with gpsd support
+ --ortho: track is always plotted on top of the terrain
+ new options for 2D orthographic mode (can be used in 3d as well):
--terrain-shading
--shading-scale float (1-1000)
--light-direction int (1-8)
+ Map Set Menu Bug fixed (crash without map sets)
+ installation script for mac improved (echo -n problem, path for macports
in Makefile)
+ -tdf target in Makefile (fixing an issue on OSX 10.4)
+ include issue for MACOSX fixed (points.cpp)
+ makefile for osmesa repaired (tested with static Mesa 7.4.1)
optimizer
+ simulated annealing algorithm implemented (just for fun)
+ subsampling
GPLIGC
+ gnuplot_terminal_app bug corrected
+ bug in plots (gnuplot 4.x) because of non-posix redirection fixed
(see 1.7 ERRATA)
********************************************************************************
Version 1.7 4/2009
ogie:
+ gcc-4.3 compliance also for utilities
+ shadow & curtain / seafloor bug corrected (thanks to David Robertson)
+ Lifts from GPLIGC output (wave positions etc) (--liftsfile)
+ TEXT_COLOR_[R|G|B] float. color for Text at lifts
+ LIFTS_COLOR_[R|G|B] float. color for lifts
+ --lifts-info-mode (pos1 / end)
+ shift-page-up/down increasing/decreasing textsize for lifts
+ --text-size --text-width --marker-size
GPLIGC:
+ F11 zoom to selected range (by F5/F6) F12 resets F5/F6
+ air-groundspeed diff plots in F5/F6/F7 statistics (config{'wind_analysis'})
+ Total energy compensated vario. Requires Airspeed (e.g. from Zander)
or rough guess using groundspeed (config{'te_vario_fallback'})
+ config {'draw_task'} and 'draw_wpcyl' to change default behaviour in fvw
+ Additional info and altitude calibration can be saved in .gpi file
+ Additional flight Info dialog (pilot/date/etc)
+ gpsp2igcfile.igc (fork from gpsp2igc.pl) creates igc-files with filenames
according to date yyyy-mm-dd-..
+ garmin read via gpspoint
+ copying of associated multimediafiles from defined dirs at mountpoint
+ Oxygen debriefing in FlightStatistics (according to FAR 91.211)
+ corrupt igc file reversed-time-bug fixed
+ pressure and pO2 in fvw
+ pressure altitude (reference 1013.25) (needs known QNH)
+ photos & audio/video files locator (from mtime of files)
+ Image::ExifTool is being used instead of Image::EXIF
+ $config{'baro_grid_large,small'} for gridlines (1000 500 default)
+ QNH/Reference Pressure calibration
+ Pressure plot
+ F10 to mark lifts -> in basefilename.lif
+ config{'skip_limit_minutes'} use corrected (now its really minutes)
+ config{'skip_del_first_after'}=1 circumvents a bug in my Garmin Geko tracks
(the first position fix after a break ('skip', e.g. tunnel or bad reception)
is wrong)
********************************************************************************
Version 1.6 10/2008
+ gpsp2kml.pl added (script to convert gpspoint tracklists to kml files)
+ merger added ... does not really works as expected
+ Manual installation / osmesa
ogie:
+ gcc-4.3 compiler compliance (thanks to farkas levente)
+ bug in airspaces (GND definitions, partly over sea) fixed.
thanks to David Robertson for reporting
+ --airspace-wire-width sets linewidth of wireframe airspaces
+ --airspace-wire-col-[r|g|b] sets colour of wireframe airspaces
+ --ignore-elev-[max|min] options for ignoring an elevation range for
determination of max and min elevation for colourscaling
+ limits at longitude 180 and -180 killed
+ --clipping-[near|far] added
+ new colormap 8 (black-red-yellow-white)
+ bug with long --text strings removed
+ AUTOREDUCE (this reduces the DEM resolution automatically, not to exceed
MAXTRIANGLES - on by default)
+ --no-lighting (use with --ortho and upscaling)
+ --upscaling int (2 is ok, higher values will result in artefacts from bilinear
interpolation. Values larger than two can be used in --ortho with --no-lighting
+ --quads QUADS (Terrain is rendered using quadrilaterals)
+ FLIGHTSTRIPCOL[UP|DOWN]_[R|G|B]
+ FLIGHTSTRIP_LINEWIDTH 2.0 (float 1-7)
+ FLIGHTSTRIP_MODE 1 (0=classic,1=alt,2=speed,3=vario)
+ FLIGHTSTRIP_COLORMAP 1 (1-7)
+ MARKERCOL_[R|G|B], the colour of the marker is changable
+ --flighttrack-mode, --flighttrack-linewidth, --flighttrack-colormap
GPLIGC:
+ coordinate format dd.dddddd added
+ kml export added
+ gpx export added
********************************************************************************
Version 1.5.1 04/2007
+ loopviewer template script added (contest igc-file presentation)
- maploader.pl removed (used mapserver is out of order)
ogie:
+ max osmesa viewport dimensions questioned from mesa
+ long paths bug fixed (thanks to david robertson)
+ existing screenshots wont be overwritten anymore (except with --os-outfile)
+ --check moved up (before any glut call)
+ SAVE_PATH, BASENAME config-file options
+ --save-path option to define a location to save screenshots
+ --basename option to define a basename for screenshots
+ text-background position
+ warning for osmesa (if not compiled in)
+ --text, --no-position-info, --no-marker-pos-info options added
+ INFOFONT_SIZEI, INFOFONT_LINEWIDTH, INFO_STYLE
+ BACKGROUND_COLOR_[1|2]_[R|G|B]
+ BACKGROUND_STYLE
+ thanks to antonio ospite for the new background and infotext-styles
GPLIGC:
+ online flight claim support removed (contests changed too often)
+ cylinder sizes 200m 400m added
********************************************************************************
Version 1.5 06/2005
+ Installation has changed PREFIX/bin PREFIX/share/gpligc
PREFIX/share/doc/gpligc
+ A rpm package is available for linux ...
+ .tar.gz file has changed (examples stripped,
more interactive options (compile))
+ Michael Schlotter's MacOSX installation howto added
ogie:
+ --marker-time hh:mm:ss
+ AIRSPACE_LIMIT, --airspace-limit
+ --cycles=INT
+ SPINNING float, MOVIE bool, --spinning float, --movie
+ Airspaces with elevation definitions AGL GND above water with WORLD3.DEM
resulted in sub-terranean airspaces -> fixed (thanks to D. Robertson)
+ windows version should also accept opengligcexplorer.ini as configfile
+ MAXTRIANGLES option added. To set a limit for server use.
+ MOVIE_REPEAT, MOVIE_REPEAT_FACTOR, MOVIE_REPEAT_FPS_LIMIT
+ If maps are displayed uncoloured (unmodulated) with DEM, they are now lighted
+ MAPS_UNLIGHTED, --maps-unlighted, --maps-lighted to change dafault behaviour
of "unmodulated" maps
+ tested on Mac OS X (Matthew)
+ tested on OpenBSD
+ some changes in Makefile, minor issues (gl.. calles before glutCreateWindow
by accident). New Targets in Makefile:
all-linux-static: linux, glut and jpeg statically linked
all-macosx: Mac OS 10 (libjpeg statically linked from fink)
all-freebsd: FreeBSD
all-netbsd: NetBSD
all-openbsd: OpenBSD
+ binaries available for ppc-MacOSX, x86-OpenBSD, x86-FreeBSD, x86-NetBSD
and amd64-linux
+ compiling for osmesa-rendering improved (new targets in makefile)
GPLIGC:
+ histograms plotted "solid" by default
+ added altitude histogram plots
+ added support for Gnuplot 4.x interactive features (see manual)
+ Bug in F5,F6,F7-Statistics (while using ft-altitudes) eliminated
+ tutorial added in Manual
+ config{'skip_check' and 'skip_limit_minutes'} added
+ small 60sec bug in GPLIGCfunctions dec2time fixed
+ support for browser added for darwin (via open)
+ tested on Mac OS X (Matthew)
+ tested on OpenBSD
+ time calibration for photo series (calibrated value is saved)
+ option to display locations where photos have been made. Image viewer (option).
+ start flight view window when opening igc-file (default, can be changed by
$config{'open_flight_view_window'} => "o" or "1"
+ redesigned the configuration. Stored in hash. .GPLIGCrc based on key/values
+ a few more values put in %config-hash, can be changed in .GPLIGCrc
USE WITH CAUTION!
********************************************************************************
Version 1.4 09/2004
openGLIGCexplorer:
+ removed bug "MAP_FILE followed by blank line" (thanks to A.O.)
+ rotations with up,down,left,right keys (and with shift- ..)
+ rotations with mouse button, use marker as center if switched on
(thanks to a. somers for the new rotations)
+ mouse with middle button shifts position towards/away from center/marker pos.
+ shifting viewpoint up/down/right/left now mapped on mouse with middle and left
button
+ should compile on gcc 3.4 now (thanks to Gregoire Favre)
+ Airspace problem (cylindric airspaces with GND alititudes) fixed (thanks to
Klaus Haehlen)
+ Airspace Types (Q,R,P,D,C,CTR) can be switched on/off seperately
(using menus or AIRSPACE_x on/off)
+ --sealevel3, SEALEVEL3
+ shift-F9 Airspace wireframe mode, --airspace-wire, --airspace-transparent
+ AIRSPACE_WIRE
+ follow mode ortho-view
+ middle and left mousebutton, for forward/backward moving
Communication between GPLIGC and openGLIGCexplorer temporarily not
available. This has to be rewritten and will be back in 1.5
GPLIGC:
+ checking for old configfiles
+ 20km Starting line for first wp
+ Filetype definition changed, should work with Tk804.027 (ActivePerl) now
(getOpenFile)
+ Minor issues with Tk 804.027 (linux) fixed
+ Thermal stat and Glid stat list-click problem fixed (probably arised due to
Tk804.027 ?)
+ optimization for DMSt and holc implemented
+ olc-file output changed to "webbrowse to olc flight-claim form"
+ simple release time determination
+ begin and end of powered flight are marked in flightstrip
+ marks for F5 and F6 statistics marker
+ WP Names can be switched on/off
+ WP Sectors/Cylinders can be selected independently
+ Flight outside of start/finish unpowered flight is marked
+ F5,F6,F7 statistic range is coloured in barogram of FVW (also more statistics)
+ rubberband-zooming (right mouse-botton) corrected
+ WP presentation in barogram improved
+ some statistics for each leg added
********************************************************************************
Version 1.3 01/2004
openGLIGCexplorer:
+ workaround for data, where all altitudes are equal
+ JOYSTICK_FACTOR_X,Y,Z added
+ Added joystick support (3 axis) (GLUT: win32 only, for X11 freeglut is needed)
(GLUT never supported joysticks on X11)
+ fixed GL_STACK_OVERFLOW in GenLandscapeList (green rectangle)
+ FGLUT_CHECK option added to check for freeglut (will give some improvements
in the future...)
+ --verbose (VERBOSE), --quiet, --debug handling improved
+ checking for max texture size
+ info screen with picture (select from menu)
+ MARKER_SIZE added (marker size can be changed using page-up/down keys)
+ DEM_INPUT_FACTOR added
+ BIGENDIAN option to select byte order of dem data
+ JPEG_QUALITY , --jpeg-quality
+ IMAGE_FORMAT , --image-format (can be rgb or jpg now)
+ TIME_ZONE
+ TIME_ZONE_NAME
+ parsing of configfile improved (recognition of bad keys and values)
+ NUMBER_OF_MAPS not needed anymore
+ code-cleanup config-class
+ help Screen
+ added menus for most important options
+ added menu for map-set-selection (right-click)
useful if more than one map set is defined in configfile
- right-click-move zoom disabled (need that button for menu)
+ added "loading..." indicator while building landscape list
GPLIGC:
+ integrated vario in flight view window
+ Some source-code beautifying
+ GPS-Altitude mode for flights, which dont have barometric altitude improved
+ baro, or gps-altitude can be used for gnuplot (buttons rearranged to fit small
screens)
+ statue miles/mph added...
+ Fix for WinME (start /B option isnt available on WinME)
+ added ReadLoggerWindow for windows version (SDI,LX,Zander so far)
Logger reading starts "data-xyz" (official FAI DOS-software) for each logger
********************************************************************************
Version 1.2 08/2003
openGLIGCexplorer:
+ --gpsalt and handling of flights without barometric alt improved
+ documentation converted to a pdf-document
+ Flightstrip can be color-scaled with all available colormaps
shift-F7,shift-F8 (prev, next colormap)
+ Flightstrip modes: classic, altitude, speed, vario
shift-F5, shift-F6 (prev, next mode)
+ world3 (can be merged from etopo2 gtopo30) flag for water-coverage
+ creation of DEM subsets with etopo2merger (from WORLD.DEM)
+ rendering time is mesaured in offscreen modes
+ Emergency-fallback to gpsalt (if no barometric available)
+ fallback to invalid pos.-fixes, if no valid ones available
+ Value template class introduced (code cleanup)
+ compiling with mesa (static linking) possible
+ x-server independend offscreen rendering (OSMesa)
for server use
+ no. of triangles calculation improved (with downscaling)
+ --map-set-name
+ MAP_SET_NAME (to name map sets in configfile)
+ PROJECTION [1-4] to preselect projection in configfile
+ SEALEVEL, SEALEVEL2 to set these in configfile
+ max has added cool new move-functions (try with mouse buttons pressed)
+ framerate displayed in movie-mode
+ movie-function can be delayed. F1 F2 -/+ 1millisec
+ timer delay can be set in configfile (TIMER_MSEC millisecs)
+ Movie function... (automatic marker moving) "I"
+ map tiles can be shifted by MAP_SHIFT_LAT|LON
+ jpg images can be used as textured maps (thanks to max)
+ jpges recognized as *.jpg or*.JPG
+ jpg textures doesnt need to have 2^n width and height, they will be scaled
internally, for performance reasons they should be scaled to 2^nx2^n before
+ Viewpoint will follow Marker (can be switched off with "M", FOLLOW true|false)
--follow --no-follow
+ MARKER_RANGE ("U") will show a range of the flight, only.
--marker-range --no-marker-range
The range can be set by MARKER_BACK and MARKER_AHEAD
--marker-ahead int --marker-back int
GPLIGC:
+ Bug in optmizer/GPLIGC communication fixed
+ take-off and landing time detection improved for slow paragliders etc
+ emergency-fallback if no "A" fixes available
+ -initialdir in openFile Dialog (win32) works now
+ small changes for win32 (space in filenames, pwd-memory...)
+ take-off and landing time detection more acurate
+ olc-file improved (t0, fstart, ffinish, sta, gid)
+ optimizer rewritten (more general) (slower, because we use real trigonometric
calculations now) altitude difference check
+ DMSt-optimizing (4 legs) check WP mindist 10km
********************************************************************************
Version 1.1 patchlevel 2 04/2003
GPLIGC:
+ few Bugfixes for windows version
+ installation script for windows version
********************************************************************************
Version 1.1 04/2003
openGLIGCexplorer:
+ checking for GLX>1.3 before using pbuffers (--offscreen)
+ Makefile (LDFLAGS shifted to the end of compilercall)
+ --init-pos-N, W, S, E, NW, SW, SE, NE, center
+ if no --init-heading and --init-dive is given, the view is pointing
to the center
+ marker-lighting bug fixed
+ --smooth-mouse, smaller rotation angles for smoother movement
+ --gpsalt uses the GPS Altitude, --baroalt uses barometric alt.
GPSALT true | false
+ Bug in get_gnd_elevations fixed (short int i1,i2;)
+ adapted the code to gcc 3.2
+ now using RCS (revision control system)
+ Bug in orthomode zooming fixed (in downscaling mode)
+ projection class introduced (4 map-projections)
+ Bug, which occurs when --no-modulate --grayscale (or --stereo_rx) --map were
given, fixed
+ Better color conversion for textures in grayscale modus
+ added 3 colormaps (4,5,6) and colormap 3 is a grayscale now.
+ --colormap-sea (colormap used for bathymetry, everything lower than --sealevel)
+ --sealevel, --sealevel2 (everything lower than sealevel2 will be blue)
+ etopo2merger added. A tool to merge GTOPO30 with ETOPO20.
+ createworld has some informational output now
+ --compiler : some information about build
+ Windows is supported yet! (compile with cygwin)
+ environment variable GPLIGCHOME is used under win32 as searchpath for rc-file
+ changed a few key settings to confuse people ;-)
GPLIGC:
+ prepared to work with Windows (ActivePerl)
+ 3d gnuplots error fixed
+ deep recursion error fixed. (when switching from last to first datapoint,
while zoomed)
+ now using RCS (revision control system)
+ ENL limit 50 added.
+ Windowmanager-exitbutton is caught, for correct deleting of tempfiles etc.
+ FlightViewWindow resizing improved (?! -- doesnt work very good...)
changed back to "y"
+ marker-pos and offset is set to 0, when opening file
********************************************************************************
Version 1.0 01/2003
openGLIGCexplorer:
+ new makefile for openGLIGCexplorer, createworld and optimizer
+ configfile is read from home-directory
+ --check option (needed by GPLIGC)
+ color-handling below minimum fixed (Landscape::getcolor), thanks to my brother
+ keyboard settings changed. (Marker moving: F1-F4, like in GPLIGC), Reset = F5,
Toggle Info = F6, Toggle Marker = F7
+ dem-elevation-colour and texture-maps usable at once (F8) (MODULATE)
+ --modulate (MODULATE true|false)
+ --quiet
+ --parent-pid (GPLIGC communication)
+ SysV IPC via shared memory between GPLIGC and openGLIGCexplorer
+ --marker and --marker-pos (MARKER true|false)
+ MAP true|false
+ Added conf.AIRSPACE, --airspace, AIRSPACE true|false, OPEN_AIR_FILE filename
+ Class Airspace, -> support for OpenAir-format Airspace files (DP, DA, DB, DC,
AC, AL, AH, AN, V X=, V D=. entries)
+ F9 Airspaces on/off
+ --perspective, --no-map, --no-modulate, --no-airspace, --filled
+ --gouraud-shading, --window, --no-marker, --no-curtain, --haze, --no-haze
+ --haze-density, --aov (and angle of view info)
+ Grayscale-mode ("shift-B")
+ Stereoscopic-modes: shift-"S" = full color mode with 2 images
shift-"D" = green/red, shift-"F" = blue/red,
+ shift-"A" swap stereoscopic images (left<->right)
+ shift-"Q" and shift-"W" decrease and increase eye distance (+- 50m)
+ --stereo, --no-stereo, --stereo-rb, --no-stereo-rb, --stereo-rg, --no-stereo-rg
+ Configfile-options: STEREO, STEREO_RB, STEREO_RG, HAZE, HAZE_DENSITY,
ANGLE_OF_VIEW, INFO
+ --inverse-stereo, -no-inverse-stereo, INVERSE_STEREO true|false
+ --eye-dist (float), EYE_DIST (float)
+ --info, --no-info
+ offscreen rendering (using glx-pbuffers) --offscreen, --os-outfile
+ --init-lat, --init-lon, --init-alt, --init-heading, --init-dive,
--init-ortho-lat, --init-ortho-lon, --init-ortho-width
+ Initial positions changed.
GPLIGC:
+ install.sh improved
+ code-cleanup
+ tmp dir process-specific (allows multiple GPLIGC's at the same time)
+ check for optimizer, openGLIGCexplorer and gnuplot, before starting them
+ units added (speed in m/s, vertical speed in km/h)
+ optimizer: check-option (no arguments)
+ communication with openGLIGCexplorer via SysV IPC (Shared Mem)
********************************************************************************
Version 0.23 11/2002
openGLIGCexplorer:
+ Info text (F2 on/off)
+ units in infotext are changable (configfile)
+ movable marker (F3 on/off, F5-F8 Move)
+ code-cleanup (config::switch / fd)
GPLIGC:
+ Glide statistics Bug fixed
+ Bug in FVW Vario/Speed
********************************************************************************
Version 0.22 11/2002
openGLIGCexplorer:
GPLIGC:
+ elevation and time grid in barogram of flightviewwindow
+ start and finish time and waypoint ticmarks in barogram
+ 10' grid in FlightViewWindow
+ absolute elevation calibration ("e" in FVW)
+ measuring (F5,F6,F7 in FVW)
+ thermal list and statistics (F8 in FVW)
+ glide list and statistics (F9 in FVW)
+ optimization output -> window
+ barogram (FWV) ->postscript output
+ simple FVW resize (press "y" to replot)
+ fixed info-text-bug
+ added support for NM, knots, ft, ft/min
+ save options-button in options-menu, reload on start
********************************************************************************
Version 0.21 09/2002
openGLIGCexplorer:
+ textured maps on surface from digital elevation model
+ downscaling factor (use fewer raster data to show bigger areas)
+ F1 resets to initial position
+ fast backwards (a) and fast forward (space) in ortho-mode too
GPLIGC:
********************************************************************************
Version 0.20 09/2002
openGLIGCexplorer:
- nothing
GPLIGC:
= Attention: You can't use this for OLC 2002 (use 0.19 if you need 2002 .olc
files). But olc 2003 will start at october 15th.
+ optimization routines rewritten (completely redesigned) (in c++) "optimizer"
+ optimizes conform to online contest 2003 rules.
+ output of ".olc" file (2003 conform)
+ checking of height difference (paragraph 3 olc 2003 rules)
+ closes all windows on closing or opening of a file
+ multiple windows of same type aren't allowed anymore
+ windows will be updated if anything changes
********************************************************************************
Version 0.19 07/2002
openGLIGCexplorer:
+ added texture compression through GL_ARB extension. It saves video memory but
slows down the texture loading time. Commandline parameters (--compression,
---no-compressio) default is to use compression (if not changed in
configuration-file). You can switch compression on/off "on the fly" with key
"y"
+ --query-gl commandline parameter added. Prints out some usefull information
on your openGL system.
+ changing of field of view angle (keys 7,8)
+ --airfield-elevation=INT (in metres) commandline option to calculate "offset"
automatically
GPLIGC:
+ Calculation of triangular tasks with 4 legs (start and finish on leg)
+ Speed and Vario Histogram plots added
+ labels in gnuplots improved
+ File type in Open File Dialog
********************************************************************************
Version 0.18b
openGLIGCexplorer:
+ fixed the "curtain height bug" again (I forgot to change it in the
"main-source-tree")
********************************************************************************
Version 0.18 07/2002
openGLIGCexplorer:
+ latitude/longitude distortion in orthographic projection removed
+ height/width distortion in resized windows with perspective projection removed
+ use of digitized maps added (read MANUAL how to use this feature)
GPLIGC:
+ postscript output from FlightViewWindow
+ ./ added to searchpath for all icons
+ doubled waypoints in task will be deleted (DMSt: takeoff, start..)
+ Indicated Airspeed plot (if available in igc-file)
+ Engine Noise Level plot
+ powered flight is plottet green in FVWindow
+ "no-task-defined-bug" removed, also "all-waypoints-deleted" bug
+ rubberband-zooming in FVWindow (right-Button) (return to unzoomed with "z")
********************************************************************************
Version 0.17 06/2002
+example flight improved (512 -> 601km :-)
openGLIGCexplorer:
+ curtain bugfix
GPLIGC:
+ FAI Waypoint sectors
+ Bugfixes for 24:00 -> 00:00 bugs
+ Options menu cascaded
+ first-letter-of-wp-name-missing bug fixed
+ jump to position by clicking in the FlightViewWindow
********************************************************************************
Version 0.16 06/2002
openGLIGCexplorer:
+ weather haze
+ adjustable offset (height) between flight and terrain
+ transparent "curtain"
+ Orthographic 2D projection
GPLIGC:
+ better waypoint setting (insert, replace wp's)
+ output of "online contest" (olc) files.
********************************************************************************
Version 0.15 05/2002
GPLIGC:
+ version number increased :)
# nothing :(
openGLIGCexplorer
+ terrain from GTOPO30 or GLOBE Digital Elevation Model
+ terrain Viewing without flightdata (can be used as an terrain Viewer! :)
+ terrain view in different colormaps, wireframe or shaded
+ configfile
+ cmdline parameters
+ mouse control improved
+ screenshots to jpegs
********************************************************************************
Version 0.14 04/2002
GPLIGC:
+ Bugfixes (GL Explorer Button in GPLIGC -> file open check)
+ openGLIGCexplorer starts as a forked child
openGLIGCexplorer
+ so called "mesa-strangeness" (see 0.13) turns out as a bug in the authors
operating system (brain)... forgot to initialize a depth buffer, but it worked
on my nVidia openGL system.
+ openGLIGCexplorer can handle igc-files now. So you can use it without GPLIGC
(just start with "openGLIGCexplorer coolflight.igc")
********************************************************************************
Version 0.13 04/2002
# should be installed in /usr/local now...
+ I added an OpenGL Flightdata Explorer... :)
openGLIGCexplorer Version 0.13_B_
+ small "mesa-strangeness" workaround
(included in GPLIGC-0.13.tar.gz downloaded after 18.4.02 1030 CEST)
********************************************************************************
Version 0.12 09/2001
+ We fixed a horrible bug in distance calculations for the scaling-function
+ Max rewrote some parts of the FVW-scaling
********************************************************************************
Version 0.11 09/2001
+ Barograph view in Flightview Window
+ File to open can be given on commandline
********************************************************************************
Version 0.10
+ FAI - task detection.
+ function for finding biggest triangular task in data (beta...)
********************************************************************************
Version 0.9 06/2001
+ Distance to WP in FlightViewWindow
+ Bugfix for some (Camebridge ?) files with doubled B-entries
+ Coordinates can be displayed in two formats in WPPlotWindow and FlightView-
Window
+ Task-reader-routine has been rewritten, better now :)
+ Task-speed analysis
+ better Task analysis
********************************************************************************
Version 0.8 06/2001
+ Minor fix in igc2dec, south and west- coordinates will be treated right!
+ No distortion in flightviewwindow's zoom! (GPLIGCfunctions::Ausschnitt2
improved)
+ No distortion in unzoomed fvw (->no more distortion :) and centered!
********************************************************************************
Version 0.7 06/2001
nobody knows when it changed to 0.7 exactly, but there is
a lot of improvement.
+ add/delete waypoints from task, task distance calculation
+ zoomfunction in FlightViewWindow
+ task / wp-cylinder in FlightViewWindow
+ install script / installs in /opt/GPLIGC/
********************************************************************************
Version 0.6 pre
- Schilli-Module -> gibt viel bessere Tk-serienmaessig!
+ FlightViewWindow!
+ Statistik-Fenster (bisher nur Start-/Lande-/Flugzeit)
+ Gnuplots mit KM (anstelle von Koordinaten) (by Jan MW Krueger)
+ Viele Unterfunktionen / Code-cleanup
+ Bessere Task-Analyse
- track.dat (gespart durch effektivere Gnuplot-Nutzung)
********************************************************************************
Version 0.5 pre 10/2000
+ FlightInfo verbessert
+ Diagrammtitel=Filename
- Windows-unterstuetzung komplett raus: Hatte keinen Bock mehr "M$Wintendo" zu
booten um herauszufinden, dass dort alles scheisse ist.
+ Postscript Ausgabe mit Parameter "Solid" (keine dashed-lines mehr)
+ sub igc2dec
+ sub zylinder
+ Zylinder+Kantenaengeneinstellung unter "Options"
+ WP-Plot-Fenster
+ Plots von WP aus Task moeglich
+ gpligc.xbm bei iconifizierung
+ discus16.xpm 1/3 kleiner als altes discus.xpm
********************************************************************************
Version 0.03 alpha 4 02/2000
+ title fuer plots
+ FlightInfo Fenster (needs lots of work!)
+ 3d view control
+ grid-support neu (by Max JW Krueger)
+ ticslevel in 3d view auf 0 (idea by Max JW Krueger:)
- relief=>"solid" +relief=>"ridge" altes Tk hat "solid nicht"
********************************************************************************
Version 0.03 alpha 3 01/2000
Neuer Plot: Speedogramm (10Fix-Schnitt Ground)
Achtung! Math::Complex v1.01 hat fehler -> v1.26 !
+ @clearlist, +sub's dist+grosskreis!
+ FlightInfo-Fenster +MainWindow Layout
Reihenfolge der Funktionen neu sortiert!
********************************************************************************
V003a2 01/2000
+ Neue Plots: GPS-BARO-Differenz, Variogramm (10 Fix Schnitt).
+ Informationsfenster neu -> discus.ppm
+ Bereichseinstellung neu.
+ Ausgabe sub geaendert jetzt besser unter MSWin32
+ Modul Fs.pm modifiziert, Bug unter MSWin32 ausgemerzt.
+ Output auf Console reduziert, dafuer Busy neu und
output in
Berechnungsstatusanzeige
********************************************************************************
V0.03a1 01/2000
Diese Version lauft nun auch unter Windows.
Dafuer wurden einige Anpassungen an der "Ausgabe Unterfunktion"
gemacht. Die Temps werden jetzt mit "unlink" geloescht.
Anpassung auch bei `pwd`, was ja nicht funktioniert bei Windows.
********************************************************************************
V0.02a1 01/2000
GPS/Hoehe und 3d/Groundprojektion neu! "Schliessen" neu.
Anzeige von Datei und Berechnungsstatus neu.
Optionen "lines oder dots" fuer plot
Ausgabe als fig, ps, pbm, png und eps moeglich :)
********************************************************************************
V0.01a3 01/2000
Menubar, Datei Oeffnen ueber Fileselektor gesteuert
********************************************************************************
V0.01a2 01/2000
Tk Toolkit findet Anwendung. 7 Buttons fuer Plots und
Exit.
*.dat Dateien werden am Ende wieder geloescht.
********************************************************************************
V0.01a1 01/2000
Erste Version. Aufruf mit GPLIGC-0.01a1.pl <xxxxxxx.igc
Ausgegeben werden A-, H- und C-Eintraege aus der Igc-Datei.
Graphische Plots von:
baro: Barohoehe/Zeit
gpsalt: GPSHoehe/Zeit
track: Laenge/Breite
3d: Laenge/Breite/Barohoehe
latproj: Breite/Barohoehe
lonproj: Laenge/Barohoehe
********************************************************************************

370
INSTALL Normal file
View File

@ -0,0 +1,370 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell commands './configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the 'README' file for
instructions specific to this package. Some packages provide this
'INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The 'configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a 'Makefile' in each directory of the package.
It may also create one or more '.h' files containing system-dependent
definitions. Finally, it creates a shell script 'config.status' that
you can run in the future to recreate the current configuration, and a
file 'config.log' containing compiler output (useful mainly for
debugging 'configure').
It can also use an optional file (typically called 'config.cache'
and enabled with '--cache-file=config.cache' or simply '-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how 'configure' could check whether to do them, and mail
diffs or instructions to the address given in the 'README' so they can
be considered for the next release. If you are using the cache, and at
some point 'config.cache' contains results you don't want to keep, you
may remove or edit it.
The file 'configure.ac' (or 'configure.in') is used to create
'configure' by a program called 'autoconf'. You need 'configure.ac' if
you want to change it or regenerate 'configure' using a newer version
of 'autoconf'.
The simplest way to compile this package is:
1. 'cd' to the directory containing the package's source code and type
'./configure' to configure the package for your system.
Running 'configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type 'make' to compile the package.
3. Optionally, type 'make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type 'make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the 'make install' phase executed with root
privileges.
5. Optionally, type 'make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior 'make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing 'make clean'. To also remove the
files that 'configure' created (so you can compile the package for
a different kind of computer), type 'make distclean'. There is
also a 'make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type 'make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like 'make install' and 'make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the 'configure' script does not know about. Run './configure --help'
for details on some of the pertinent environment variables.
You can give 'configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU 'make'. 'cd' to the
directory where you want the object files and executables to go and run
the 'configure' script. 'configure' automatically checks for the
source code in the directory that 'configure' is in and in '..'. This
is known as a "VPATH" build.
With a non-GNU 'make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use 'make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple '-arch' options to the
compiler but only a single '-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the 'lipo' tool if you have problems.
Installation Names
==================
By default, 'make install' installs the package's commands under
'/usr/local/bin', include files under '/usr/local/include', etc. You
can specify an installation prefix other than '/usr/local' by giving
'configure' the option '--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like '--bindir=DIR' to specify different values for particular
kinds of files. Run 'configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of '${prefix}', so that
specifying just '--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to 'configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
'make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
'${prefix}'. Any directories that were specified during 'configure',
but not in terms of '${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the 'DESTDIR' variable. For
example, 'make install DESTDIR=/alternate/directory' will prepend
'/alternate/directory' before all installation names. The approach of
'DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of '${prefix}'
at 'configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving 'configure' the
option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
Some packages pay attention to '--enable-FEATURE' options to
'configure', where FEATURE indicates an optional part of the package.
They may also pay attention to '--with-PACKAGE' options, where PACKAGE
is something like 'gnu-as' or 'x' (for the X Window System). The
'README' should mention any '--enable-' and '--with-' options that the
package recognizes.
For packages that use the X Window System, 'configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the 'configure' options '--x-includes=DIR' and
'--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of 'make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with 'make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with 'make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX 'make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as 'configure' are involved. Use GNU 'make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its '<wchar.h>' header file. The option '-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put '/usr/ucb' early in your 'PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in '/usr/bin'. So, if you need '/usr/ucb'
in your 'PATH', put it _after_ '/usr/bin'.
On Haiku, software installed for all users goes in '/boot/common',
not '/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features 'configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, 'configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
'--build=TYPE' option. TYPE can either be a short name for the system
type, such as 'sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file 'config.sub' for the possible values of each field. If
'config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option '--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with '--host=TYPE'.
Sharing Defaults
================
If you want to set default values for 'configure' scripts to share,
you can create a site shell script called 'config.site' that gives
default values for variables like 'CC', 'cache_file', and 'prefix'.
'configure' looks for 'PREFIX/share/config.site' if it exists, then
'PREFIX/etc/config.site' if it exists. Or, you can set the
'CONFIG_SITE' environment variable to the location of the site script.
A warning: not all 'configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to 'configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the 'configure' command line, using 'VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified 'gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for 'CONFIG_SHELL' due to
an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
'configure' Invocation
======================
'configure' recognizes the following options to control how it
operates.
'--help'
'-h'
Print a summary of all of the options to 'configure', and exit.
'--help=short'
'--help=recursive'
Print a summary of the options unique to this package's
'configure', and exit. The 'short' variant lists options used
only in the top level, while the 'recursive' variant lists options
also present in any nested packages.
'--version'
'-V'
Print the version of Autoconf used to generate the 'configure'
script, and exit.
'--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally 'config.cache'. FILE defaults to '/dev/null' to
disable caching.
'--config-cache'
'-C'
Alias for '--cache-file=config.cache'.
'--quiet'
'--silent'
'-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to '/dev/null' (any error
messages will still be shown).
'--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
'configure' can determine that directory automatically.
'--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
'--no-create'
'-n'
Run the configure checks, but stop before creating any output
files.
'configure' also accepts some other, not widely useful, options. Run
'configure --help' for more details.

5
Makefile.am Normal file
View File

@ -0,0 +1,5 @@
# Makefile.am for the gpligc/ogie project
SUBDIRS = src perl images
dist_doc_DATA = ChangeLog README doc/GPLIGC_Manual.pdf
EXTRA_DIST = win/makedist win/install_windows.pl win/README_windows.txt

838
Makefile.in Normal file
View File

@ -0,0 +1,838 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Makefile.am for the gpligc/ogie project
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(dist_doc_DATA) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(docdir)"
DATA = $(dist_doc_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in COPYING \
ChangeLog INSTALL README compile config.guess config.sub \
depcomp install-sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POW_LIB = @POW_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = src perl images
dist_doc_DATA = ChangeLog README doc/GPLIGC_Manual.pdf
EXTRA_DIST = win/makedist win/install_windows.pl win/README_windows.txt
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@test -f $@ || rm -f stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
install-dist_docDATA: $(dist_doc_DATA)
@$(NORMAL_INSTALL)
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
done
uninstall-dist_docDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(DATA) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(docdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-dist_docDATA
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-dist_docDATA
.MAKE: $(am__recursive_targets) all install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
distcheck distclean distclean-generic distclean-hdr \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dist_docDATA install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
tags-am uninstall uninstall-am uninstall-dist_docDATA
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

38
README Normal file
View File

@ -0,0 +1,38 @@
GPLIGC and openGLIGCexplorer
Authors:
Hannes Krueger
Bug reports / Support / Forum
http://sourceforge.net/projects/gpligc/support
Mailing list
There is a gpligc-announce mailing list, which will inform you about any updates
(extremely low traffic)
https://lists.sourceforge.net/lists/listinfo/gpligc-announce
Documentation:
For detailed information read the manual (GPLIGC_Manual.pdf)
Installation instructions:
tar xvzf gpligc-version.tar.gz
cd gpligc-version
./configure
make
sudo make install
in some cases you'll have to specify paths for includes and libraries using variables.
e.g. on OpenBSD you may use these options for the configure script:
./configure CPPFLAGS="-I/usr/X11R6/include -I/usr/local/include/" LDFLAGS="-L/usr/local/lib -L/usr/X11R6/lib"
Configure options
some packages/options can be enabled/disabled using command line arguments for configure:
gpsd (gps daemon): optional support for gpsd will be built into the ogie binary, if libgps is found.
to disable the checking for gpsd use --without-gpsd as an argument to ./configure
osmesa (offscreen rendering with Mesa): optional support for osmesa can be disabled by
--disable-osmesa as an argument to ./configure
more details on 'configure' can be found in the generic instructions in the file INSTALL
and in the output of ./configure --help

1152
aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

347
compile Executable file
View File

@ -0,0 +1,347 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

1449
config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

119
config.h.in Normal file
View File

@ -0,0 +1,119 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the `floor' function. */
#undef HAVE_FLOOR
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define if glXCreatePbuffer exists. */
#undef HAVE_GLXPBUFFER
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `GL' library (-lGL). */
#undef HAVE_LIBGL
/* Define to 1 if you have the `GLU' library (-lGLU). */
#undef HAVE_LIBGLU
/* Define to 1 if you have the `glut' library (-lglut). */
#undef HAVE_LIBGLUT
/* Define to 1 if you have the `gps' library (-lgps). */
#undef HAVE_LIBGPS
/* Define to 1 if you have the `jpeg' library (-ljpeg). */
#undef HAVE_LIBJPEG
/* Define to 1 if you have the `OSMesa' library (-lOSMesa). */
#undef HAVE_LIBOSMESA
/* Define to 1 if you have the `X11' library (-lX11). */
#undef HAVE_LIBX11
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `pow' function. */
#undef HAVE_POW
/* Define to 1 if you have the `sqrt' function. */
#undef HAVE_SQRT
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc

1831
config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

6956
configure vendored Executable file

File diff suppressed because it is too large Load Diff

80
configure.ac Normal file
View File

@ -0,0 +1,80 @@
# configure.ac for the gpligc/ogie project
AC_INIT([gpligc], [1.10.1])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h string.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([floor gettimeofday pow sqrt strcasecmp strchr strtol])
# check host
AC_CANONICAL_HOST
# some checks dont work on my mingw32 compile platform
AS_IF(
[test "x$host_os" != xmingw32],
AC_CHECK_LIB([glut], [glutInit], [], [AC_MSG_ERROR([glut library not found]) ])
AC_CHECK_LIB([GLU], [gluErrorString], [], [AC_MSG_ERROR([GLU library not found]) ])
AC_CHECK_LIB([jpeg], [jpeg_std_error], [], [AC_MSG_ERROR([jpeg library not found])] )
,
echo "Platform is $host_os setting LIBS=-lglut -lglu32 -lopengl32 -ljpeg"
LIBS="-lglut -lglu32 -lopengl32 -ljpeg"
)
# -static-libgcc -static-libstdc++ works, but produces larger archive files
# on pc12 this is needed as of ? now?
AC_CHECK_LIB([GL], [glBegin])
#[glXCreatePbuffer])
AC_CHECK_LIB([X11], [XOpenDisplay])
AC_CHECK_FUNC([glXCreatePbuffer], [AC_DEFINE([HAVE_GLXPBUFFER], [1],
[Define if glXCreatePbuffer exists.])])
# use of osmesa is default, but optional
AC_ARG_ENABLE([osmesa],
[AS_HELP_STRING([--enable-osmesa], [support for osmesa @<:@default=check@:>@])],
[], [enable_osmesa=check])
LIBOSMESA=
AS_IF(
[test "x$enable_osmesa" != xno],
[AC_CHECK_LIB([OSMesa], [OSMesaCreateContextExt], [], [if test "x$enable_osmesa" != xcheck; then
AC_MSG_FAILURE([--enable-osmesa was given, but test for osmesa failed])
fi])
]
)
# use of gpsd is default, but optional
AC_ARG_WITH([gpsd],
[AS_HELP_STRING([--with-gpsd], [support for gpsd @<:@default=check@:>@])],
[], [with_gpsd=check])
LIBGPS=
AS_IF(
[test "x$with_gpsd" != xno],
[AC_CHECK_LIB([gps], [read], [], [if test "x$with_gpsd" != xcheck; then
AC_MSG_FAILURE([--with-gpsd was given, but test for gpsd failed])
fi])
]
)
AC_CONFIG_FILES([
Makefile
src/Makefile
perl/Makefile
images/Makefile
])
AC_OUTPUT

791
depcomp Executable file
View File

@ -0,0 +1,791 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

BIN
doc/GPLIGC_Manual.pdf Normal file

Binary file not shown.

2
images/Makefile.am Normal file
View File

@ -0,0 +1,2 @@
sharedir = $(datadir)/gpligc
dist_share_DATA = logo.jpg logos.gif logos.jpg

467
images/Makefile.in Normal file
View File

@ -0,0 +1,467 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = images
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_share_DATA) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(sharedir)"
DATA = $(dist_share_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POW_LIB = @POW_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
sharedir = $(datadir)/gpligc
dist_share_DATA = logo.jpg logos.gif logos.jpg
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign images/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign images/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-dist_shareDATA: $(dist_share_DATA)
@$(NORMAL_INSTALL)
@list='$(dist_share_DATA)'; test -n "$(sharedir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(sharedir)'"; \
$(MKDIR_P) "$(DESTDIR)$(sharedir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sharedir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(sharedir)" || exit $$?; \
done
uninstall-dist_shareDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_share_DATA)'; test -n "$(sharedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(sharedir)'; $(am__uninstall_files_from_dir)
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(sharedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-dist_shareDATA
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-dist_shareDATA
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
ctags-am distclean distclean-generic distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dist_shareDATA install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-dist_shareDATA
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

BIN
images/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

BIN
images/logos.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
images/logos.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

501
install-sh Executable file
View File

@ -0,0 +1,501 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" $tab$nl"
# Set DOITPROG to "echo" to test this script.
doit=${DOITPROG-}
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

215
missing Executable file
View File

@ -0,0 +1,215 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2013-10-28.13; # UTC
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=http://www.perl.org/
flex_URL=http://flex.sourceforge.net/
gnu_software_URL=http://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

6488
perl/GPLIGC.pl Executable file

File diff suppressed because it is too large Load Diff

940
perl/GPLIGCfunctions.pm Normal file
View File

@ -0,0 +1,940 @@
# (c) 2001-2016 Hannes Krueger
# This file is part of the GPLIGC/ogie package
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
package GPLIGCfunctions;
#-------------------------------------------------------------------------------
sub igc2dec {
# converts igc-file-formatted coordinates (D)DDMMMMM(N|S|E|W) into decimal form
# DD MM.MMM
my $igck=shift;
if (length($igck)==8) { #Latitude DDMMMMM(N|S)
my $D=substr($igck,0,2);
my $M1=substr($igck,2,2);
my $M2=substr($igck,4,3);
my $M=$M1.".".$M2;
my $hemissphere=substr($igck,7,1);
my $latitude=($D+($M/60));
if ($hemissphere eq 'S') {$latitude=$latitude*(-1);}
return ($latitude);
}
if (length($igck)==9) { #Longitude DDDMMMMM(E|W)
my $D=substr($igck,0,3);
my $M1=substr($igck,3,2);
my $M2=substr($igck,5,3);
my $M=$M1.".".$M2;
my $hemissphere=substr($igck,8,1);
my $longitude=($D+($M/60));
if ($hemissphere eq 'W') {$longitude=$longitude*(-1);}
return ($longitude);
}
return ("Fehler in GPLIGCfunctions::igc2dec");
}
sub zan2dec {
# converts zan-file-formatted coordinates (D)DDMMSS(N|S|E|W) into decimal form
my $igck=shift;
if (length($igck)==7) { #Latitude DDMMSS(N|S)
my $D=substr($igck,0,2);
my $M=substr($igck,2,2);
my $S=substr($igck,4,2);
my $hemissphere=substr($igck,6,1);
my $latitude=($D+($M/60)+($S/3600));
if ($hemissphere eq 'S') {$latitude=$latitude*(-1);}
return ($latitude);
}
if (length($igck)==8) { #Longitude DDDMMSS(E|W)
my $D=substr($igck,0,3);
my $M=substr($igck,3,2);
my $S=substr($igck,5,2);
my $hemissphere=substr($igck,7,1);
my $longitude=($D+($M/60)+($S/3600));
if ($hemissphere eq 'W') {$longitude=$longitude*(-1);}
return ($longitude);
}
return ("Fehler in GPLIGCfunctions::zan2dec");
}
sub MaxKoor {
# gibt maximum und minimum des array (ref) zurueck
my $arrayref = shift;
my $max=${$arrayref}[0];
my $min=$arrayref->[0]; #Verschiedene Moeglichkeiten auf Element eines Arrays ber Referenz zuzugreifen
foreach (@$arrayref) {
if ($max < $_) {$max=$_;}
if ($min > $_) {$min=$_;}
}
return ($max, $min);
}
### calculates distance between two points on 'FAI-spheroid'
sub dist {
use Math::Trig;
my ($lat1, $lon1, $lat2 ,$lon2) = @_;
my $rho = 6371;
return ($rho * (acos(cos( deg2rad($lat1) ) * cos( deg2rad($lat2) ) * cos( deg2rad($lon2) - deg2rad($lon1) ) + sin( deg2rad($lat1) ) * sin( deg2rad($lat2) ) ) ) );
}
sub setpwd {
use File::Basename;
return File::Basename::dirname(shift);
}
#-------------------------------------------------------------------------------
sub time2human {
### converts time (HHMMSS) to HH:MM:SS
### or date DDMMYY to DD.MM.YY
### p=t -> time , p=d -> date
my ($time, $p) = @_;
if ($p eq 't') {my $htime = substr($time,0,2).":".substr($time,2,2).":".substr($time,4,2); return $htime;}
if ($p eq 'd') {my $htime = substr($time,0,2).".".substr($time,2,2).".".substr($time,4,2); return $htime;}
}
#########################################################
sub pointdist {
#calculates triangular distance of 3 points given by number in arrays of coordinates
my ($declat, $declon, $p1, $p2, $p3) = @_;
my $km=dist(${$declat}[$p1],${$declon}[$p1],${$declat}[$p2],${$declon}[$p2])+dist(${$declat}[$p2],${$declon}[$p2],${$declat}[$p3],${$declon}[$p3])+dist(${$declat}[$p3],${$declon}[$p3],${$declat}[$p1],${$declon}[$p1]);
return $km;
}
#-------------------------------------------------------------------------------
sub zufall {
### random integer between $min and $max
my ($min, $max) = @_;
return (int(rand $max-$min+1)+$min);
}
#--------------------------------------------------------------------------------
sub zufall2 {
### random integer between $min and $max (steps of devisor)
my ($min, $max, $devisor) = @_;
return ( (int(rand(($max-$min+1)/$devisor))* $devisor)+$min );
}
#-------------------------------------------------------------------------------
sub takeoff_detect {
### detects takeoff and landing!
my ($speedarrayref, $start_ldg) = @_;
my $lasttime=0;
my $times=0;
# check average speed...
my $speedsum = 0;
my $counter = 0;
foreach (@$speedarrayref) {
if ($_ > 5 && $_ < 500) {
$speedsum += $_;
$counter++;
}
}
if ($counter == 0) {print STDERR "GPLIGC: Warning: no data with speed between 5 and 500 km/h!\n"; $counter=1;}
my $avspeed=$speedsum/$counter;
my $limit = 2;
if ($avspeed > 30) {
$limit = 10;
}
if ($avspeed > 80) {
$limit = 40;
}
# get take-off time and return
if ($start_ldg eq 's'){
for (my $z=0; $z<=$#$speedarrayref; $z++) {
# 4x speed > 40 == takeoff... (takeofftime == time of first point > 40)
if ($speedarrayref->[$z]>$limit) {
if ($lasttime == 1) {$times++;} else {$lasttime=1;}
if ($times == 4) {return($z-4);}
} else { $lasttime=0;}
}
}
# get landing time and return
if ($start_ldg eq 'l'){
for (my $z=$#$speedarrayref; $z>=0; $z--) {
if ($speedarrayref->[$z]>$limit) {
if ($lasttime == 1) {$times++;} else {$lasttime=1;}
if ($times == 4) {return($z+4);}
} else { $lasttime=0;}
}
}
# if nothing was detected (slow paraglider etc...)
#
# hier muss noch ein algorithmus rein, der drachen flieger etc abdeckt...
# analyse der overall durchschnitsgeschwindigkeit?
#
if ($start_ldg eq 's') {return (0);}
if ($start_ldg eq 'l') {return ($#$speedarrayref);}
}
#-------------------------------------------------------------------------------
sub releaseDetect {
### tries to detect releaseTime
my ($altarrayref, $takeoff_index) = @_;
my $counter = $takeoff_index;
$takeoff_alt = $altarrayref->[$takeoff_index];
# skip until we climbed at least 150m
while ($altarrayref->[$counter] < $altarrayref->[$takeoff_index]+150) {
$counter++;
if ($counter >= $#$altarrayref) {return $takeoff_index;}
}
my $sinkcounter = 0;
for (my $c = $counter; $c <= $#$altarrayref; $c++) {
if ($altarrayref->[$c] < $altarrayref->[$c-1]) {$sinkcounter++;}
else {$sinkcounter = 0;}
if ($sinkcounter == 2) {return $c-2;}
}
}
sub OxygenStatistics {
### determines the Oxygen use according to FAA 91.211 1l/min / 10.000ft
my ($altarrayref, $dectimearrayref, $qnh) = @_;
my $time_100=0;
my $time_125=0; # minutes total
my $time_125acc=0; # minutes total
my $time_140=0;
my $time_180=0;
my $limit_100=3028;
my $limit_125=3810;
my $limit_140=4267; # 14.000ft
my $limit_180=5486; #FL180
my $free_flag = 1; # once above FL125 there is no free time between 100 an 125 any more
my $free_time=0;
my $maxalt=0;
my $maxpalt=0;
my $liters_100=0;
my $liters_125=0;
my $liters_125acc=0;
my $liters_140=0;
my $liters_180=0;
#loop
for (my $c = 0; $c <= $#$altarrayref; $c++) {
# check max
if ($altarrayref->[$c] > $maxalt) {$maxalt=$altarrayref->[$c]}
if (altitude(pressure($altarrayref->[$c],$qnh),1013.25) > $maxpalt) {$maxpalt=altitude(pressure($altarrayref->[$c],$qnh),1013.25)}
# recommended liumit FL100
if (altitude(pressure($altarrayref->[$c],$qnh),1013.24) > $limit_100 && altitude(pressure($altarrayref->[$c],$qnh),1013.24) <= $limit_125) {
$time_100 += ($dectimearrayref->[$c+1]-$dectimearrayref->[$c]);
$liters_100 += (($dectimearrayref->[$c+1]-$dectimearrayref->[$c])*60) * ((altitude(pressure($altarrayref->[$c],$qnh),1013.24)/0.3048)/10000);
}
# softlimit 125
if (altitude(pressure($altarrayref->[$c],$qnh),1013.24) > $limit_125 && altitude(pressure($altarrayref->[$c],$qnh),1013.24) <= $limit_140) {
if ($free_flag) {
if ($free_time < 0.5) {
$free_time += $dectimearrayref->[$c+1]-$dectimearrayref->[$c];
$free_flag=0 if ($free_time >= 0.5);
}
} else {
$time_125acc += ($dectimearrayref->[$c+1]-$dectimearrayref->[$c]);
$liters_125acc += (($dectimearrayref->[$c+1]-$dectimearrayref->[$c])*60) * ((altitude(pressure($altarrayref->[$c],$qnh),1013.24)/0.3048)/10000);
}
$time_125 += ($dectimearrayref->[$c+1]-$dectimearrayref->[$c]);
$liters_125 += (($dectimearrayref->[$c+1]-$dectimearrayref->[$c])*60) * ((altitude(pressure($altarrayref->[$c],$qnh),1013.24)/0.3048)/10000);
}
if (altitude(pressure($altarrayref->[$c],$qnh),1013.24) > $limit_140 && altitude(pressure($altarrayref->[$c],$qnh),1013.24) <= $limit_180) {
$free_flag=0;
$time_140 += ($dectimearrayref->[$c+1]-$dectimearrayref->[$c]);
$liters_140 += (($dectimearrayref->[$c+1]-$dectimearrayref->[$c])*60) * ((altitude(pressure($altarrayref->[$c],$qnh),1013.24)/0.3048)/10000);
}
if (altitude(pressure($altarrayref->[$c],$qnh),1013.24) > $limit_180) {
$free_flag=0;
$time_180 += ($dectimearrayref->[$c+1]-$dectimearrayref->[$c]);
$liters_180 += (($dectimearrayref->[$c+1]-$dectimearrayref->[$c])*60) * ((altitude(pressure($altarrayref->[$c],$qnh),1013.24)/0.3048)/10000);
}
}
$free_time = 0.5 if ($free_time > 0.5);
#print "Oxygen statistics:\n";
#print "above $softlimit m (min): ".($time_above_sl*60)."\n";
#print "above $hardlimit m (min): ".($time_above_hl*60)."\n";
#print "Liters to be used :".$liters_FAA." ".$liters_Oxymizer."\n";
return ($maxalt,$maxpalt,$time_100,$time_125,$time_125acc,$time_140,$time_180,$liters_100,$liters_125,$liters_125acc,$liters_140,$liters_180,$free_time);
}
#-------------------------------------------------------------------------------
sub dec2time {
### converts decimal time in (h)h:mm:ss
my $dectime= shift;
my $hh = int $dectime;
my $rest = $dectime - int $dectime;
my $mm = int(60 * $rest);
$rest= 60 * $rest - $mm;
my $ss = int (60*$rest);
$rest=60 * $rest -$ss;
if ($rest > 0.5) {$ss++;}
if ($ss == 60) {$ss=0;$mm++;}
# why was hh not 0 padded?
# I added this now 100809, side effects?
if (length($hh) == 1) {$hh = "0"."$hh";}
if (length($mm) == 1) {$mm = "0"."$mm";}
if (length($ss) == 1) {$ss = "0"."$ss";}
return ("$hh:$mm:$ss");
}
#-------------------------------------------------------------------------------
sub Ausschnitt2 {
# only for zoomfunction of FlightViewWindow!
use Math::Trig;
my ($height, $width, $lat, $lon, $kl) = @_;
my $halbkilometer=0.004496608;
my $sideratio=$width/$height;
my $xmin=$lon-($kl*$halbkilometer* ( 1/cos(deg2rad($lat)) ));
my $xmax=$lon+($kl*$halbkilometer* ( 1/cos(deg2rad($lat)) ));
my $ymin=$lat-($kl*$halbkilometer / $sideratio );
my $ymax=$lat+($kl*$halbkilometer / $sideratio );
return ($xmax, $xmin, $ymax, $ymin);
}
#-------------------------------------------------------------------------------
# calculates data for cylinders viewing in FVW...
sub zylinder2 {
use Math::Trig;
my ($lat, $lon, $r, $startangle, $angularrange) = @_; ###r=durchmesser
my $gpx;
my $start = deg2rad($startangle);
my $range = deg2rad($angularrange);
my @dlat=();
my @dlon=();
$gpx= $r * 0.0089932161;
my $step = 0.0314;
for (my $a=$start;$a<=$start+$range;$a=$a+$step) { # step 0.0314 gives 200 points on full circle
push(@dlat, cos($a)*$gpx);
push(@dlon, sin($a)*$gpx*(1/cos(deg2rad($lat))));
}
return (\@dlat, \@dlon);
} ###ende zylinder2 andere version fuer FVWindow!
#-------------------------------------------------------------------------------
# calculates sectors or starting line...
#
# NOT NEEDED, TO BE DELETED..........
sub sector {
use Math::Trig;
my ($n, $lat, $lon, $lat_after, $lon_after, $lat_before, $lon_before)= @_;
# n = 0 -> starting point
# n = 1 -> finish
# n = 2 -> wp
# n < 5 -> n km long starting-line
my $direction
}
#-------------------------------------------------------------------------------
#Calculates coordianates of a point which is in direction, distance
# from a given point
sub go {
use Math::Trig;
my ($lat, $lon, $heading, $distance) = @_;
#distance needs to be in degrees...
my $c =
(360 / (6371 * 2 * 3.141592654) ) * $distance ;
my $a = 90 - $lat;
my $beta = $heading;
# berechnung nach Seitenkosinussatz
my $b = rad2deg(acos(
cos(deg2rad($c)) * cos(deg2rad($a))
+ sin(deg2rad($c)) * sin(deg2rad($a)) * cos(deg2rad($beta))
));
my $gamma = rad2deg(asin(
( sin(deg2rad($c)) / sin(deg2rad($b)) ) * sin(deg2rad($beta))
));
return ( 90 -$b , $lon + $gamma);
}
#-------------------------------------------------------------------------------
sub sectordirection {
#berechnet den gegenkurs zur winkelhalbierenden
my ($head1, $head2) = @_;
if ($head1 < $head2) {
my $zw = $head1;
$head1 = $head2;
$head2 = $zw;
}
my $delta = $head1 - $head2;
if ($delta > 180) {
$delta = 360 - $delta;
#print "d < 180 ! \n";
return gegenkurs($head1)+$delta/2;
} else {
#print "nicht groesser \n";
my $secdir = gegenkurs($head1)-$delta/2;
if ($secdir < 0) { $secdir = $secdir + 360; }
return $secdir;
}
}
#-------------------------------------------------------------------------------
sub gegenkurs {
my $kurs = shift;
my $gegenk = $kurs - 180;
if ($gegenk < 0) {$gegenk = $gegenk + 360;}
return $gegenk;
}
#-------------------------------------------------------------------------------
sub kurs {
# calculates the heading from point 1 to point 2
# at point 1
#
#
#
#
# IV I
# -------------
# III II
#
my ($lat1, $lon1, $lat2, $lon2) = @_;
my $b = 90 - $lat1;
my $a = 90 - $lat2;
my $gamma = $lon1 - $lon2;
if ($gamma < 0) { $gamma = $gamma * -1} ;
my $c = rad2deg(acos(
cos(deg2rad($a)) * cos(deg2rad($b))
+ sin(deg2rad($a)) * sin(deg2rad($b)) * cos(deg2rad($gamma))
));
my $alpha = 0;
if ($c != 0) { # c == 0 if there is no movement ?
my $zwischenrechnung = (sin(deg2rad($a)) / sin(deg2rad($c)) ) * sin(deg2rad($gamma));
if ($zwischenrechnung > 1) {$zwischenrechnung =1;}
$alpha = rad2deg(asin($zwischenrechnung));
}
if ($lat1 >= $lat2 && $lon2 >= $lon1) { $alpha = 180-$alpha ; goto endmarke;} # quadrant 2
if ($lat1 >= $lat2 && $lon2 <= $lon1) { $alpha = 180+$alpha ; goto endmarke;} # quadrant 3
if ($lat1 <= $lat2 && $lon1 >= $lon2) { $alpha = 360-$alpha ; goto endmarke;} # quadrant 4
endmarke:
return $alpha;
}
#-------------------------------------------------------------------------------
sub coorconvert {
# converts decimal coordinates into different formats
my ($cor, $lorl, $outformat)=@_;
#lorl = lat _ or _ lon
#outformat:
# 'igc' 'igch' 'zan' 'zanh'
my $wesn;
my $deg_digits;
if ($outformat eq 'deg') {
return (sprintf("%.6f",$cor));
}
# determination of hemisphere s,n,w,e
if ($lorl eq 'lat') {
$deg_digits=2;
if (substr($cor,0,1) eq '-') {
$wesn='S'; $cor=$cor*(-1);
}
else
{$wesn='N'; }
}
if ($lorl eq 'lon') {
$deg_digits=3;
if (substr($cor,0,1) eq '-') {
$wesn='W'; $cor=$cor*(-1);
}
else
{$wesn='E'; }
}
my $deg = int $cor; #degrees
while ((length $deg) < $deg_digits) { $deg = "0".$deg;}
#pre-zeros
my $minigc = ($cor - $deg)*60; #minutes decimal
my $minzan = int (($cor - $deg)*60); #only minutes (integer)
if ((length $minzan) < 2) {$minzan="0".$minzan;} #zanderformatminutes gets filled up with zeros to 2digits
my $seczan = int(($minigc - $minzan)*60); #only seconds
#print "laenge ".(length $seczan)."\n";
my $rest_zan_sec=((($minigc-$minzan)*60)-$seczan); #rest after decimal
#print "restzansecs $rest_zan_sec \n";
if ($rest_zan_sec > 0.5) {$seczan++;}
#round up seconds if necessary
#print "igc min : $minigc \n";
my $igc_min_3stell = sprintf("%.3f",$minigc); #igc-minutes m.mmm
#print "igc_3stell $igc_min_3stell \n";
if ((substr($igc_min_3stell,2,1)) ne '.') {$igc_min_3stell="0".$igc_min_3stell;}
my $rest_igc_min = int($minigc * 1000); #cutted rest
#if ($rest_igc_min > 0.5) { $igc_min_3stell += 0.001;print "igc gerundet\n";} #round up if necessary
if ((length $seczan) < 2) {$seczan="0".$seczan;}
if ($outformat eq 'igc') {
my $igc_min_without_decimal = substr($igc_min_3stell,0,2).substr($igc_min_3stell,3,3);
return ("$deg$igc_min_without_decimal$wesn");
}
if ($outformat eq 'igch') {
return ("${deg} $igc_min_3stell\' $wesn");
}
if ($outformat eq 'zan') {
return ("$deg$minzan$seczan$wesn");
}
if ($outformat eq 'zanh') {
return ("${deg} $minzan\' $seczan\" $wesn");
}
return ("no valid outformat in GPLIGCfunctions::coorconv!!! $outformat");
}
#-------------------------------------------------------------------------------
sub pressure {
# calculates the pressure for given altitude and reference pressure, Std-Atmosphere
my $stdpress = 1013.25;
my $alt = shift;
my $p0 = shift;
if (defined $p0 && $p0 != 0) {$stdpress=$p0;}
return ( $stdpress * (1-(0.0065*$alt/288.15))**5.255 );
}
sub referencepressure {
# calculates the referencepressure p0 for given altitude and pressure, Std-Atmosphere
# my $stdpress = 1013.25;
my $alt = shift;
my $p = shift;
# if (defined $p0 && $p0 != 0) {$stdpress=$p0;}
return ( $p / ((1-(0.0065*$alt/288.15))**5.255) );
}
sub altitude {
# calculates an altitude from given pressure and reference pressue, std-atmosphere
my $stdpress = 1013.25;
my $p = shift;
my $p0 = shift;
if (defined $p0 && $p0 != 0) {$stdpress=$p0;}
return ((( 1-($p/$stdpress)**(1/5.255) ) * 288.15)/0.0065);
}
#-------------------------------------------------------------------------------
sub time2dec {
my $time = shift;
my $H=substr($time,0,2);
my $M=substr($time,2,2);
my $S=substr($time,4,2);
if (!defined $H || !defined $M || !defined $S) {
print "wrong string in time2dec: >$time<\n";
}
return ($H+(($M+($S/60))/60));
}
#-------------------------------------------------------------------------------
sub retArrayRef {
#anonymous arrayreferenz erzeugen
my @Array=();
return \@Array;
}
#-------------------------------------------------------------------------------
# this will evaluate the time of a JPEG from exif.
# single argument is a jpeg-file and return value is decimal time
# or zero in case of an error
sub getJPEGtime {
my $file = shift;
require Image::ExifTool;
my $info = Image::ExifTool::ImageInfo($file);
# for full exif tags output!
# while ( ($k,$v) = each %$info ) {
# print "$k => $v\n";
# }
if (!defined $info) {
print "GPLIGCfunctions::getJPEGtime: cant open file $file!\n";
return 0;
}
#my $image = $exif -> get_image_info();
# my $camera = $exif -> get_camera_info();
# my $other = $exif -> get_other_info();
# my %complete = (%$other, %$camera, %$image); # merging hashes into one
#my %complete = (%$info); # merging hashes into one
#print $complete."\n";
my $val;
my @times = ();
foreach $val ("DateTimeOriginal","CreateDate","Image Created", "Image Generated", "Image Digitized",
"DateTime", "Date Time", "Date and Time","ModifyDate", "FileModifyDate") {
if (exists $info->{$val}) {
# print $val." found: =>";
if ($info->{$val} =~ /(\d+):(\d+):(\d+)\s+(\d+):(\d+):(\d+)/ ){
push (@times, "$4$5$6");
# print "$4$5$6 \n";
}
}
}
# now we return the first value we found...
# maybe we can check here for multiple different times? ===15===
return (time2dec($times[0])) if ($#times >= 0);
if ($#times < 0) { return 0;}
}
# very simple geotagging!
sub geotag {
require Image::ExifTool;
my $file = shift;
my $lat = shift;
my $lon = shift;
my $alt = shift;
my $decutc = shift;
my $tzshift = shift;
my $force_overwrite = shift;
my $tagsset = 0;
my $succ=0;
my $err="no error";
#print "geotag: $file to be treated\n";
#maybe we should update the time too?
my $thingy = new Image::ExifTool;
$tagsset += $thingy -> SetNewValue('GPSLatitude', $lat);
$tagsset += $thingy -> SetNewValue('GPSLongitude', $lon);
$tagsset += $thingy -> SetNewValue('GPSLatitudeRef', 'N');
$tagsset += $thingy -> SetNewValue('GPSLongitudeRef', 'E');
if ($lat < 0) { $thingy -> SetNewValue('GPSLatitudeRef', 'S'); }
if ($lon < 0) { $thingy -> SetNewValue('GPSLongitudeRef', 'W'); }
$tagsset += $thingy -> SetNewValue('GPSAltitude', $alt);
# complains...
#$thingy -> SetNewValue('GPSAltitudeRef', '0');
# write GPS timeStamp
while ($decutc > 24) {$decutc=$decutc-24;}
$tagsset += $thingy -> SetNewValue('GPSTimeStamp', $decutc);
my $local=$decutc+$tzshift;
while ($local < 0 ) {$local=$local+24;}
while ($local > 24) {$local=$local-24;}
print "geo-tag: not enough tags set: $tagsset\n" if ($tagsset < 6) ;
# intercept error messages!
# check for existence of tags! HERE
if ($force_overwrite == 0) {
my $thingx = new Image::ExifTool;
my $info = $thingx->ImageInfo($file, 'GPSLatitude','GPSLongitude','GPSAltitude','GPSTimeStamp');
foreach (sort keys %$info) {
#print "$_ => $$info{$_}\n";
if ($_ eq "GPSLatitude" || $_ eq "GPSLongitude" ||$_ eq "GPSAltitude" || $_ eq "GPSTimeStamp") {
return 2; # tags exists!
}
}
}
($succ, $err) = $thingy ->WriteInfo($file);
if ($succ > 0) {return 1};
print "geo-tag: error: $err \n";
return 0;
}
sub getFiletime {
#require File::stat;
my $file = shift;
# print "GetFileTime: $file\n";
$x= (stat($file))[9];
my ($ss,$mm,$hh) = localtime($x);
#print "$hh : $mm : $ss \n";
my $ret = sprintf("%02d%02d%02d",$hh,$mm,$ss);
#print "$ret<===\n";
return(time2dec($ret));
}
#-------------------------------------------------------------------------------
sub get_name_date {
my ($ss, $mm, $hh, $dd, $mon, $yyyy) = gmtime ();
$mon++; # (dd: 1-31, mon: 0-11, y: yyyy -1900)
$yyyy+=1900;
$lfn= sprintf("%4d-%02d-%02d", $yyyy,$mon,$dd);
return ($lfn);
}
sub guessdatefromfilename {
my $fn = shift;
my $y = 0;
my $m = 0;
my $d = 0;
my ($name, $p, $suf) = File::Basename::fileparse($fn);
if (length($name) == 12 && lc(substr ($name,-3)) eq "igc") {
if ( substr($name,0,1) =~ /^\d+$/ ) {$y += substr($name,0,1);
$y+=2010;
}
if ( substr($name,1,1) =~ /^\d+$/ ) {$m = substr($name ,1,1)}
else {
$m = ord(lc(substr($name,1,1)))-87;
$m = 1 if ($m<10 || $m>12);
}
if ( substr($name,2,1) =~ /^\d+$/ ) {$d = substr($name ,2,1)}
else {
$d = ord(lc(substr($name,2,1)))-87;
$d = 1 if ($d<10 || $d>31);
}
}
# igc long format
if (length($name) == 25 && lc(substr ($name,-3)) eq "igc") {
if ( substr($name,0,4) =~ /^\d+$/ ) {$y = substr($name,0,4)}
if ( substr($name,5,2) =~ /^\d+$/ ) {$m = substr($name,5,2)}
if ( substr($name,8,2) =~ /^\d+$/ ) {$d = substr($name,8,2)}
}
#printf("%4d-%02d-%02d \n", $y,$m,$d);
return ($y,$m,$d);
}
# some stuff for maps:
# code from
# http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
sub getTileNumber {
my ($lat,$lon,$zoom) = @_;
my $xtile = int( ($lon+180)/360 *2**$zoom ) ;
my $ytile = int( (1 - log(tan(deg2rad($lat)) + sec(deg2rad($lat)))/pi)/2 *2**$zoom ) ;
return ($xtile, $ytile);
}
sub Project {
my ($X,$Y, $Zoom) = @_;
my $Unit = 1 / (2 ** $Zoom);
my $relY1 = $Y * $Unit;
my $relY2 = $relY1 + $Unit;
# note: $LimitY = ProjectF(degrees(atan(sinh(pi)))) = log(sinh(pi)+cosh(pi)) = pi
# note: degrees(atan(sinh(pi))) = 85.051128..
#my $LimitY = ProjectF(85.0511);
# so stay simple and more accurate
my $LimitY = pi;
my $RangeY = 2 * $LimitY;
$relY1 = $LimitY - $RangeY * $relY1;
$relY2 = $LimitY - $RangeY * $relY2;
my $Lat1 = ProjectMercToLat($relY1);
my $Lat2 = ProjectMercToLat($relY2);
$Unit = 360 / (2 ** $Zoom);
my $Long1 = -180 + $X * $Unit;
return ($Lat2, $Long1, $Lat1, $Long1 + $Unit); # S,W,N,E
}
sub ProjectMercToLat($){
my $MercY = shift;
return rad2deg(atan(sinh($MercY)));
}
sub ProjectF
{
my $Lat = shift;
$Lat = deg2rad($Lat);
my $Y = log(tan($Lat) + sec($Lat));
return $Y;
}
1;

16
perl/Makefile.am Normal file
View File

@ -0,0 +1,16 @@
bin_SCRIPTS = gpligc
dist_bin_SCRIPTS = gpsp2igcfile.pl gpsp2igc.pl loopviewer.pl
libgpligcdir = $(libdir)/gpligc
dist_libgpligc_SCRIPTS = GPLIGCfunctions.pm
CLEANFILES = gpligc
EXTRA_DIST = GPLIGC.pl
do_subst = sed -e 's,zzLIBDIRzz,$(libdir)/gpligc,g' \
-e 's,zzDATADIRzz,$(datadir)/gpligc,g'
gpligc: GPLIGC.pl Makefile
$(do_subst) < $(srcdir)/GPLIGC.pl > gpligc
chmod +x gpligc

567
perl/Makefile.in Normal file
View File

@ -0,0 +1,567 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = perl
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_bin_SCRIPTS) \
$(dist_libgpligc_SCRIPTS) $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(libgpligcdir)"
SCRIPTS = $(bin_SCRIPTS) $(dist_bin_SCRIPTS) $(dist_libgpligc_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POW_LIB = @POW_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
bin_SCRIPTS = gpligc
dist_bin_SCRIPTS = gpsp2igcfile.pl gpsp2igc.pl loopviewer.pl
libgpligcdir = $(libdir)/gpligc
dist_libgpligc_SCRIPTS = GPLIGCfunctions.pm
CLEANFILES = gpligc
EXTRA_DIST = GPLIGC.pl
do_subst = sed -e 's,zzLIBDIRzz,$(libdir)/gpligc,g' \
-e 's,zzDATADIRzz,$(datadir)/gpligc,g'
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign perl/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign perl/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n' \
-e 'h;s|.*|.|' \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
@$(NORMAL_INSTALL)
@list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n' \
-e 'h;s|.*|.|' \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-dist_binSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
install-dist_libgpligcSCRIPTS: $(dist_libgpligc_SCRIPTS)
@$(NORMAL_INSTALL)
@list='$(dist_libgpligc_SCRIPTS)'; test -n "$(libgpligcdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(libgpligcdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libgpligcdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n' \
-e 'h;s|.*|.|' \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libgpligcdir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libgpligcdir)$$dir" || exit $$?; \
} \
; done
uninstall-dist_libgpligcSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(dist_libgpligc_SCRIPTS)'; test -n "$(libgpligcdir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
dir='$(DESTDIR)$(libgpligcdir)'; $(am__uninstall_files_from_dir)
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(SCRIPTS)
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libgpligcdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-dist_libgpligcSCRIPTS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binSCRIPTS install-dist_binSCRIPTS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binSCRIPTS uninstall-dist_binSCRIPTS \
uninstall-dist_libgpligcSCRIPTS
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
ctags-am distclean distclean-generic distdir dvi dvi-am html \
html-am info info-am install install-am install-binSCRIPTS \
install-data install-data-am install-dist_binSCRIPTS \
install-dist_libgpligcSCRIPTS install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags-am uninstall uninstall-am \
uninstall-binSCRIPTS uninstall-dist_binSCRIPTS \
uninstall-dist_libgpligcSCRIPTS
.PRECIOUS: Makefile
gpligc: GPLIGC.pl Makefile
$(do_subst) < $(srcdir)/GPLIGC.pl > gpligc
chmod +x gpligc
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

144
perl/gpsp2igc.pl Executable file
View File

@ -0,0 +1,144 @@
#!/usr/bin/perl -w
# $Id: gpsp2igc.pl 3 2014-07-31 09:59:20Z kruegerh $
# (c) 2002-2016 Hannes Krueger
# This file is part of the GPLIGC/ogie package
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
# This little script converts a tracklist file obtained from a Garmin GPS using
# the gpspoint program into something resembling an IGC file for use with other programs.
# Script by Jan M. W. Krueger, 1st of March 2004
#
# put into the GPLIGC/perl CVS repository
# $Id: gpsp2igc.pl 3 2014-07-31 09:59:20Z kruegerh $
#
# revised by Hannes Kruger
# usage:
# gpsp2igc.pl <inputfile.gpspoint >out.igc
# or
# gpspoint -dt | gpsp2igc.pl >out.igc
# should work also
@lines = <STDIN>;
@igclines = ();
# flag for new track segment ( 0 is new segment)
$first = 0;
for($tmp=0; $tmp<=$#lines; $tmp++){
if($lines[$tmp] =~ /trackpoint/){
if($lines[$tmp] =~ /newsegment=\"yes\"/){
$lines[$tmp] =~ s/\ \ newsegment=\"yes\"\ //g;
#push(@outlines, "\n");
push(@igclines, "\n");
$first = 0;
}
$lines[$tmp] =~ s/type\=\"trackpoint\"\ \ //g;
$lines[$tmp] =~ s/\"/\ /g;
$lines[$tmp] =~ s/altitude\=\ //g;
$lines[$tmp] =~ s/latitude\=\ //g;
$lines[$tmp] =~ s/longitude\=\ //g;
$lines[$tmp] =~ s/unixtime\=\ //g;
$lines[$tmp] =~ /([\d.-]+)\s*([\d.-]+)\s*([\d.-]+)\s*([\d.-]+)/;
$alt = $1;
$latitude = $2;
$longitude = $3;
$unixtime = $4;
# Put altitude in IGC line format:
if($alt<0){
$altnew = -$alt;
$altnew = sprintf "%5d", $altnew;
$altnew =~ s/\ /0/g;
$altnew =~ s/0/-/;
} else {
$altnew = sprintf "%5d", $alt;
$altnew =~ s/\ /0/g;
}
# Put latitude in IGC line format:
if($latitude < 0){
$latitudenew = -$latitude;
$ns = "S";
} else {
$latitudenew = $latitude;
$ns = "N";
}
$latint = sprintf "%.0f", $latitudenew-0.5;
$latmins = 100000* ($latitudenew - $latint)*60/100;
$latint = sprintf "%2.0f", $latint;
$latint =~ s/\ /0/g;
$latmins = sprintf "%5.0f", $latmins;
$latmins =~ s/\ /0/g;
$latitudestring = $latint.$latmins.$ns;
# Put longitude in IGC line format:
if($longitude < 0){
$longitudenew = -$longitude;
$ew = "W";
} else {
$longitudenew = $longitude;
$ew = "E";
}
$lonint = sprintf "%.0f", $longitudenew-0.5;
$lonmins = 100000* ($longitudenew - $lonint)*60/100;
$lonint = sprintf "%3.0f", $lonint;
$lonint =~ s/\ /0/g;
$lonmins = sprintf "%5.0f", $lonmins;
$lonmins =~ s/\ /0/g;
$longitudestring = $lonint.$lonmins.$ew;
# use gmtime to get GMT from unix-epoch-seconds
($ss, $mm, $hh, $dd, $mon, $yy) = gmtime ($unixtime);
$mon++; # (dd: 1-31, mon: 0-11, y: yyyy -1900)
$yy+=1900; $yy=substr($yy,2);
# detect new segment and mark with HFDTEddmmyy
if($first == 0){
push(@igclines, "HFDTE".sprintf("%02d%02d%02d",$dd,$mon,$yy)."\n");
$first = 1;
}
push(@igclines, "B".sprintf("%02d%02d%02d", $hh,$mm,$ss).$latitudestring.$longitudestring."A".$altnew.$altnew."\n");
}
}
# give out some pseudo-header
print "AXXX000 garmin2igc.pl ".'$Id: gpsp2igc.pl 3 2014-07-31 09:59:20Z kruegerh $'."\n";
print "HFFTY FR Type: some Garmin device\n";
print "HFFSW Software: gpspoint / garmin2igc.pl\n";
print @igclines;

181
perl/gpsp2igcfile.pl Executable file
View File

@ -0,0 +1,181 @@
#!/usr/bin/perl -w
# $Id: gpsp2igcfile.pl 3 2014-07-31 09:59:20Z kruegerh $
# (c) 2002-2016 Hannes Krueger
# This file is part of the GPLIGC/ogie package
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
# This little script converts a tracklist file obtained from a Garmin GPS using
# the gpspoint program into something resembling an IGC file for use with other programs.
# Script by Jan M. W. Krueger, 1st of March 2004
# put into the GPLIGC/perl CVS repository
# $Id: gpsp2igcfile.pl 3 2014-07-31 09:59:20Z kruegerh $
# revised by Hannes Kruger
# usage:
# gpsp2igc.pl <inputfile.gpspoint
# this will write igcfiles for each day!
# with more or less igc conform filenames!
# see also gpsp2igc
# new segment on new day -> new igc file! (well, that may be problematic for australian files...)
# igc naming
$device_id = "000";
$manufacturer_short="X";
$manufacturer_long="GAR";
$filenr=1;
@lines = <STDIN>;
# flag for new track segment ( 1 is new segment)
$first = 0;
$oday ="000000"; # old day!
for($tmp=0; $tmp<=$#lines; $tmp++){
if($lines[$tmp] =~ /trackpoint/){
if($lines[$tmp] =~ /newsegment=\"yes\"/){
$lines[$tmp] =~ s/\ \ newsegment=\"yes\"\ //g;
#push(@outlines, "\n");
#push(@igclines, "\n");
$first = 1;
}
$lines[$tmp] =~ s/type\=\"trackpoint\"\ \ //g;
$lines[$tmp] =~ s/\"/\ /g;
$lines[$tmp] =~ s/altitude\=\ //g;
$lines[$tmp] =~ s/latitude\=\ //g;
$lines[$tmp] =~ s/longitude\=\ //g;
$lines[$tmp] =~ s/unixtime\=\ //g;
$lines[$tmp] =~ /([\d.-]+)\s*([\d.-]+)\s*([\d.-]+)\s*([\d.-]+)/;
$alt = $1;
$latitude = $2;
$longitude = $3;
$unixtime = $4;
# Put altitude in IGC line format:
if($alt<0){
$altnew = -$alt;
$altnew = sprintf "%5d", $altnew;
$altnew =~ s/\ /0/g;
$altnew =~ s/0/-/;
} else {
$altnew = sprintf "%5d", $alt;
$altnew =~ s/\ /0/g;
}
# Put latitude in IGC line format:
if($latitude < 0){
$latitudenew = -$latitude;
$ns = "S";
} else {
$latitudenew = $latitude;
$ns = "N";
}
$latint = sprintf "%.0f", $latitudenew-0.5;
$latmins = 100000* ($latitudenew - $latint)*60/100;
$latint = sprintf "%2.0f", $latint;
$latint =~ s/\ /0/g;
$latmins = sprintf "%5.0f", $latmins;
$latmins =~ s/\ /0/g;
$latitudestring = $latint.$latmins.$ns;
# Put longitude in IGC line format:
if($longitude < 0){
$longitudenew = -$longitude;
$ew = "W";
} else {
$longitudenew = $longitude;
$ew = "E";
}
$lonint = sprintf "%.0f", $longitudenew-0.5;
$lonmins = 100000* ($longitudenew - $lonint)*60/100;
$lonint = sprintf "%3.0f", $lonint;
$lonint =~ s/\ /0/g;
$lonmins = sprintf "%5.0f", $lonmins;
$lonmins =~ s/\ /0/g;
$longitudestring = $lonint.$lonmins.$ew;
# use gmtime to get GMT from unix-epoch-seconds
($ss, $mm, $hh, $dd, $mon, $yyyy) = gmtime ($unixtime);
$mon++; # (dd: 1-31, mon: 0-11, y: yyyy -1900)
$yyyy+=1900; $yy=substr($yyyy,2);
# detect new segment and mark with HFDTEddmmyy
if($first == 1){
$first = 0;
if (sprintf("%02d%02d%02d",$dd,$mon,$yy) ne $oday) {
newfile($yyyy,$mon,$dd);
$oday = sprintf("%02d%02d%02d",$dd,$mon,$yy);
}
}
print FN "B".sprintf("%02d%02d%02d", $hh,$mm,$ss).$latitudestring.$longitudestring."A".$altnew.$altnew."\n";
}
}
sub newfile {
my $y=shift;
my $m=shift;
my $d=shift;
my ($igcm, $igcd);
my $igcy=substr($y,-1);
if ($m < 10) {$igcm=$m}
if ($m == 10) {$igcm="a"}
if ($m == 11) {$igcm="b"}
if ($m == 12) {$igcm="c"}
if ($d < 10) {$igcd=$d} else {
$igcd= chr(97+($d-10));
}
filenames:
my $fn = "$igcy$igcm$igcd$manufacturer_short${device_id}$filenr.igc";
my $lfn= sprintf("%4d-%02d-%02d-$manufacturer_long-$device_id-%02d.igc", $y,$m,$d,$filenr);
print "IGC file: $lfn ($fn)\n";
if (-e $lfn) {print "$lfn ($fn) exists!\n"; $filenr++; goto filenames;}
close FN;
open(FN, ">$lfn") || die "cannot open $lfn for writing";
print FN "A$manufacturer_long$device_id ".'$Id: gpsp2igcfile.pl 3 2014-07-31 09:59:20Z kruegerh $'."\n";
print FN "HFFTY FR Type: unknown device\n";
print FN "HFFSW Software: gpspoint / gpsp2igcfile.pl\n\n";
my $yy=substr($y,2);
print FN "HFDTE".sprintf("%02d%02d%02d",$d,$m,$yy)."\n\n";
}

39
perl/loopviewer.pl Executable file
View File

@ -0,0 +1,39 @@
#!/usr/bin/perl -w
# The loopviewer-script is a tool for viewing lots of igc files as a presentation loop
# for detailed information see GPLIGC_Manual.pdf
# this is just a template, parameters in $ogieflags* have to be adjusted for your needs
#uncomment "#goto loop;" for endlss loops
#comment out one of the system calls for either 2D or 3D only
# start with
# loopviewer.pl liste
#
# liste is a file which has one line for each igc file + comment
# "path/filename.igc" "1.Place - Name - Class - Glider - points - speed - distance ..."
my $ogieflags= " --quiet --fullscreen --airfield-elevation=960 --spinning 0.3 --movie --cycles=1 --marker --marker-range --marker-back=700";
my $ogieflags2D = " --init-ortho-lat=48.06 --init-ortho-lon=8.8 ";
my $ogieflags3D = " --init-alt=4000 --init-heading=0 --init-lat=47.9514 --init-lon=8.765 --init-dive=-30 ";
my $file = shift;
open (INFILE,"<$file");
my @list = <INFILE>;
close INFILE;
loop:
foreach (@list) {
$_ =~ /^\"(.*)\"\s*\"(.*)\"/;
#print "$2 >$1\n";
system ("ogie $ogieflags $ogieflags3D --text \"$2\" -i \"$1\" ");
system ("ogie $ogieflags $ogieflags2D --ortho --text \"$2\" -i \"$1\" ");
}
#goto loop;

292
src/.ogierc Normal file
View File

@ -0,0 +1,292 @@
# This is an exmaple configuration file for
# OGIE
# lines beginning with #, space or empty lines are ignored
##########################################################################
# GENERAL OPTIONS
# SAVE_PATH string A Path, were to store screenshots
# BASENAME string A basename for screenshots
# JPEG_QUALITY int (0-100)
# IMAGE_FORMAT (rgb or jpg)
#start with mouse function
#false is mouse control on!
MOUSE false
#more output (only for debugging reasons)
VERBOSE false
###########################################################################
# Digital Elevation Model File Setup
#This block can be used for Europe
#(if you have GTOPO30 W020N90.DEM)
#but set full path to file
#DEM_FILE PREFIX/share/gpligc/data/dem/W020N90.DEM
#DEM_ROWS 6000
#DEM_COLUMNS 4800
#DEM_LAT_MIN 40
#DEM_LAT_MAX 90
#DEM_LON_MIN -20
#DEM_LON_MAX 20
#if you have created a WORLD.DEM from the 33 GTOPO30 Tiles
# or even the WORLD3.DEM (see manual)
#DEM_FILE PREFIX/share/gpligc/data/dem/WORLD.DEM
#DEM_ROWS 21600
#DEM_COLUMNS 43200
#DEM_LAT_MIN -90
#DEM_LAT_MAX 90
#DEM_LON_MIN -180
#DEM_LON_MAX 180
#if you have downloaded the TOPO30
#(See documentation)
#DEM_FILE PREFIX/share/gpligc/data/dem/topo30
#DEM_ROWS 21600
#DEM_COLUMNS 43200
#DEM_LAT_MIN -90
#DEM_LAT_MAX 90
#DEM_LON_MIN 0
#DEM_LON_MAX 360
#resolution of DEM Model
#0.008333333333 is 30 arc-sec
#which will work for GTOPO30 and GLOBE
DEM_GRID_LAT 0.008333333333
DEM_GRID_LON 0.008333333333
###########################################################################
# OPTIONS FOR DRAWING THE TERRAIN
# sealevels
#SEALEVEL 0
#SEALEVEL2 -22222
#SEALEVEL3 -22222
#default colormaps
#1=max's special "LSD"-Map
#2=max's "Atlas colormap"
#3=hannes' "grayscale-moon-map"
#4=dark green -> red
#5=magenta -> light blue
#6=extended LSD-Map
COLORMAP 2
COLORMAP_SEA 5
LANDSCAPE true
WIRE false
#MAXTRIANGLES float
#AUTOREDUCE on
#QUADS off
#Gouraud-Shading (true) or flat shading (false)
SHADE true
#terrain border (in km)
BORDER 30.0
#############################################################################
# GENERAL DRAWING OPTIONS
# haze
HAZE false
HAZE_DENSITY 0.01
#start fullscreen
FULLSCREEN false
#initial window size
#if FULLSCREEN isnt enabled
WINDOW_WIDTH 1024
WINDOW_HEIGHT 768
#Angle of view
ANGLE_OF_VIEW 80
PROJECTION 4
#1=Cylindrical (platt)
#2=MERCATOR
#3=Cylindrical
#4=pseudo cylindrical
#default z-axis(height) scaling
SCALE_Z 3.0
# BACKGROUND_COLOR_1_R 1.0
# BACKGROUND_COLOR_1_G 0.2 (floats 0-1)
# BACKGROUND_COLOR_1_B 0.2
# BACKGROUND_COLOR_2_R 0.0
# BACKGROUND_COLOR_2_G 0.0
# BACKGROUND_COLOR_2_B 0.0
# BACKGROUND_STYLE 1 (1=one color (color 1), 2=vertical gradient
# (color1=top), 3=horiz gradient (color1=left)
#############################################################################
# OPTIONS FOR DISPLAY OF INFORMATION
# info text
INFO true
# INFOFONT_SIZE 40 (int 20-100) window_height / INFOFONT_SIZE
# INFOFONT_LINEWIDTH 1.0 (float 0.5-3.0)
# INFO_STYLE 1 (1= new style [thanks to antonio ospite], 2=old style)
#############################################################################
# Units:
# Use your favourite units. Calculate the conversion factor (from defaults)
# Defaults (speed=km/h, vspeed=m/s, alt=m)
#SPEED_UNIT_FAC 0.539957
#SPEED_UNIT_NAME knots
#SPEED_UNIT_FAC 0.621504
#SPEED_UNIT_NAME mph
#VSPEED_UNIT_FAC 1.94384
#VSPEED_UNIT_NAME knots
#VSPEED_UNIT_FAC 196.8
#VSPEED_UNIT_NAME ft/min
#ALT_UNIT_FAC 3.28
#ALT_UNIT_NAME ft
#TIME_ZONE 0
#TIME_ZONE_NAME UTC
#############################################################################
# OPTIONS FOR DISPLAY OF FLIGHTS
# FLIGHTSTRIPCOLUP_R 1.0
# FLIGHTSTRIPCOLUP_G 0.0
# FLIGHTSTRIPCOLUP_B 0.0
# FLIGHTSTRIPCOLDOWN_R 0.0
# FLIGHTSTRIPCOLDOWN_G 0.0
# FLIGHTSTRIPCOLDOWN_B 0.0
# FLIGHTSTRIP_LINEWIDTH 2.0 (float 1-7)
# FLIGHTSTRIP_MODE 1 (0=classic,1=alt,2=speed,3=vario)
# FLIGHTSTRIP_COLORMAP 1 (1-7)
# A range of the flight will be displayed.
MARKER_RANGE false
# The displayed range can be defined here.
MARKER_BACK 50
MARKER_AHEAD 0
# Viewpoint will follow Marker
FOLLOW true
# use GPS (true) or Barometric (false) altitude
GPSALT false
# draw marker
MARKER true
MARKER_SIZE 1.0
# MARKERCOL_R 1.0
# MARKERCOL_G 0.0
# MARKERCOL_B 0.0
# draw curtain
CURTAIN true
# SPINNING float
# MOVIE bool
# MOVIE_REPEAT
# MOVIE_REPEAT_FACTOR
# MOVIE_REPEAT_FPS_LIMIT
#######################################################################
# OPTIONS FOR DRAWING AIRSPACES
#OPEN_AIR_FILE PREFIX/share/gpligc/data/airspace/airspace.txt
AIRSPACE false
#AIRSPACE_LIMIT int
#AIRSPACE_WIRE 0
#AIRSPACE_D 1
#AIRSPACE_C 1
#AIRSPACE_CTR 1
#AIRSPACE_R 1
#AIRSPACE_P 1
#AIRSPACE_Q 1
###########################################################################
# OPTIONS FOR STEREOGRAPHIC DISPLAY
# stereographic view
# only one of the following three may be true
STEREO false
STEREO_RG false
STEREO_RB false
# swap stereographic images
INVERSE_STEREO false
# eye distance for stereographic images (km)
EYE_DIST 0.1
############################################################################
# OPTIONS FOR DRAWING POINT INFORMATION (LIFTS/WAYPOINTS)
#LIFTS_COLOR_R 1.0
#LIFTS_COLOR_G 0.0
#LIFTS_COLOR_B 0.0
#WP_COLOR_R 0.0
#WP_COLOR_G 0.0
#WP_COLOR_B 0.0
# for suitable file format see manual!
#WAYPOINTS_FILE PREFIX/share/gpligc/data/waypoint/wpfile.gwpt
#WAYPOINTS false
#TEXT_COLOR_R 0.0
#TEXT_COLOR_G 0.0
#TEXT_COLOR_B 0.0
#TEXT_LINEWIDTH 2.0
############################################################################
# OPTIONS FOR DRAWING OF THE MAPS
# MAPS_UNLIGHTED
# use MAPS
MAP false
# use DEM-Altitude-color with textured maps
MODULATE true
#######################################################################
# Texture map Setup
#Texture map compression
#with compression texture loading will need more time
#but rendering is faster and will need fewer videomemory
#but not supported by some openGL implementations
COMPRESSION false
#MAP_SET_NAME Osterholz
#MAP_SHIFT_LAT 0.0
#MAP_SHIFT_LON 0.0
#MAP_FILE PREFIX/share/gpligc/data/map/bremen/bremen512x1024.jpg
#MAP_TOP 53.5
#MAP_RIGHT 9.3333333333
#MAP_LEFT 8.6666666667
#MAP_BOTTOM 52.8333333333
#MAP_CUT
#MAP_SET_NAME Innsbruck
#MAP_FILE PREFIX/share/gpligc/data/map/innsbruck/n48e012.jpg
#MAP_TOP 48
#MAP_RIGHT 13
#MAP_LEFT 12
#MAP_BOTTOM 47

5909
src/GLexplorer.cpp Normal file

File diff suppressed because it is too large Load Diff

75
src/GLexplorer.h Normal file
View File

@ -0,0 +1,75 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*/
#ifndef GLEXPLORER_H
#define GLEXPLORER_H 1
#include <stdio.h>
#include <jpeglib.h>
#include "cmdline.h"
#include "../config.h"
// CMDLINE_PARSER_PACKAGE is set to OGIE in gengetopts cmdline.h (via cmdline.ggo)
// uswed because PACKAGE from autotools is gpligc
#ifdef CMDLINE_PARSER_PACKAGE
const std::string OGIE_PACKAGE = CMDLINE_PARSER_PACKAGE ;
#else
const std::string OGIE_PACKAGE = "OGIE" ;
#endif
// this comes from ..config.h (autoconf)
// the package version
#ifdef VERSION
const std::string OGIE_VERSION = VERSION ;
#endif
// DEVELOPEMENT and WEB2 can be erased, once all occurances checked and removed
const std::string DEVELOPEMENT = "";
const std::string COPYRIGHT = "(c) 2002-2016";
const std::string AUTHOR = "Hannes Krueger";
const std::string MAIL = "<Hannes.Krueger@gmail.com>";
const std::string WEB2 = ""; //"http://freshmeat.net/projects/gpligc";
const std::string WEB ="http://gpligc.sf.net";
const int ESCAPE = 27; //ASCII ESCAPE
const double PI_180 = 0.017453292; //Pi divided by 180
const double DEGDIST = 111.1949266; //1 in km on surface of the earth
extern "C" {
void write_JPEG_file (int image_width, int image_height, int quality,
char *jpegFileName, JSAMPLE *image_buffer);
unsigned char* read_jpg(int* width, int* height, char *filename); //, unsigned char *map);
void copy_resample_image_buffer (unsigned char* destination, unsigned char* source,
int destination_x, int destination_y, int source_x, int source_y,
int destination_width, int destination_height, int source_width, int source_height,
int source_dimw, int destination_dimw);
}
void setinitpos(void);
void DrawInfo(void);
void screenshot();
void screenshot_rgb();
void screenshot_jpeg(); //Max's cool jpeg screenshot function
void InitGL (int , int) ;
void IdleFunc(void);
void joystick(unsigned int, int, int, int);
void update_locked_pos(void);
void update_diff_pos(void);
void GenFlightList(void);
void GenLandscapeList(void);
void GenAirspaceList(void);
void GenPointsList(void);
void Ende(int);
#endif

27
src/Makefile.am Normal file
View File

@ -0,0 +1,27 @@
# src/Makefile.am for the gpligc/ogie project
bin_PROGRAMS = ogie merger optimizer etopo1merger etopo2merger createworld
ogie_SOURCES = GLexplorer.cpp GLexplorer.h airspc.cpp airspc.h cmdline.c cmdline.h \
oconfig.cpp oconfig.h ego.cpp ego.h flightdata.cpp flightdata.h \
landscape.cpp landscape.h map.cpp map.h oglexfunc.cpp oglexfunc.h \
points.cpp points.h projection.cpp projection.h value.h write_jpeg.c
ogie_LDFLAGS = -Wl,--as-needed
merger_SOURCES = merger.cpp
merger_LDFLAGS = -Wl,--as-needed
optimizer_SOURCES = optimizer.cpp oglexfunc.cpp
optimizer_CXXFLAGS = -DOPTIMIZER
optimizer_LDFLAGS = -Wl,--as-needed
etopo1merger_SOURCES = etopo1merger.cpp
etopo1merger_LDFLAGS = -Wl,--as-needed
etopo2merger_SOURCES = etopo2merger.cpp
etopo2merger_LDFLAGS = -Wl,--as-needed
createworld_SOURCES = createworlddem.cpp
createworld_LDFLAGS = -Wl,--as-needed
sharedir = $(datadir)/gpligc
dist_share_DATA = .ogierc

780
src/Makefile.in Normal file
View File

@ -0,0 +1,780 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# src/Makefile.am for the gpligc/ogie project
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = ogie$(EXEEXT) merger$(EXEEXT) optimizer$(EXEEXT) \
etopo1merger$(EXEEXT) etopo2merger$(EXEEXT) \
createworld$(EXEEXT)
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_share_DATA) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sharedir)"
PROGRAMS = $(bin_PROGRAMS)
am_createworld_OBJECTS = createworlddem.$(OBJEXT)
createworld_OBJECTS = $(am_createworld_OBJECTS)
createworld_LDADD = $(LDADD)
createworld_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(createworld_LDFLAGS) $(LDFLAGS) -o $@
am_etopo1merger_OBJECTS = etopo1merger.$(OBJEXT)
etopo1merger_OBJECTS = $(am_etopo1merger_OBJECTS)
etopo1merger_LDADD = $(LDADD)
etopo1merger_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(etopo1merger_LDFLAGS) $(LDFLAGS) -o $@
am_etopo2merger_OBJECTS = etopo2merger.$(OBJEXT)
etopo2merger_OBJECTS = $(am_etopo2merger_OBJECTS)
etopo2merger_LDADD = $(LDADD)
etopo2merger_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(etopo2merger_LDFLAGS) $(LDFLAGS) -o $@
am_merger_OBJECTS = merger.$(OBJEXT)
merger_OBJECTS = $(am_merger_OBJECTS)
merger_LDADD = $(LDADD)
merger_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(merger_LDFLAGS) \
$(LDFLAGS) -o $@
am_ogie_OBJECTS = GLexplorer.$(OBJEXT) airspc.$(OBJEXT) \
cmdline.$(OBJEXT) oconfig.$(OBJEXT) ego.$(OBJEXT) \
flightdata.$(OBJEXT) landscape.$(OBJEXT) map.$(OBJEXT) \
oglexfunc.$(OBJEXT) points.$(OBJEXT) projection.$(OBJEXT) \
write_jpeg.$(OBJEXT)
ogie_OBJECTS = $(am_ogie_OBJECTS)
ogie_LDADD = $(LDADD)
ogie_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(ogie_LDFLAGS) \
$(LDFLAGS) -o $@
am_optimizer_OBJECTS = optimizer-optimizer.$(OBJEXT) \
optimizer-oglexfunc.$(OBJEXT)
optimizer_OBJECTS = $(am_optimizer_OBJECTS)
optimizer_LDADD = $(LDADD)
optimizer_LINK = $(CXXLD) $(optimizer_CXXFLAGS) $(CXXFLAGS) \
$(optimizer_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
AM_V_CXX = $(am__v_CXX_@AM_V@)
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
am__v_CXX_0 = @echo " CXX " $@;
am__v_CXX_1 =
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
am__v_CXXLD_0 = @echo " CXXLD " $@;
am__v_CXXLD_1 =
SOURCES = $(createworld_SOURCES) $(etopo1merger_SOURCES) \
$(etopo2merger_SOURCES) $(merger_SOURCES) $(ogie_SOURCES) \
$(optimizer_SOURCES)
DIST_SOURCES = $(createworld_SOURCES) $(etopo1merger_SOURCES) \
$(etopo2merger_SOURCES) $(merger_SOURCES) $(ogie_SOURCES) \
$(optimizer_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
DATA = $(dist_share_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POW_LIB = @POW_LIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ogie_SOURCES = GLexplorer.cpp GLexplorer.h airspc.cpp airspc.h cmdline.c cmdline.h \
oconfig.cpp oconfig.h ego.cpp ego.h flightdata.cpp flightdata.h \
landscape.cpp landscape.h map.cpp map.h oglexfunc.cpp oglexfunc.h \
points.cpp points.h projection.cpp projection.h value.h write_jpeg.c
ogie_LDFLAGS = -Wl,--as-needed
merger_SOURCES = merger.cpp
merger_LDFLAGS = -Wl,--as-needed
optimizer_SOURCES = optimizer.cpp oglexfunc.cpp
optimizer_CXXFLAGS = -DOPTIMIZER
optimizer_LDFLAGS = -Wl,--as-needed
etopo1merger_SOURCES = etopo1merger.cpp
etopo1merger_LDFLAGS = -Wl,--as-needed
etopo2merger_SOURCES = etopo2merger.cpp
etopo2merger_LDFLAGS = -Wl,--as-needed
createworld_SOURCES = createworlddem.cpp
createworld_LDFLAGS = -Wl,--as-needed
sharedir = $(datadir)/gpligc
dist_share_DATA = .ogierc
all: all-am
.SUFFIXES:
.SUFFIXES: .c .cpp .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
createworld$(EXEEXT): $(createworld_OBJECTS) $(createworld_DEPENDENCIES) $(EXTRA_createworld_DEPENDENCIES)
@rm -f createworld$(EXEEXT)
$(AM_V_CXXLD)$(createworld_LINK) $(createworld_OBJECTS) $(createworld_LDADD) $(LIBS)
etopo1merger$(EXEEXT): $(etopo1merger_OBJECTS) $(etopo1merger_DEPENDENCIES) $(EXTRA_etopo1merger_DEPENDENCIES)
@rm -f etopo1merger$(EXEEXT)
$(AM_V_CXXLD)$(etopo1merger_LINK) $(etopo1merger_OBJECTS) $(etopo1merger_LDADD) $(LIBS)
etopo2merger$(EXEEXT): $(etopo2merger_OBJECTS) $(etopo2merger_DEPENDENCIES) $(EXTRA_etopo2merger_DEPENDENCIES)
@rm -f etopo2merger$(EXEEXT)
$(AM_V_CXXLD)$(etopo2merger_LINK) $(etopo2merger_OBJECTS) $(etopo2merger_LDADD) $(LIBS)
merger$(EXEEXT): $(merger_OBJECTS) $(merger_DEPENDENCIES) $(EXTRA_merger_DEPENDENCIES)
@rm -f merger$(EXEEXT)
$(AM_V_CXXLD)$(merger_LINK) $(merger_OBJECTS) $(merger_LDADD) $(LIBS)
ogie$(EXEEXT): $(ogie_OBJECTS) $(ogie_DEPENDENCIES) $(EXTRA_ogie_DEPENDENCIES)
@rm -f ogie$(EXEEXT)
$(AM_V_CXXLD)$(ogie_LINK) $(ogie_OBJECTS) $(ogie_LDADD) $(LIBS)
optimizer$(EXEEXT): $(optimizer_OBJECTS) $(optimizer_DEPENDENCIES) $(EXTRA_optimizer_DEPENDENCIES)
@rm -f optimizer$(EXEEXT)
$(AM_V_CXXLD)$(optimizer_LINK) $(optimizer_OBJECTS) $(optimizer_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLexplorer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/airspc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdline.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/createworlddem.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ego.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/etopo1merger.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/etopo2merger.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flightdata.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/landscape.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/map.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/merger.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oconfig.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oglexfunc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optimizer-oglexfunc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optimizer-optimizer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/points.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/projection.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write_jpeg.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cpp.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
.cpp.obj:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
optimizer-optimizer.o: optimizer.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(optimizer_CXXFLAGS) $(CXXFLAGS) -MT optimizer-optimizer.o -MD -MP -MF $(DEPDIR)/optimizer-optimizer.Tpo -c -o optimizer-optimizer.o `test -f 'optimizer.cpp' || echo '$(srcdir)/'`optimizer.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/optimizer-optimizer.Tpo $(DEPDIR)/optimizer-optimizer.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='optimizer.cpp' object='optimizer-optimizer.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(optimizer_CXXFLAGS) $(CXXFLAGS) -c -o optimizer-optimizer.o `test -f 'optimizer.cpp' || echo '$(srcdir)/'`optimizer.cpp
optimizer-optimizer.obj: optimizer.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(optimizer_CXXFLAGS) $(CXXFLAGS) -MT optimizer-optimizer.obj -MD -MP -MF $(DEPDIR)/optimizer-optimizer.Tpo -c -o optimizer-optimizer.obj `if test -f 'optimizer.cpp'; then $(CYGPATH_W) 'optimizer.cpp'; else $(CYGPATH_W) '$(srcdir)/optimizer.cpp'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/optimizer-optimizer.Tpo $(DEPDIR)/optimizer-optimizer.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='optimizer.cpp' object='optimizer-optimizer.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(optimizer_CXXFLAGS) $(CXXFLAGS) -c -o optimizer-optimizer.obj `if test -f 'optimizer.cpp'; then $(CYGPATH_W) 'optimizer.cpp'; else $(CYGPATH_W) '$(srcdir)/optimizer.cpp'; fi`
optimizer-oglexfunc.o: oglexfunc.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(optimizer_CXXFLAGS) $(CXXFLAGS) -MT optimizer-oglexfunc.o -MD -MP -MF $(DEPDIR)/optimizer-oglexfunc.Tpo -c -o optimizer-oglexfunc.o `test -f 'oglexfunc.cpp' || echo '$(srcdir)/'`oglexfunc.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/optimizer-oglexfunc.Tpo $(DEPDIR)/optimizer-oglexfunc.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='oglexfunc.cpp' object='optimizer-oglexfunc.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(optimizer_CXXFLAGS) $(CXXFLAGS) -c -o optimizer-oglexfunc.o `test -f 'oglexfunc.cpp' || echo '$(srcdir)/'`oglexfunc.cpp
optimizer-oglexfunc.obj: oglexfunc.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(optimizer_CXXFLAGS) $(CXXFLAGS) -MT optimizer-oglexfunc.obj -MD -MP -MF $(DEPDIR)/optimizer-oglexfunc.Tpo -c -o optimizer-oglexfunc.obj `if test -f 'oglexfunc.cpp'; then $(CYGPATH_W) 'oglexfunc.cpp'; else $(CYGPATH_W) '$(srcdir)/oglexfunc.cpp'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/optimizer-oglexfunc.Tpo $(DEPDIR)/optimizer-oglexfunc.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='oglexfunc.cpp' object='optimizer-oglexfunc.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(optimizer_CXXFLAGS) $(CXXFLAGS) -c -o optimizer-oglexfunc.obj `if test -f 'oglexfunc.cpp'; then $(CYGPATH_W) 'oglexfunc.cpp'; else $(CYGPATH_W) '$(srcdir)/oglexfunc.cpp'; fi`
install-dist_shareDATA: $(dist_share_DATA)
@$(NORMAL_INSTALL)
@list='$(dist_share_DATA)'; test -n "$(sharedir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(sharedir)'"; \
$(MKDIR_P) "$(DESTDIR)$(sharedir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sharedir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(sharedir)" || exit $$?; \
done
uninstall-dist_shareDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_share_DATA)'; test -n "$(sharedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(sharedir)'; $(am__uninstall_files_from_dir)
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(DATA)
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sharedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-dist_shareDATA
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-dist_shareDATA
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
install-am install-binPROGRAMS install-data install-data-am \
install-dist_shareDATA install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-binPROGRAMS uninstall-dist_shareDATA
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

1490
src/airspc.cpp Normal file

File diff suppressed because it is too large Load Diff

64
src/airspc.h Normal file
View File

@ -0,0 +1,64 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*/
#ifndef AIRSPC_H
#define AIRSPC_H 1
#include<vector>
#include<string>
#include "oconfig.h"
#include "projection.h"
class Airspace {
public:
Airspace(float _center_lat, float _center_lon, float _latmax, float _latmin, float _lonmax, float _lonmin);
Airspace() ;
void initAirspace(float _center_lat, float _center_lon, float _latmax, float _latmin, float _lonmax, float _lonmin);
void drawAirspace(bool BW);
void readOpenAirFile(string);
void setConfig(Config* _c) {conf= _c;};
void set_proj_pointer(Projection *p) { proj = p;}
protected:
Config *conf;
Projection *proj; //the projection-class pointer
float center_lat;
float center_lon;
float latmax;
float lonmax;
float latmin;
float lonmin;
float coor2dec(char*, char*);
vector<int> lower; // altitudes in m
vector<string>lower_unit; // can be MSL, GND or STD
vector<int> upper;
vector<string>upper_unit;
//int n;
vector<vector<float> >xcoor;
vector<vector<float> >ycoor;
vector<vector<float> >lat;
vector<vector<float> >lon;
vector<string> type;
vector<string> name;
vector<string> direction; // only for testing
};
#endif

4232
src/cmdline.c Normal file

File diff suppressed because it is too large Load Diff

704
src/cmdline.h Normal file
View File

@ -0,0 +1,704 @@
/** @file cmdline.h
* @brief The header file for the command line option parser
* generated by GNU Gengetopt version 2.22.6
* http://www.gnu.org/software/gengetopt.
* DO NOT modify this file, since it can be overwritten
* @author GNU Gengetopt by Lorenzo Bettini */
#ifndef CMDLINE_H
#define CMDLINE_H
/* If we use autoconf. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h> /* for FILE */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifndef CMDLINE_PARSER_PACKAGE
/** @brief the program name (used for printing errors) */
#define CMDLINE_PARSER_PACKAGE "OGIE"
#endif
#ifndef CMDLINE_PARSER_PACKAGE_NAME
/** @brief the complete program name (used for help and version) */
#define CMDLINE_PARSER_PACKAGE_NAME "OGIE"
#endif
#ifndef CMDLINE_PARSER_VERSION
/** @brief the program version */
#define CMDLINE_PARSER_VERSION VERSION
#endif
/** @brief Where the command line options are stored */
struct gengetopt_args_info
{
const char *help_help; /**< @brief Print help and exit help description. */
const char *version_help; /**< @brief Print version and exit help description. */
int verbose_flag; /**< @brief verbosity? (default=off). */
const char *verbose_help; /**< @brief verbosity? help description. */
int quiet_flag; /**< @brief Quiet (default=off). */
const char *quiet_help; /**< @brief Quiet help description. */
int query_gl_flag; /**< @brief Querying openGL implementation (default=off). */
const char *query_gl_help; /**< @brief Querying openGL implementation help description. */
int check_flag; /**< @brief return exitcode 0 (default=off). */
const char *check_help; /**< @brief return exitcode 0 help description. */
int compiler_flag; /**< @brief info about build (default=off). */
const char *compiler_help; /**< @brief info about build help description. */
int debug_flag; /**< @brief lots of output (default=off). */
const char *debug_help; /**< @brief lots of output help description. */
char * igc_file_arg; /**< @brief igc-file. */
char * igc_file_orig; /**< @brief igc-file original value given at command line. */
const char *igc_file_help; /**< @brief igc-file help description. */
int gpsd_flag; /**< @brief live gps via gpsd (default=off). */
const char *gpsd_help; /**< @brief live gps via gpsd help description. */
char * gpsd_server_arg; /**< @brief address of gpsd server. */
char * gpsd_server_orig; /**< @brief address of gpsd server original value given at command line. */
const char *gpsd_server_help; /**< @brief address of gpsd server help description. */
int gpsd_port_arg; /**< @brief port of gpsd server. */
char * gpsd_port_orig; /**< @brief port of gpsd server original value given at command line. */
const char *gpsd_port_help; /**< @brief port of gpsd server help description. */
int gpsalt_flag; /**< @brief use gps altitude (default=off). */
const char *gpsalt_help; /**< @brief use gps altitude help description. */
int baroalt_flag; /**< @brief use barometric alt (default=off). */
const char *baroalt_help; /**< @brief use barometric alt help description. */
int use_all_fixes_flag; /**< @brief Use all position fixes (default=off). */
const char *use_all_fixes_help; /**< @brief Use all position fixes help description. */
float lat_arg; /**< @brief Latitude. */
char * lat_orig; /**< @brief Latitude original value given at command line. */
const char *lat_help; /**< @brief Latitude help description. */
float lon_arg; /**< @brief Longitude. */
char * lon_orig; /**< @brief Longitude original value given at command line. */
const char *lon_help; /**< @brief Longitude help description. */
int get_elevation_flag; /**< @brief Return elevation of lat/lon (default=off). */
const char *get_elevation_help; /**< @brief Return elevation of lat/lon help description. */
char * config_file_arg; /**< @brief config file. */
char * config_file_orig; /**< @brief config file original value given at command line. */
const char *config_file_help; /**< @brief config file help description. */
int ortho_flag; /**< @brief 2D Orthographic View (default=off). */
const char *ortho_help; /**< @brief 2D Orthographic View help description. */
int perspective_flag; /**< @brief 3D View (default=off). */
const char *perspective_help; /**< @brief 3D View help description. */
int aov_arg; /**< @brief angle of view. */
char * aov_orig; /**< @brief angle of view original value given at command line. */
const char *aov_help; /**< @brief angle of view help description. */
int landscape_flag; /**< @brief landscape from dem (default=off). */
const char *landscape_help; /**< @brief landscape from dem help description. */
int flat_flag; /**< @brief flat underground (default=off). */
const char *flat_help; /**< @brief flat underground help description. */
int map_flag; /**< @brief display digitized maps (default=off). */
const char *map_help; /**< @brief display digitized maps help description. */
int no_map_flag; /**< @brief dont use maps (default=off). */
const char *no_map_help; /**< @brief dont use maps help description. */
char * map_set_name_arg; /**< @brief name of map set to use. */
char * map_set_name_orig; /**< @brief name of map set to use original value given at command line. */
const char *map_set_name_help; /**< @brief name of map set to use help description. */
int modulate_flag; /**< @brief dem color and maps (default=off). */
const char *modulate_help; /**< @brief dem color and maps help description. */
int no_modulate_flag; /**< @brief no color modulation (default=off). */
const char *no_modulate_help; /**< @brief no color modulation help description. */
int maps_unlighted_flag; /**< @brief dont use lighting for unmodulated maps (default=off). */
const char *maps_unlighted_help; /**< @brief dont use lighting for unmodulated maps help description. */
int maps_lighted_flag; /**< @brief use lighting for unmodulated maps (default=off). */
const char *maps_lighted_help; /**< @brief use lighting for unmodulated maps help description. */
int no_lighting_flag; /**< @brief Dont use lighting for terrain (default=off). */
const char *no_lighting_help; /**< @brief Dont use lighting for terrain help description. */
int terrain_shading_flag; /**< @brief Use terrain shading (implies no-lighting) (default=off). */
const char *terrain_shading_help; /**< @brief Use terrain shading (implies no-lighting) help description. */
float shading_scale_arg; /**< @brief shading-scale (1-10000). */
char * shading_scale_orig; /**< @brief shading-scale (1-10000) original value given at command line. */
const char *shading_scale_help; /**< @brief shading-scale (1-10000) help description. */
int light_direction_arg; /**< @brief direction for light (1-8). */
char * light_direction_orig; /**< @brief direction for light (1-8) original value given at command line. */
const char *light_direction_help; /**< @brief direction for light (1-8) help description. */
int airspace_flag; /**< @brief Airspace visualization (default=off). */
const char *airspace_help; /**< @brief Airspace visualization help description. */
int airspace_wire_flag; /**< @brief Airspace as wireframe (default=off). */
const char *airspace_wire_help; /**< @brief Airspace as wireframe help description. */
float airspace_wire_col_r_arg; /**< @brief wire color red. */
char * airspace_wire_col_r_orig; /**< @brief wire color red original value given at command line. */
const char *airspace_wire_col_r_help; /**< @brief wire color red help description. */
float airspace_wire_col_g_arg; /**< @brief wire color green. */
char * airspace_wire_col_g_orig; /**< @brief wire color green original value given at command line. */
const char *airspace_wire_col_g_help; /**< @brief wire color green help description. */
float airspace_wire_col_b_arg; /**< @brief wire color blue. */
char * airspace_wire_col_b_orig; /**< @brief wire color blue original value given at command line. */
const char *airspace_wire_col_b_help; /**< @brief wire color blue help description. */
float airspace_wire_width_arg; /**< @brief linewidth wires. */
char * airspace_wire_width_orig; /**< @brief linewidth wires original value given at command line. */
const char *airspace_wire_width_help; /**< @brief linewidth wires help description. */
int airspace_transparent_flag; /**< @brief Airspace transparent (default=off). */
const char *airspace_transparent_help; /**< @brief Airspace transparent help description. */
int no_airspace_flag; /**< @brief no Airspaces (default=off). */
const char *no_airspace_help; /**< @brief no Airspaces help description. */
char * airspace_file_arg; /**< @brief use airspaces from file. */
char * airspace_file_orig; /**< @brief use airspaces from file original value given at command line. */
const char *airspace_file_help; /**< @brief use airspaces from file help description. */
int airspace_limit_arg; /**< @brief limit (FL) for airspaces. */
char * airspace_limit_orig; /**< @brief limit (FL) for airspaces original value given at command line. */
const char *airspace_limit_help; /**< @brief limit (FL) for airspaces help description. */
int wire_flag; /**< @brief wireframe landscape (default=off). */
const char *wire_help; /**< @brief wireframe landscape help description. */
int filled_flag; /**< @brief filled polygons (default=off). */
const char *filled_help; /**< @brief filled polygons help description. */
int grayscale_flag; /**< @brief grayscaled image (default=off). */
const char *grayscale_help; /**< @brief grayscaled image help description. */
int color_flag; /**< @brief color image (default=off). */
const char *color_help; /**< @brief color image help description. */
int stereo_flag; /**< @brief stereoscopic (default=off). */
const char *stereo_help; /**< @brief stereoscopic help description. */
int no_stereo_flag; /**< @brief no stereoscopic view (default=off). */
const char *no_stereo_help; /**< @brief no stereoscopic view help description. */
int stereo_rg_flag; /**< @brief stereoscopic red/green (default=off). */
const char *stereo_rg_help; /**< @brief stereoscopic red/green help description. */
int no_stereo_rg_flag; /**< @brief no stereoscopic red/green (default=off). */
const char *no_stereo_rg_help; /**< @brief no stereoscopic red/green help description. */
int stereo_rb_flag; /**< @brief stereoscopic red/blue (default=off). */
const char *stereo_rb_help; /**< @brief stereoscopic red/blue help description. */
int no_stereo_rb_flag; /**< @brief no stereoscopic red/blue (default=off). */
const char *no_stereo_rb_help; /**< @brief no stereoscopic red/blue help description. */
int stereo_hw_flag; /**< @brief stereoscopic hardware (default=off). */
const char *stereo_hw_help; /**< @brief stereoscopic hardware help description. */
int no_stereo_hw_flag; /**< @brief no stereoscopic hardware (default=off). */
const char *no_stereo_hw_help; /**< @brief no stereoscopic hardware help description. */
int inverse_stereo_flag; /**< @brief invert right/left image (default=off). */
const char *inverse_stereo_help; /**< @brief invert right/left image help description. */
int no_inverse_stereo_flag; /**< @brief dont invert right/left (default=off). */
const char *no_inverse_stereo_help; /**< @brief dont invert right/left help description. */
float eye_dist_arg; /**< @brief eye distance for stereoscopic view (km). */
char * eye_dist_orig; /**< @brief eye distance for stereoscopic view (km) original value given at command line. */
const char *eye_dist_help; /**< @brief eye distance for stereoscopic view (km) help description. */
int flat_shading_flag; /**< @brief no gouraud (default=off). */
const char *flat_shading_help; /**< @brief no gouraud help description. */
int gouraud_shading_flag; /**< @brief use gouraud-shading (default=off). */
const char *gouraud_shading_help; /**< @brief use gouraud-shading help description. */
int quads_flag; /**< @brief use quadrilaterals (default=off). */
const char *quads_help; /**< @brief use quadrilaterals help description. */
int curtain_flag; /**< @brief draw curtain (default=off). */
const char *curtain_help; /**< @brief draw curtain help description. */
int no_curtain_flag; /**< @brief draw no curtain (default=off). */
const char *no_curtain_help; /**< @brief draw no curtain help description. */
int haze_flag; /**< @brief draw haze (default=off). */
const char *haze_help; /**< @brief draw haze help description. */
int no_haze_flag; /**< @brief draw no haze (default=off). */
const char *no_haze_help; /**< @brief draw no haze help description. */
float haze_density_arg; /**< @brief haze density (0-0.5). */
char * haze_density_orig; /**< @brief haze density (0-0.5) original value given at command line. */
const char *haze_density_help; /**< @brief haze density (0-0.5) help description. */
int colormap_arg; /**< @brief no. of colormap to use. */
char * colormap_orig; /**< @brief no. of colormap to use original value given at command line. */
const char *colormap_help; /**< @brief no. of colormap to use help description. */
int colormap_sea_arg; /**< @brief colormap 2 (sea). */
char * colormap_sea_orig; /**< @brief colormap 2 (sea) original value given at command line. */
const char *colormap_sea_help; /**< @brief colormap 2 (sea) help description. */
int colormap_min_arg; /**< @brief mininum height. */
char * colormap_min_orig; /**< @brief mininum height original value given at command line. */
const char *colormap_min_help; /**< @brief mininum height help description. */
int colormap_max_arg; /**< @brief maximum height. */
char * colormap_max_orig; /**< @brief maximum height original value given at command line. */
const char *colormap_max_help; /**< @brief maximum height help description. */
int sealevel_arg; /**< @brief set sealevel. */
char * sealevel_orig; /**< @brief set sealevel original value given at command line. */
const char *sealevel_help; /**< @brief set sealevel help description. */
int sealevel2_arg; /**< @brief set sealevel2. */
char * sealevel2_orig; /**< @brief set sealevel2 original value given at command line. */
const char *sealevel2_help; /**< @brief set sealevel2 help description. */
int sealevel3_arg; /**< @brief set sealevel3. */
char * sealevel3_orig; /**< @brief set sealevel3 original value given at command line. */
const char *sealevel3_help; /**< @brief set sealevel3 help description. */
int ignore_elev_min_arg; /**< @brief ignore range min. */
char * ignore_elev_min_orig; /**< @brief ignore range min original value given at command line. */
const char *ignore_elev_min_help; /**< @brief ignore range min help description. */
int ignore_elev_max_arg; /**< @brief ignore range max. */
char * ignore_elev_max_orig; /**< @brief ignore range max original value given at command line. */
const char *ignore_elev_max_help; /**< @brief ignore range max help description. */
float scalez_arg; /**< @brief z axis scaling. */
char * scalez_orig; /**< @brief z axis scaling original value given at command line. */
const char *scalez_help; /**< @brief z axis scaling help description. */
int downscaling_arg; /**< @brief dem raster downscaling. */
char * downscaling_orig; /**< @brief dem raster downscaling original value given at command line. */
const char *downscaling_help; /**< @brief dem raster downscaling help description. */
int upscaling_arg; /**< @brief dem raster interpolation factor. */
char * upscaling_orig; /**< @brief dem raster interpolation factor original value given at command line. */
const char *upscaling_help; /**< @brief dem raster interpolation factor help description. */
int fullscreen_flag; /**< @brief Fullscreen (default=off). */
const char *fullscreen_help; /**< @brief Fullscreen help description. */
int window_flag; /**< @brief start windowed (default=off). */
const char *window_help; /**< @brief start windowed help description. */
int width_arg; /**< @brief Window width. */
char * width_orig; /**< @brief Window width original value given at command line. */
const char *width_help; /**< @brief Window width help description. */
int height_arg; /**< @brief Window height. */
char * height_orig; /**< @brief Window height original value given at command line. */
const char *height_help; /**< @brief Window height help description. */
float border_arg; /**< @brief Border Lat and Lon. */
char * border_orig; /**< @brief Border Lat and Lon original value given at command line. */
const char *border_help; /**< @brief Border Lat and Lon help description. */
float border_lat_arg; /**< @brief Border Lat. */
char * border_lat_orig; /**< @brief Border Lat original value given at command line. */
const char *border_lat_help; /**< @brief Border Lat help description. */
float border_lon_arg; /**< @brief Border Lon. */
char * border_lon_orig; /**< @brief Border Lon original value given at command line. */
const char *border_lon_help; /**< @brief Border Lon help description. */
int offset_arg; /**< @brief height offset in m. */
char * offset_orig; /**< @brief height offset in m original value given at command line. */
const char *offset_help; /**< @brief height offset in m help description. */
int airfield_elevation_arg; /**< @brief Elevation of airfield (take-off) in m. */
char * airfield_elevation_orig; /**< @brief Elevation of airfield (take-off) in m original value given at command line. */
const char *airfield_elevation_help; /**< @brief Elevation of airfield (take-off) in m help description. */
int marker_pos_arg; /**< @brief Position of marker. */
char * marker_pos_orig; /**< @brief Position of marker original value given at command line. */
const char *marker_pos_help; /**< @brief Position of marker help description. */
char * marker_time_arg; /**< @brief Time of markerposition. */
char * marker_time_orig; /**< @brief Time of markerposition original value given at command line. */
const char *marker_time_help; /**< @brief Time of markerposition help description. */
int marker_flag; /**< @brief Marker (default=off). */
const char *marker_help; /**< @brief Marker help description. */
float marker_size_arg; /**< @brief Size of the Marker. */
char * marker_size_orig; /**< @brief Size of the Marker original value given at command line. */
const char *marker_size_help; /**< @brief Size of the Marker help description. */
int no_marker_flag; /**< @brief no Marker (default=off). */
const char *no_marker_help; /**< @brief no Marker help description. */
int info_flag; /**< @brief Info text display (default=off). */
const char *info_help; /**< @brief Info text display help description. */
int no_info_flag; /**< @brief no info text display (default=off). */
const char *no_info_help; /**< @brief no info text display help description. */
char * text_arg; /**< @brief Text string to display. */
char * text_orig; /**< @brief Text string to display original value given at command line. */
const char *text_help; /**< @brief Text string to display help description. */
int no_position_info_flag; /**< @brief Turn off viewpoint position info (default=off). */
const char *no_position_info_help; /**< @brief Turn off viewpoint position info help description. */
int no_marker_pos_info_flag; /**< @brief Turn off marker position info (default=off). */
const char *no_marker_pos_info_help; /**< @brief Turn off marker position info help description. */
float text_size_arg; /**< @brief Size of text for points/lifts (0.001-1.0). */
char * text_size_orig; /**< @brief Size of text for points/lifts (0.001-1.0) original value given at command line. */
const char *text_size_help; /**< @brief Size of text for points/lifts (0.001-1.0) help description. */
float text_width_arg; /**< @brief Width of text (1-20). */
char * text_width_orig; /**< @brief Width of text (1-20) original value given at command line. */
const char *text_width_help; /**< @brief Width of text (1-20) help description. */
char * lifts_arg; /**< @brief GPLIGC liftsfile. */
char * lifts_orig; /**< @brief GPLIGC liftsfile original value given at command line. */
const char *lifts_help; /**< @brief GPLIGC liftsfile help description. */
int lifts_info_mode_arg; /**< @brief which info to display (1-7). */
char * lifts_info_mode_orig; /**< @brief which info to display (1-7) original value given at command line. */
const char *lifts_info_mode_help; /**< @brief which info to display (1-7) help description. */
char * waypoints_file_arg; /**< @brief waypointsfile. */
char * waypoints_file_orig; /**< @brief waypointsfile original value given at command line. */
const char *waypoints_file_help; /**< @brief waypointsfile help description. */
int waypoints_flag; /**< @brief show waypoints (default=off). */
const char *waypoints_help; /**< @brief show waypoints help description. */
int no_waypoints_flag; /**< @brief dont show waypoints (default=off). */
const char *no_waypoints_help; /**< @brief dont show waypoints help description. */
int waypoints_info_mode_arg; /**< @brief which info to display (1-4). */
char * waypoints_info_mode_orig; /**< @brief which info to display (1-4) original value given at command line. */
const char *waypoints_info_mode_help; /**< @brief which info to display (1-4) help description. */
int waypoints_offset_arg; /**< @brief offset for displaying waypoint text in 3D. */
char * waypoints_offset_orig; /**< @brief offset for displaying waypoint text in 3D original value given at command line. */
const char *waypoints_offset_help; /**< @brief offset for displaying waypoint text in 3D help description. */
int waypoints_offset_spheres_arg; /**< @brief offset for displaying waypoint spheres and text in 3D. */
char * waypoints_offset_spheres_orig; /**< @brief offset for displaying waypoint spheres and text in 3D original value given at command line. */
const char *waypoints_offset_spheres_help; /**< @brief offset for displaying waypoint spheres and text in 3D help description. */
int flighttrack_mode_arg; /**< @brief sets the mode of track display. */
char * flighttrack_mode_orig; /**< @brief sets the mode of track display original value given at command line. */
const char *flighttrack_mode_help; /**< @brief sets the mode of track display help description. */
int flighttrack_colormap_arg; /**< @brief sets the colourmap for flighttrack. */
char * flighttrack_colormap_orig; /**< @brief sets the colourmap for flighttrack original value given at command line. */
const char *flighttrack_colormap_help; /**< @brief sets the colourmap for flighttrack help description. */
float flighttrack_linewidth_arg; /**< @brief sets the linewidth of the flighttrack. */
char * flighttrack_linewidth_orig; /**< @brief sets the linewidth of the flighttrack original value given at command line. */
const char *flighttrack_linewidth_help; /**< @brief sets the linewidth of the flighttrack help description. */
int follow_flag; /**< @brief viewpoint follows marker (default=off). */
const char *follow_help; /**< @brief viewpoint follows marker help description. */
int no_follow_flag; /**< @brief viewpoint doesnt follow marker (default=off). */
const char *no_follow_help; /**< @brief viewpoint doesnt follow marker help description. */
int marker_range_flag; /**< @brief range around marker is plottet (default=off). */
const char *marker_range_help; /**< @brief range around marker is plottet help description. */
int no_marker_range_flag; /**< @brief full flight is displayed (default=off). */
const char *no_marker_range_help; /**< @brief full flight is displayed help description. */
int marker_ahead_arg; /**< @brief define marker range. */
char * marker_ahead_orig; /**< @brief define marker range original value given at command line. */
const char *marker_ahead_help; /**< @brief define marker range help description. */
int marker_back_arg; /**< @brief define marker range. */
char * marker_back_orig; /**< @brief define marker range original value given at command line. */
const char *marker_back_help; /**< @brief define marker range help description. */
int movie_flag; /**< @brief start up in movie mode (default=off). */
const char *movie_help; /**< @brief start up in movie mode help description. */
int cycles_arg; /**< @brief cycles for movie mode. */
char * cycles_orig; /**< @brief cycles for movie mode original value given at command line. */
const char *cycles_help; /**< @brief cycles for movie mode help description. */
float spinning_arg; /**< @brief spinning for movie mode. */
char * spinning_orig; /**< @brief spinning for movie mode original value given at command line. */
const char *spinning_help; /**< @brief spinning for movie mode help description. */
int smooth_mouse_flag; /**< @brief smooth movement (default=off). */
const char *smooth_mouse_help; /**< @brief smooth movement help description. */
int parent_pid_arg; /**< @brief PID of parent. */
char * parent_pid_orig; /**< @brief PID of parent original value given at command line. */
const char *parent_pid_help; /**< @brief PID of parent help description. */
int compression_flag; /**< @brief Use texture map compression (default=off). */
const char *compression_help; /**< @brief Use texture map compression help description. */
int no_compression_flag; /**< @brief Dont use texture map compression (default=off). */
const char *no_compression_help; /**< @brief Dont use texture map compression help description. */
int offscreen_flag; /**< @brief Offscreen with GLX (default=off). */
const char *offscreen_help; /**< @brief Offscreen with GLX help description. */
int osmesa_flag; /**< @brief Offscreen with Mesa (default=off). */
const char *osmesa_help; /**< @brief Offscreen with Mesa help description. */
char * os_outfile_arg; /**< @brief outfile for offscreen rendering. */
char * os_outfile_orig; /**< @brief outfile for offscreen rendering original value given at command line. */
const char *os_outfile_help; /**< @brief outfile for offscreen rendering help description. */
int jpeg_quality_arg; /**< @brief Quality (0-100) of jpeg output. */
char * jpeg_quality_orig; /**< @brief Quality (0-100) of jpeg output original value given at command line. */
const char *jpeg_quality_help; /**< @brief Quality (0-100) of jpeg output help description. */
char * image_format_arg; /**< @brief Image format for screenshots. */
char * image_format_orig; /**< @brief Image format for screenshots original value given at command line. */
const char *image_format_help; /**< @brief Image format for screenshots help description. */
char * save_path_arg; /**< @brief Path to save screenshots. */
char * save_path_orig; /**< @brief Path to save screenshots original value given at command line. */
const char *save_path_help; /**< @brief Path to save screenshots help description. */
char * basename_arg; /**< @brief Basename of screenshots. */
char * basename_orig; /**< @brief Basename of screenshots original value given at command line. */
const char *basename_help; /**< @brief Basename of screenshots help description. */
float clipping_far_arg; /**< @brief clipping far. */
char * clipping_far_orig; /**< @brief clipping far original value given at command line. */
const char *clipping_far_help; /**< @brief clipping far help description. */
float clipping_near_arg; /**< @brief clipping near. */
char * clipping_near_orig; /**< @brief clipping near original value given at command line. */
const char *clipping_near_help; /**< @brief clipping near help description. */
float init_lat_arg; /**< @brief set initial latitude. */
char * init_lat_orig; /**< @brief set initial latitude original value given at command line. */
const char *init_lat_help; /**< @brief set initial latitude help description. */
float init_lon_arg; /**< @brief set initial longitude. */
char * init_lon_orig; /**< @brief set initial longitude original value given at command line. */
const char *init_lon_help; /**< @brief set initial longitude help description. */
int init_alt_arg; /**< @brief set initial altitude. */
char * init_alt_orig; /**< @brief set initial altitude original value given at command line. */
const char *init_alt_help; /**< @brief set initial altitude help description. */
int init_heading_arg; /**< @brief set initial heading. */
char * init_heading_orig; /**< @brief set initial heading original value given at command line. */
const char *init_heading_help; /**< @brief set initial heading help description. */
int init_dive_arg; /**< @brief set initial dive angle. */
char * init_dive_orig; /**< @brief set initial dive angle original value given at command line. */
const char *init_dive_help; /**< @brief set initial dive angle help description. */
int init_pos_N_flag; /**< @brief set position North (default=off). */
const char *init_pos_N_help; /**< @brief set position North help description. */
int init_pos_E_flag; /**< @brief set position East (default=off). */
const char *init_pos_E_help; /**< @brief set position East help description. */
int init_pos_S_flag; /**< @brief set position South (default=off). */
const char *init_pos_S_help; /**< @brief set position South help description. */
int init_pos_W_flag; /**< @brief set position West (default=off). */
const char *init_pos_W_help; /**< @brief set position West help description. */
int init_pos_NE_flag; /**< @brief set position NE (default=off). */
const char *init_pos_NE_help; /**< @brief set position NE help description. */
int init_pos_SE_flag; /**< @brief set position SE (default=off). */
const char *init_pos_SE_help; /**< @brief set position SE help description. */
int init_pos_SW_flag; /**< @brief set position SW (default=off). */
const char *init_pos_SW_help; /**< @brief set position SW help description. */
int init_pos_NW_flag; /**< @brief set position NW (default=off). */
const char *init_pos_NW_help; /**< @brief set position NW help description. */
int init_pos_center_flag; /**< @brief set position center (default=off). */
const char *init_pos_center_help; /**< @brief set position center help description. */
float init_ortho_lat_arg; /**< @brief set initial latitude for ortho mode. */
char * init_ortho_lat_orig; /**< @brief set initial latitude for ortho mode original value given at command line. */
const char *init_ortho_lat_help; /**< @brief set initial latitude for ortho mode help description. */
float init_ortho_lon_arg; /**< @brief set initial longitude for ortho mode. */
char * init_ortho_lon_orig; /**< @brief set initial longitude for ortho mode original value given at command line. */
const char *init_ortho_lon_help; /**< @brief set initial longitude for ortho mode help description. */
float init_ortho_width_arg; /**< @brief set initial ortho-view width [km]. */
char * init_ortho_width_orig; /**< @brief set initial ortho-view width [km] original value given at command line. */
const char *init_ortho_width_help; /**< @brief set initial ortho-view width [km] help description. */
int projection_cyl_platt_flag; /**< @brief set platt projection (default=off). */
const char *projection_cyl_platt_help; /**< @brief set platt projection help description. */
int projection_cyl_no1_flag; /**< @brief set cylindric projection 1 (default=off). */
const char *projection_cyl_no1_help; /**< @brief set cylindric projection 1 help description. */
int projection_pseudo_cyl_no1_flag; /**< @brief set pseudocylindric projection 1 (default=off). */
const char *projection_pseudo_cyl_no1_help; /**< @brief set pseudocylindric projection 1 help description. */
int projection_cyl_mercator_flag; /**< @brief set mercator projection (default=off). */
const char *projection_cyl_mercator_help; /**< @brief set mercator projection help description. */
unsigned int help_given ; /**< @brief Whether help was given. */
unsigned int version_given ; /**< @brief Whether version was given. */
unsigned int verbose_given ; /**< @brief Whether verbose was given. */
unsigned int quiet_given ; /**< @brief Whether quiet was given. */
unsigned int query_gl_given ; /**< @brief Whether query-gl was given. */
unsigned int check_given ; /**< @brief Whether check was given. */
unsigned int compiler_given ; /**< @brief Whether compiler was given. */
unsigned int debug_given ; /**< @brief Whether debug was given. */
unsigned int igc_file_given ; /**< @brief Whether igc-file was given. */
unsigned int gpsd_given ; /**< @brief Whether gpsd was given. */
unsigned int gpsd_server_given ; /**< @brief Whether gpsd-server was given. */
unsigned int gpsd_port_given ; /**< @brief Whether gpsd-port was given. */
unsigned int gpsalt_given ; /**< @brief Whether gpsalt was given. */
unsigned int baroalt_given ; /**< @brief Whether baroalt was given. */
unsigned int use_all_fixes_given ; /**< @brief Whether use-all-fixes was given. */
unsigned int lat_given ; /**< @brief Whether lat was given. */
unsigned int lon_given ; /**< @brief Whether lon was given. */
unsigned int get_elevation_given ; /**< @brief Whether get-elevation was given. */
unsigned int config_file_given ; /**< @brief Whether config-file was given. */
unsigned int ortho_given ; /**< @brief Whether ortho was given. */
unsigned int perspective_given ; /**< @brief Whether perspective was given. */
unsigned int aov_given ; /**< @brief Whether aov was given. */
unsigned int landscape_given ; /**< @brief Whether landscape was given. */
unsigned int flat_given ; /**< @brief Whether flat was given. */
unsigned int map_given ; /**< @brief Whether map was given. */
unsigned int no_map_given ; /**< @brief Whether no-map was given. */
unsigned int map_set_name_given ; /**< @brief Whether map-set-name was given. */
unsigned int modulate_given ; /**< @brief Whether modulate was given. */
unsigned int no_modulate_given ; /**< @brief Whether no-modulate was given. */
unsigned int maps_unlighted_given ; /**< @brief Whether maps-unlighted was given. */
unsigned int maps_lighted_given ; /**< @brief Whether maps-lighted was given. */
unsigned int no_lighting_given ; /**< @brief Whether no-lighting was given. */
unsigned int terrain_shading_given ; /**< @brief Whether terrain-shading was given. */
unsigned int shading_scale_given ; /**< @brief Whether shading-scale was given. */
unsigned int light_direction_given ; /**< @brief Whether light-direction was given. */
unsigned int airspace_given ; /**< @brief Whether airspace was given. */
unsigned int airspace_wire_given ; /**< @brief Whether airspace-wire was given. */
unsigned int airspace_wire_col_r_given ; /**< @brief Whether airspace-wire-col-r was given. */
unsigned int airspace_wire_col_g_given ; /**< @brief Whether airspace-wire-col-g was given. */
unsigned int airspace_wire_col_b_given ; /**< @brief Whether airspace-wire-col-b was given. */
unsigned int airspace_wire_width_given ; /**< @brief Whether airspace-wire-width was given. */
unsigned int airspace_transparent_given ; /**< @brief Whether airspace-transparent was given. */
unsigned int no_airspace_given ; /**< @brief Whether no-airspace was given. */
unsigned int airspace_file_given ; /**< @brief Whether airspace-file was given. */
unsigned int airspace_limit_given ; /**< @brief Whether airspace-limit was given. */
unsigned int wire_given ; /**< @brief Whether wire was given. */
unsigned int filled_given ; /**< @brief Whether filled was given. */
unsigned int grayscale_given ; /**< @brief Whether grayscale was given. */
unsigned int color_given ; /**< @brief Whether color was given. */
unsigned int stereo_given ; /**< @brief Whether stereo was given. */
unsigned int no_stereo_given ; /**< @brief Whether no-stereo was given. */
unsigned int stereo_rg_given ; /**< @brief Whether stereo-rg was given. */
unsigned int no_stereo_rg_given ; /**< @brief Whether no-stereo-rg was given. */
unsigned int stereo_rb_given ; /**< @brief Whether stereo-rb was given. */
unsigned int no_stereo_rb_given ; /**< @brief Whether no-stereo-rb was given. */
unsigned int stereo_hw_given ; /**< @brief Whether stereo-hw was given. */
unsigned int no_stereo_hw_given ; /**< @brief Whether no-stereo-hw was given. */
unsigned int inverse_stereo_given ; /**< @brief Whether inverse-stereo was given. */
unsigned int no_inverse_stereo_given ; /**< @brief Whether no-inverse-stereo was given. */
unsigned int eye_dist_given ; /**< @brief Whether eye-dist was given. */
unsigned int flat_shading_given ; /**< @brief Whether flat-shading was given. */
unsigned int gouraud_shading_given ; /**< @brief Whether gouraud-shading was given. */
unsigned int quads_given ; /**< @brief Whether quads was given. */
unsigned int curtain_given ; /**< @brief Whether curtain was given. */
unsigned int no_curtain_given ; /**< @brief Whether no-curtain was given. */
unsigned int haze_given ; /**< @brief Whether haze was given. */
unsigned int no_haze_given ; /**< @brief Whether no-haze was given. */
unsigned int haze_density_given ; /**< @brief Whether haze-density was given. */
unsigned int colormap_given ; /**< @brief Whether colormap was given. */
unsigned int colormap_sea_given ; /**< @brief Whether colormap-sea was given. */
unsigned int colormap_min_given ; /**< @brief Whether colormap-min was given. */
unsigned int colormap_max_given ; /**< @brief Whether colormap-max was given. */
unsigned int sealevel_given ; /**< @brief Whether sealevel was given. */
unsigned int sealevel2_given ; /**< @brief Whether sealevel2 was given. */
unsigned int sealevel3_given ; /**< @brief Whether sealevel3 was given. */
unsigned int ignore_elev_min_given ; /**< @brief Whether ignore-elev-min was given. */
unsigned int ignore_elev_max_given ; /**< @brief Whether ignore-elev-max was given. */
unsigned int scalez_given ; /**< @brief Whether scalez was given. */
unsigned int downscaling_given ; /**< @brief Whether downscaling was given. */
unsigned int upscaling_given ; /**< @brief Whether upscaling was given. */
unsigned int fullscreen_given ; /**< @brief Whether fullscreen was given. */
unsigned int window_given ; /**< @brief Whether window was given. */
unsigned int width_given ; /**< @brief Whether width was given. */
unsigned int height_given ; /**< @brief Whether height was given. */
unsigned int border_given ; /**< @brief Whether border was given. */
unsigned int border_lat_given ; /**< @brief Whether border-lat was given. */
unsigned int border_lon_given ; /**< @brief Whether border-lon was given. */
unsigned int offset_given ; /**< @brief Whether offset was given. */
unsigned int airfield_elevation_given ; /**< @brief Whether airfield-elevation was given. */
unsigned int marker_pos_given ; /**< @brief Whether marker-pos was given. */
unsigned int marker_time_given ; /**< @brief Whether marker-time was given. */
unsigned int marker_given ; /**< @brief Whether marker was given. */
unsigned int marker_size_given ; /**< @brief Whether marker-size was given. */
unsigned int no_marker_given ; /**< @brief Whether no-marker was given. */
unsigned int info_given ; /**< @brief Whether info was given. */
unsigned int no_info_given ; /**< @brief Whether no-info was given. */
unsigned int text_given ; /**< @brief Whether text was given. */
unsigned int no_position_info_given ; /**< @brief Whether no-position-info was given. */
unsigned int no_marker_pos_info_given ; /**< @brief Whether no-marker-pos-info was given. */
unsigned int text_size_given ; /**< @brief Whether text-size was given. */
unsigned int text_width_given ; /**< @brief Whether text-width was given. */
unsigned int lifts_given ; /**< @brief Whether lifts was given. */
unsigned int lifts_info_mode_given ; /**< @brief Whether lifts-info-mode was given. */
unsigned int waypoints_file_given ; /**< @brief Whether waypoints-file was given. */
unsigned int waypoints_given ; /**< @brief Whether waypoints was given. */
unsigned int no_waypoints_given ; /**< @brief Whether no-waypoints was given. */
unsigned int waypoints_info_mode_given ; /**< @brief Whether waypoints-info-mode was given. */
unsigned int waypoints_offset_given ; /**< @brief Whether waypoints-offset was given. */
unsigned int waypoints_offset_spheres_given ; /**< @brief Whether waypoints-offset-spheres was given. */
unsigned int flighttrack_mode_given ; /**< @brief Whether flighttrack-mode was given. */
unsigned int flighttrack_colormap_given ; /**< @brief Whether flighttrack-colormap was given. */
unsigned int flighttrack_linewidth_given ; /**< @brief Whether flighttrack-linewidth was given. */
unsigned int follow_given ; /**< @brief Whether follow was given. */
unsigned int no_follow_given ; /**< @brief Whether no-follow was given. */
unsigned int marker_range_given ; /**< @brief Whether marker-range was given. */
unsigned int no_marker_range_given ; /**< @brief Whether no-marker-range was given. */
unsigned int marker_ahead_given ; /**< @brief Whether marker-ahead was given. */
unsigned int marker_back_given ; /**< @brief Whether marker-back was given. */
unsigned int movie_given ; /**< @brief Whether movie was given. */
unsigned int cycles_given ; /**< @brief Whether cycles was given. */
unsigned int spinning_given ; /**< @brief Whether spinning was given. */
unsigned int smooth_mouse_given ; /**< @brief Whether smooth-mouse was given. */
unsigned int parent_pid_given ; /**< @brief Whether parent-pid was given. */
unsigned int compression_given ; /**< @brief Whether compression was given. */
unsigned int no_compression_given ; /**< @brief Whether no-compression was given. */
unsigned int offscreen_given ; /**< @brief Whether offscreen was given. */
unsigned int osmesa_given ; /**< @brief Whether osmesa was given. */
unsigned int os_outfile_given ; /**< @brief Whether os-outfile was given. */
unsigned int jpeg_quality_given ; /**< @brief Whether jpeg-quality was given. */
unsigned int image_format_given ; /**< @brief Whether image-format was given. */
unsigned int save_path_given ; /**< @brief Whether save-path was given. */
unsigned int basename_given ; /**< @brief Whether basename was given. */
unsigned int clipping_far_given ; /**< @brief Whether clipping-far was given. */
unsigned int clipping_near_given ; /**< @brief Whether clipping-near was given. */
unsigned int init_lat_given ; /**< @brief Whether init-lat was given. */
unsigned int init_lon_given ; /**< @brief Whether init-lon was given. */
unsigned int init_alt_given ; /**< @brief Whether init-alt was given. */
unsigned int init_heading_given ; /**< @brief Whether init-heading was given. */
unsigned int init_dive_given ; /**< @brief Whether init-dive was given. */
unsigned int init_pos_N_given ; /**< @brief Whether init-pos-N was given. */
unsigned int init_pos_E_given ; /**< @brief Whether init-pos-E was given. */
unsigned int init_pos_S_given ; /**< @brief Whether init-pos-S was given. */
unsigned int init_pos_W_given ; /**< @brief Whether init-pos-W was given. */
unsigned int init_pos_NE_given ; /**< @brief Whether init-pos-NE was given. */
unsigned int init_pos_SE_given ; /**< @brief Whether init-pos-SE was given. */
unsigned int init_pos_SW_given ; /**< @brief Whether init-pos-SW was given. */
unsigned int init_pos_NW_given ; /**< @brief Whether init-pos-NW was given. */
unsigned int init_pos_center_given ; /**< @brief Whether init-pos-center was given. */
unsigned int init_ortho_lat_given ; /**< @brief Whether init-ortho-lat was given. */
unsigned int init_ortho_lon_given ; /**< @brief Whether init-ortho-lon was given. */
unsigned int init_ortho_width_given ; /**< @brief Whether init-ortho-width was given. */
unsigned int projection_cyl_platt_given ; /**< @brief Whether projection-cyl-platt was given. */
unsigned int projection_cyl_no1_given ; /**< @brief Whether projection-cyl-no1 was given. */
unsigned int projection_pseudo_cyl_no1_given ; /**< @brief Whether projection-pseudo-cyl-no1 was given. */
unsigned int projection_cyl_mercator_given ; /**< @brief Whether projection-cyl-mercator was given. */
} ;
/** @brief The additional parameters to pass to parser functions */
struct cmdline_parser_params
{
int override; /**< @brief whether to override possibly already present options (default 0) */
int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
int check_required; /**< @brief whether to check that all required options were provided (default 1) */
int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
} ;
/** @brief the purpose string of the program */
extern const char *gengetopt_args_info_purpose;
/** @brief the usage string of the program */
extern const char *gengetopt_args_info_usage;
/** @brief the description string of the program */
extern const char *gengetopt_args_info_description;
/** @brief all the lines making the help output */
extern const char *gengetopt_args_info_help[];
/**
* The command line parser
* @param argc the number of command line options
* @param argv the command line options
* @param args_info the structure where option information will be stored
* @return 0 if everything went fine, NON 0 if an error took place
*/
int cmdline_parser (int argc, char **argv,
struct gengetopt_args_info *args_info);
/**
* The command line parser (version with additional parameters - deprecated)
* @param argc the number of command line options
* @param argv the command line options
* @param args_info the structure where option information will be stored
* @param override whether to override possibly already present options
* @param initialize whether to initialize the option structure my_args_info
* @param check_required whether to check that all required options were provided
* @return 0 if everything went fine, NON 0 if an error took place
* @deprecated use cmdline_parser_ext() instead
*/
int cmdline_parser2 (int argc, char **argv,
struct gengetopt_args_info *args_info,
int override, int initialize, int check_required);
/**
* The command line parser (version with additional parameters)
* @param argc the number of command line options
* @param argv the command line options
* @param args_info the structure where option information will be stored
* @param params additional parameters for the parser
* @return 0 if everything went fine, NON 0 if an error took place
*/
int cmdline_parser_ext (int argc, char **argv,
struct gengetopt_args_info *args_info,
struct cmdline_parser_params *params);
/**
* Save the contents of the option struct into an already open FILE stream.
* @param outfile the stream where to dump options
* @param args_info the option struct to dump
* @return 0 if everything went fine, NON 0 if an error took place
*/
int cmdline_parser_dump(FILE *outfile,
struct gengetopt_args_info *args_info);
/**
* Save the contents of the option struct into a (text) file.
* This file can be read by the config file parser (if generated by gengetopt)
* @param filename the file where to save
* @param args_info the option struct to save
* @return 0 if everything went fine, NON 0 if an error took place
*/
int cmdline_parser_file_save(const char *filename,
struct gengetopt_args_info *args_info);
/**
* Print the help
*/
void cmdline_parser_print_help(void);
/**
* Print the version
*/
void cmdline_parser_print_version(void);
/**
* Initializes all the fields a cmdline_parser_params structure
* to their default values
* @param params the structure to initialize
*/
void cmdline_parser_params_init(struct cmdline_parser_params *params);
/**
* Allocates dynamically a cmdline_parser_params structure and initializes
* all its fields to their default values
* @return the created and initialized cmdline_parser_params structure
*/
struct cmdline_parser_params *cmdline_parser_params_create(void);
/**
* Initializes the passed gengetopt_args_info structure's fields
* (also set default values for options that have a default)
* @param args_info the structure to initialize
*/
void cmdline_parser_init (struct gengetopt_args_info *args_info);
/**
* Deallocates the string fields of the gengetopt_args_info structure
* (but does not deallocate the structure itself)
* @param args_info the structure to deallocate
*/
void cmdline_parser_free (struct gengetopt_args_info *args_info);
/**
* Checks that all the required options were specified
* @param args_info the structure to check
* @param prog_name the name of the program that will be used to print
* possible errors
* @return
*/
int cmdline_parser_required (struct gengetopt_args_info *args_info,
const char *prog_name);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CMDLINE_H */

466
src/createworlddem.cpp Normal file
View File

@ -0,0 +1,466 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
//const std::string rcsid_createworld_cpp =
// "$Id: createworlddem.cpp 3 2014-07-31 09:59:20Z kruegerh $";
using namespace std;
int main(void)
{
int i, j;
char tmp;
bool FAILED = false;
// set 1
//6,000 rows and 4,800 columns
ifstream w180n90;
ifstream w140n90;
ifstream w100n90;
ifstream w060n90;
ifstream w020n90;
ifstream e020n90;
ifstream e060n90;
ifstream e100n90;
ifstream e140n90;
// set 2
ifstream w180n40;
ifstream w140n40;
ifstream w100n40;
ifstream w060n40;
ifstream w020n40;
ifstream e020n40;
ifstream e060n40;
ifstream e100n40;
ifstream e140n40;
// set 3
ifstream w180s10;
ifstream w140s10;
ifstream w100s10;
ifstream w060s10;
ifstream w020s10;
ifstream e020s10;
ifstream e060s10;
ifstream e100s10;
ifstream e140s10;
// set 4
//3,600 rows and 7,200 columns
ifstream w180s60;
ifstream w120s60;
ifstream w060s60;
ifstream w000s60;
ifstream e060s60;
ifstream e120s60;
// whole world compiled
// 21,600 rows and 43,200 columns
ofstream world;
cout << "trying to open all needed files... " << endl;
w180n90.open("W180N90.DEM", ios::binary);
w140n90.open("W140N90.DEM", ios::binary);
w100n90.open("W100N90.DEM", ios::binary);
w060n90.open("W060N90.DEM", ios::binary);
w020n90.open("W020N90.DEM", ios::binary);
e020n90.open("E020N90.DEM", ios::binary);
e060n90.open("E060N90.DEM", ios::binary);
e100n90.open("E100N90.DEM", ios::binary);
e140n90.open("E140N90.DEM", ios::binary);
w180n40.open("W180N40.DEM", ios::binary);
w140n40.open("W140N40.DEM", ios::binary);
w100n40.open("W100N40.DEM", ios::binary);
w060n40.open("W060N40.DEM", ios::binary);
w020n40.open("W020N40.DEM", ios::binary);
e020n40.open("E020N40.DEM", ios::binary);
e060n40.open("E060N40.DEM", ios::binary);
e100n40.open("E100N40.DEM", ios::binary);
e140n40.open("E140N40.DEM", ios::binary);
w180s10.open("W180S10.DEM", ios::binary);
w140s10.open("W140S10.DEM", ios::binary);
w100s10.open("W100S10.DEM", ios::binary);
w060s10.open("W060S10.DEM", ios::binary);
w020s10.open("W020S10.DEM", ios::binary);
e020s10.open("E020S10.DEM", ios::binary);
e060s10.open("E060S10.DEM", ios::binary);
e100s10.open("E100S10.DEM", ios::binary);
e140s10.open("E140S10.DEM", ios::binary);
w180s60.open("W180S60.DEM", ios::binary);
w120s60.open("W120S60.DEM", ios::binary);
w060s60.open("W060S60.DEM", ios::binary);
w000s60.open("W000S60.DEM", ios::binary);
e060s60.open("E060S60.DEM", ios::binary);
e120s60.open("E120S60.DEM", ios::binary);
world.open("WORLD.DEM", ios::binary);
if (!w180n90)
FAILED = true;
if (!w140n90)
FAILED = true;
if (!w100n90)
FAILED = true;
if (!w060n90)
FAILED = true;
if (!w020n90)
FAILED = true;
if (!e020n90)
FAILED = true;
if (!e060n90)
FAILED = true;
if (!e100n90)
FAILED = true;
if (!e140n90)
FAILED = true;
if (!w180n40)
FAILED = true;
if (!w140n40)
FAILED = true;
if (!w100n40)
FAILED = true;
if (!w060n40)
FAILED = true;
if (!w020n40)
FAILED = true;
if (!e020n40)
FAILED = true;
if (!e060n40)
FAILED = true;
if (!e100n40)
FAILED = true;
if (!e140n40)
FAILED = true;
if (!w180s10)
FAILED = true;
if (!w140s10)
FAILED = true;
if (!w100s10)
FAILED = true;
if (!w060s10)
FAILED = true;
if (!w020s10)
FAILED = true;
if (!e020s10)
FAILED = true;
if (!e060s10)
FAILED = true;
if (!e100s10)
FAILED = true;
if (!e140s10)
FAILED = true;
if (!w180s60)
FAILED = true;
if (!w120s60)
FAILED = true;
if (!w060s60)
FAILED = true;
if (!w000s60)
FAILED = true;
if (!e060s60)
FAILED = true;
if (!e120s60)
FAILED = true;
if (FAILED) {
cerr << endl <<
"At least one of the GTOPO30 tiles is missing... merging failed"
<< endl;
exit(1);
}
if (!world) {
cerr << endl <<
"failed to open output file... merging failed" << endl;
exit(1);
}
cout << "OK" << endl;
for (i = 0; i < 6000; i++) { // all rows
cout << "Writing part 1 (of 4) " << 6000 -
i << " " << '\r' << flush;
for (j = 0; j < 4800; j++) { // all columns
tmp = w180n90.get();
world.put(tmp);
tmp = w180n90.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = w140n90.get();
world.put(tmp);
tmp = w140n90.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = w100n90.get();
world.put(tmp);
tmp = w100n90.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = w060n90.get();
world.put(tmp);
tmp = w060n90.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = w020n90.get();
world.put(tmp);
tmp = w020n90.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = e020n90.get();
world.put(tmp);
tmp = e020n90.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = e060n90.get();
world.put(tmp);
tmp = e060n90.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = e100n90.get();
world.put(tmp);
tmp = e100n90.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = e140n90.get();
world.put(tmp);
tmp = e140n90.get();
world.put(tmp);
}
if (!world) {
cerr << endl << "writing error occured!" << endl;
exit(1);
}
}
cout << endl;
for (i = 0; i < 6000; i++) { // all rows
cout << "Writing part 2 (of 4) " << 6000 -
i << " " << '\r' << flush;
for (j = 0; j < 4800; j++) { // all columns
tmp = w180n40.get();
world.put(tmp);
tmp = w180n40.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = w140n40.get();
world.put(tmp);
tmp = w140n40.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = w100n40.get();
world.put(tmp);
tmp = w100n40.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = w060n40.get();
world.put(tmp);
tmp = w060n40.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = w020n40.get();
world.put(tmp);
tmp = w020n40.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = e020n40.get();
world.put(tmp);
tmp = e020n40.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = e060n40.get();
world.put(tmp);
tmp = e060n40.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = e100n40.get();
world.put(tmp);
tmp = e100n40.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = e140n40.get();
world.put(tmp);
tmp = e140n40.get();
world.put(tmp);
}
if (!world) {
cerr << endl << "writing error occured!" << endl;
exit(1);
}
}
cout << endl;
for (i = 0; i < 6000; i++) { // all rows
cout << "Writing part 3 (of 4) " << 6000 -
i << " " << '\r' << flush;
for (j = 0; j < 4800; j++) { // all columns
tmp = w180s10.get();
world.put(tmp);
tmp = w180s10.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = w140s10.get();
world.put(tmp);
tmp = w140s10.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = w100s10.get();
world.put(tmp);
tmp = w100s10.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = w060s10.get();
world.put(tmp);
tmp = w060s10.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = w020s10.get();
world.put(tmp);
tmp = w020s10.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = e020s10.get();
world.put(tmp);
tmp = e020s10.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = e060s10.get();
world.put(tmp);
tmp = e060s10.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = e100s10.get();
world.put(tmp);
tmp = e100s10.get();
world.put(tmp);
}
for (j = 0; j < 4800; j++) { // all columns
tmp = e140s10.get();
world.put(tmp);
tmp = e140s10.get();
world.put(tmp);
}
if (!world) {
cerr << endl << "writing error occured!" << endl;
exit(1);
}
}
cout << endl;
for (i = 0; i < 3600; i++) { // all rows
cout << "Writing part 4 (of 4) " << 3600 -
i << " " << '\r' << flush;
for (j = 0; j < 7200; j++) { // all columns
tmp = w180s60.get();
world.put(tmp);
tmp = w180s60.get();
world.put(tmp);
}
for (j = 0; j < 7200; j++) { // all columns
tmp = w120s60.get();
world.put(tmp);
tmp = w120s60.get();
world.put(tmp);
}
for (j = 0; j < 7200; j++) { // all columns
tmp = w060s60.get();
world.put(tmp);
tmp = w060s60.get();
world.put(tmp);
}
for (j = 0; j < 7200; j++) { // all columns
tmp = w000s60.get();
world.put(tmp);
tmp = w000s60.get();
world.put(tmp);
}
for (j = 0; j < 7200; j++) { // all columns
tmp = e060s60.get();
world.put(tmp);
tmp = e060s60.get();
world.put(tmp);
}
for (j = 0; j < 7200; j++) { // all columns
tmp = e120s60.get();
world.put(tmp);
tmp = e120s60.get();
world.put(tmp);
}
if (!world) {
cerr << endl << "writing error occured!" << endl;
exit(1);
}
}
cout << endl << "finished." << endl;
}

256
src/ego.cpp Normal file
View File

@ -0,0 +1,256 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
#include "ego.h"
#include "GLexplorer.h"
#include <cmath>
#include <string>
//const std::string rcsid_ego_cpp =
// "$Id: ego.cpp 3 2014-07-31 09:59:20Z kruegerh $";
//const std::string rcsid_ego_h = EGO_H;
Ego::Ego(double _x, double _y, double _z, double _spinx, double _spiny,
double _spinz)
{
pos[0] = _x;
pos[1] = _y;
pos[2] = _z;
spin[0] = _spinx;
spin[1] = _spiny;
spin[2] = _spinz;
dpos[0] = 0;
dpos[1] = 0;
dpos[2] = 0;
dorthopos[0]=0;
dorthopos[1]=0;
dorthopos[2]=0;
orthopos[0] = 0;
orthopos[1] = 0;
orthopos[2] = 100;
}
void
Ego::spinmoveradial(double _spinmoveradial)
// This spins the ego around the centre of the view plane
// while adjusting the view angle appropriately
// Once this is working we can try spinning around the place we are looking at.
{
double tmp;
tmp = pos[0];
pos[0] =
pos[0] * cos(_spinmoveradial * PI_180) +
pos[1] * sin(_spinmoveradial * PI_180);
pos[1] =
pos[1] * cos(_spinmoveradial * PI_180) -
tmp * sin(_spinmoveradial * PI_180);
spin[2] = spin[2] + _spinmoveradial;
if (spin[2] < 0.0)
spin[2] = spin[2] + 360.0;
if (spin[2] > 360.0)
spin[2] = spin[2] - 360.0;
}
void
Ego::spinmoveradialpoint(double _spinmoveradial, double x, double y)
// This spins the ego around point (x,y)
// while adjusting the view angle appropriately
{
double tmp0, tmp1;
tmp0 = pos[0] + x;
tmp1 = pos[1] + y;
pos[0] =
tmp0 * cos(_spinmoveradial * PI_180) +
tmp1 * sin(_spinmoveradial * PI_180) -
x;
pos[1] =
tmp1 * cos(_spinmoveradial * PI_180) -
tmp0 * sin(_spinmoveradial * PI_180) -
y;
spin[2] = spin[2] + _spinmoveradial;
if (spin[2] < 0.0)
spin[2] = spin[2] + 360.0;
if (spin[2] > 360.0)
spin[2] = spin[2] - 360.0;
}
void Ego::spinmovevertical(double _spinmovevertical)
// Spin the ego position up/down around centre of view plane
{/*
double radial, radialnew, tmp;
tmp = pos[2];
radial = sqrt(pow(pos[0], 2) + pow(pos[1], 2));
// avoid weird robotic moronness ;-) Restrict to 80 deg azimuth
if ((_spinmovevertical > 0 && atan2(pos[2], radial) > 80 * PI_180)
|| (_spinmovevertical < 0
&& atan2(pos[2], radial) < 1 * PI_180)) {
return;
}
pos[2] =
pos[2] * cos(_spinmovevertical * PI_180) +
radial * sin(_spinmovevertical * PI_180);
radialnew =
radial * cos(_spinmovevertical * PI_180) -
tmp * sin(_spinmovevertical * PI_180);
pos[0] = pos[0] * radialnew / radial;
pos[1] = pos[1] * radialnew / radial;
tmp = spin[0];
spin[0] =
spin[0] +
_spinmovevertical *
cos(atan2(spin[1] * PI_180, spin[0] * PI_180));
if (spin[0] < 0.0)
spin[0] = spin[0] + 360.0;
if (spin[0] > 360.0)
spin[0] = spin[0] - 360.0;
spin[1] =
spin[1] +
_spinmovevertical * sin(atan2(spin[1] * PI_180, tmp * PI_180));
if (spin[1] < 0.0)
spin[1] = spin[1] + 360.0;
if (spin[1] > 360.0)
spin[1] = spin[1] - 360.0;
*/
spinmoveverticalpoint(_spinmovevertical, 0, 0);
}
void Ego::spinmoveverticalpoint(double _spinmovevertical, double x, double y) //, double z)
// Spin the ego position up/down around a point (x, y, z)
{
double radial, radialnew, tmp2;
tmp2 = pos[2];
radial = sqrt(pow(pos[0] + x, 2) + pow(pos[1] + y, 2));
// avoid weird robotic moronness ;-) Restrict to 80 deg azimuth
if ((_spinmovevertical > 0 && atan2(pos[2], radial) > 80 * PI_180)
|| (_spinmovevertical < 0
&& atan2(pos[2], radial) < 1 * PI_180)) {
return;
}
pos[2] =
pos[2] * cos(_spinmovevertical * PI_180) +
radial * sin(_spinmovevertical * PI_180);
radialnew =
radial * cos(_spinmovevertical * PI_180) -
tmp2 * sin(_spinmovevertical * PI_180);
pos[0] = ( (pos[0] + x) * radialnew / radial ) - x;
pos[1] = ( (pos[1] + y) * radialnew / radial ) - y;
tmp2 = spin[0];
spin[0] =
spin[0] +
_spinmovevertical *
cos(atan2(spin[1] * PI_180, spin[0] * PI_180));
if (spin[0] < 0.0)
spin[0] = spin[0] + 360.0;
if (spin[0] > 360.0)
spin[0] = spin[0] - 360.0;
spin[1] =
spin[1] +
_spinmovevertical * sin(atan2(spin[1] * PI_180, tmp2 * PI_180));
if (spin[1] < 0.0)
spin[1] = spin[1] + 360.0;
if (spin[1] > 360.0)
spin[1] = spin[1] - 360.0;
}
void Ego::spinx(double _spinx)
{
spin[0] = spin[0] + _spinx;
if (spin[0] < 0.0)
spin[0] = spin[0] + 360.0;
if (spin[0] > 360.0)
spin[0] = spin[0] - 360.0;
}
void Ego::spiny(double _spiny)
{
spin[1] = spin[1] + _spiny;
if (spin[1] < 0.0)
spin[1] = spin[1] + 360.0;
if (spin[1] > 360.0)
spin[1] = spin[1] - 360.0;
}
void Ego::spinz(double _spinz)
{
spin[2] = spin[2] + _spinz;
if (spin[2] < 0.0)
spin[2] = spin[2] + 360.0;
if (spin[2] > 360.0)
spin[2] = spin[2] - 360.0;
}
void Ego::movex(double _move)
{
pos[0] = pos[0] + _move;
}
void Ego::movey(double _move)
{
pos[1] = pos[1] + _move;
}
void Ego::movez(double _move)
{
pos[2] = pos[2] + _move;
}
void Ego::movef(double _move)
{
double _move_horizontal;
pos[2] = pos[2] - _move * sin((270.0 - spin[0]) * PI_180);
_move_horizontal = _move * cos((270.0 - spin[0]) * PI_180);
pos[0] = pos[0] + _move_horizontal * sin(PI_180 * spin[2]);
pos[1] = pos[1] + _move_horizontal * cos(PI_180 * spin[2]);
}
void Ego::moves(double _move)
{
pos[0] = pos[0] + _move * sin(PI_180 * (spin[2] + 90.0));
pos[1] = pos[1] + _move * cos(PI_180 * (spin[2] + 90.0));
}
void Ego::moveu(double _move)
{
double _move_horizontal;
pos[2] = pos[2] + _move * sin((spin[0] - 180.0) * PI_180);
_move_horizontal = _move * cos((spin[0] - 180.0) * PI_180);
pos[0] = pos[0] + _move_horizontal * sin(PI_180 * spin[2]);
pos[1] = pos[1] + _move_horizontal * cos(PI_180 * spin[2]);
}

92
src/ego.h Normal file
View File

@ -0,0 +1,92 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*/
/*
DESCRIPTION:
small class to track a position in cartesian coordinatesystem and to move/rotate
*/
#ifndef EGO_H
#define EGO_H 1
#include<string>
class Ego {
public:
Ego (double _x, double _y, double _z, double _spinx, double _spiny, double _spinz);
double getx () const { return pos[0]; }
double gety () const {return pos[1]; }
double getz () const {return pos[2]; }
void setz (double _z) {pos[2] = _z;}
void setx (double _x) {pos[0] = _x;}
void sety (double _y) {pos[1] = _y;}
double getOx() const {return orthopos[0];}
double getOy() const {return orthopos[1];}
double getOz() const {return orthopos[2];}
void setOx(double _x) {orthopos[0]=_x;}
void setOy(double _y) {orthopos[1]=_y;}
void setOz(double _z) {orthopos[2]=_z;}
void shiftx(double x) {orthopos[0] += x;}
void shifty(double y) {orthopos[1] += y;}
void shiftz(double z) {orthopos[2] += z;}
//diffrerence vector position for marker_locked_pos
double getdx () const { return dpos[0]; }
double getdy () const {return dpos[1]; }
double getdz () const {return dpos[2]; }
void setdz (double _z) {dpos[2] = _z;}
void setdx (double _x) {dpos[0] = _x;}
void setdy (double _y) {dpos[1] = _y;}
double getdox () const { return dorthopos[0]; }
double getdoy () const {return dorthopos[1]; }
double getdoz () const {return dorthopos[2]; }
void setdoz (double _z) {dorthopos[2] = _z;}
void setdox (double _x) {dorthopos[0] = _x;}
void setdoy (double _y) {dorthopos[1] = _y;}
double getspinx () const { return spin[0];}
double getspiny () const {return spin[1];}
double getspinz () const {return spin[2];}
void setspinx (double _sx) {spin[0] = _sx;}
void setspiny (double _sy) {spin[1] = _sy;}
void setspinz (double _sz) {spin[2] = _sz;}
void spinmoveradial (double); // spin the ego around the viewing plane
void spinmovevertical (double);
void spinmoveradialpoint (double, double, double); // spin the ego around a point
void spinmoveverticalpoint (double, double, double);
void spinx (double); // Spin is the direction we are looking in
void spiny (double);
void spinz (double);
void movex (double);
void movey (double);
void movez (double);
void movef (double); //move forward
void moves (double); //move sidewards
void moveu (double); //move up
protected:
double pos[3];
double dpos[3];
double spin[3];
double orthopos[3];
double dorthopos[3];
private:
Ego ();
};
#endif

384
src/etopo1merger.cpp Normal file
View File

@ -0,0 +1,384 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
/*
This program merges a WORLD.DEM (created with createworld from the GTOPO30-tiles)
and an etopo1.i2 into a WORLD3.DEM. (world3 is the new version with water-flag!)
(WORLD2 was without waterflag)
All files have 2 byte integer-values in big-endian order.
Another option is to prepare subsets of GTOPO30 WORLDx.DEM file
--latmax --latmin --lonmax --lonmin --out file
*/
#include <fstream>
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cstdlib>
//const double GTOPO30GRID = 0.00833333333333333;
//const double ETOPO2GRID = 0.03333333333333333;
const double GTOPO30GRID = 1.0/120.0;
const double ETOPO1GRID = 1.0/60.0;
using namespace std;
//const string rcsid_etopo1merger_cpp =
// "$Id: etopo1merger.cpp 3 2014-07-31 09:59:20Z kruegerh $";
short int etopo_array[10801][21601];
// This function uses bilinear interpolation to map values
// from etopo1 to gtopo30
short int getalt(double lat, double lon, int debug)
{
int steps_lat, steps_lon;
short int alt, h1, h2, h3, h4, max, min;
double lat_frac, lon_frac, tmp;
double dem_lon_min = -180.0;
double dem_lat_max = 90.0;
// Layout:
// h3 h4
// h1 h2
// lat_frac is the remaining fraction on the side h1 towards h3
// lon_frac is the remaining fraction on the side h1 towards h2
steps_lat = (int) (1.0 + (dem_lat_max - lat) / ETOPO1GRID);
steps_lon = (int) ((lon - dem_lon_min) / ETOPO1GRID);
lat_frac = -1.0 * (-steps_lat * ETOPO1GRID + dem_lat_max - lat) / ETOPO1GRID;
lon_frac = (-steps_lon * ETOPO1GRID - dem_lon_min + lon) / ETOPO1GRID;
h1 = etopo_array[steps_lat][steps_lon];
if(lat_frac < 0 || lon_frac < 0 || debug) printf("latfrac = %f, lonfrac = %f\n", lat_frac, lon_frac);
steps_lat = (int) (1.0 + (dem_lat_max - lat) / ETOPO1GRID);
steps_lon = (int) (1.0 + (lon - dem_lon_min) / ETOPO1GRID);
h2 = etopo_array[steps_lat][steps_lon];
steps_lat = (int) ((dem_lat_max - lat) / ETOPO1GRID);
steps_lon = (int) ((lon - dem_lon_min) / ETOPO1GRID);
h3 = etopo_array[steps_lat][steps_lon];
steps_lat = (int) ((dem_lat_max - lat) / ETOPO1GRID);
steps_lon = (int) (1.0 + (lon - dem_lon_min) / ETOPO1GRID);
h4 = etopo_array[steps_lat][steps_lon];
tmp = ((1.0 - lon_frac) * (1.0 - lat_frac) * (double) h1
+ lon_frac * (1.0 - lat_frac) * (double) h2
+ (1.0 - lon_frac) * lat_frac * (double) h3
+ lat_frac * lon_frac * (double) h4);
tmp = (double)((float) tmp); //This is in order to achieve identical results on x86_64 and i386
// Looks like Voodoo, but it can be understood: We are always sitting right on the fence
// rounding this way or that. If x86_64 works with different internal precision, then the
// rounding outcome in the cast operation (below) can go different ways...
if(tmp > 0.0){
alt = (short int) (0.5 + tmp);
} else {
alt = (short int) (-0.5 + tmp);
}
// Sanity checks
max = -10000;
min = 16000;
if(h1 > max) max = h1;
if(h2 > max) max = h2;
if(h3 > max) max = h3;
if(h4 > max) max = h4;
if(h1 < min) min = h1;
if(h2 < min) min = h2;
if(h3 < min) min = h3;
if(h4 < min) min = h4;
if(alt > max || alt < min || debug){
printf("Interpolation: h1 = %d, h2 = %d, h3 = %d, h4 = %d, alt = %d (%f), lat_frac = %f, lon_frac = %f\n",
h1, h2, h3, h4, alt, tmp,lat_frac, lon_frac);
// printf("%lf\n", tmp);
}
// end sanity checks
return alt;
}
void failed(void)
{
cout << "Some of the input files are missing, "
<< "or we are unable to write to the output file."
<< endl
<<
"The files WORLD.DEM should be in this directory. And for etopo1merging etopo1.i2!"
<< endl;
exit(1);
}
//---------------------------------------------
int main(int argc, char *argv[])
{
bool ETOPOMERGING = true;
double minlat, maxlat, minlon, maxlon;
string filename;
string source = "WORLD.DEM";
// parsing of options...
for (int i = 0; i < argc; i++) {
if (strcmp(argv[i], "--latmin") == 0)
sscanf(argv[i + 1], "%lf", &minlat);
if (strcmp(argv[i], "--lonmin") == 0)
sscanf(argv[i + 1], "%lf", &minlon);
if (strcmp(argv[i], "--latmax") == 0)
sscanf(argv[i + 1], "%lf", &maxlat);
if (strcmp(argv[i], "--lonmax") == 0)
sscanf(argv[i + 1], "%lf", &maxlon);
if (strcmp(argv[i], "--out") == 0) {
filename = argv[i + 1];
ETOPOMERGING=false;
}
if (strcmp(argv[i], "--source") == 0)
source = argv[i+1];
}
if (sizeof(short int) != 2) {
cerr << "sizeof(short int) " << sizeof(short int) << endl;
cerr << "Sorry, can't help you here. Use the source, Luke."
<< endl;
exit(1);
}
bool FAILED = false;
ifstream etopo1;
ifstream gtopo30;
ofstream world3;
ofstream subset;
if (ETOPOMERGING) {
cout << "Trying to read etopo1.i2 ... ";
etopo1.open("etopo1_ice_g_i2.bin", ios::binary);
if (!etopo1) {
cout << "failed." << endl;
FAILED = true;
} else {
cout << "ok." << endl;
}
}
cout << "trying to read " << source << " ... ";
gtopo30.open(source.c_str(), ios::binary);
if (!gtopo30) {
cout << "failed" << endl;
FAILED = true;
} else {
cout << "ok" << endl;
}
if (!ETOPOMERGING) {
cout << "Trying to open outputfile: " << filename << " ... ";
subset.open(filename.c_str(), ios::binary);
if (!subset) {
cout << "failed." << endl;
FAILED = true;
} else {
cout << "ok." << endl;
}
}
if (ETOPOMERGING) {
cout << "Trying to open WORLD3.DEM for writing... ";
world3.open("SRTM30_ETOPO1.DEM", ios::binary);
if (!world3) {
cout << "failed." << endl;
FAILED = true;
} else {
cout << "ok." << endl;
}
}
if (FAILED) failed();
int row, col;
short int alt;
int i1, i2;
int offset = 0;
// main part of etopo1merging -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------
// now read etopo into memory!
if (ETOPOMERGING) {
cout << "Reading etopo1 into RAM" << endl;
for (row = 0; row < 10801; row++) {
cout << (10801 - row) << " " << '\r' << flush;
for (col = 0; col < 21601; col++) {
i1 = etopo1.get();
i2 = etopo1.get();
etopo_array[row][col] = 256 * i2 + i1; //LSB first in etopo1!
}
}
cout << "Finished." << endl;
cout <<
"Merging and interpolating... (this may take a little time)" <<
endl;
for (row = 0; row < 21600; row++) {
cout << (21600 - row) << " " << '\r' << flush;
for (col = 0; col < 43200; col++) {
i1 = gtopo30.get();
i2 = gtopo30.get();
alt = 256 * i1 + i2;
if (alt == -9999) { // this is ocean surface, get bathymetry from etopo1
double lat = 90.0 - (GTOPO30GRID * row);
double lon = -180.0 + (GTOPO30GRID * col);
alt = getalt(lat, lon, 0);
// Sanity checks
//if(50473 == offset) {
// getalt(lat, lon, 1);
//// exit(1);
//}
// we should not loose the information, that this is covered by water!
// low areas might have negative elevations!
// the deepest place on earth is heigher than 16384 (2^14)
// so we will set the 2^14- bit to indicate water coverage
//I havent understand the bit-logic of negative short int..
// due to interpolation in the worse resolutioned
// model we might cat positive values :(
// they will be forced to 0
if (alt >= 0) alt =0;
alt -= 16384;
}
// split alt in big-endian 2 byte and write..
i2 = (short int) (alt & 255);
i1 = (short int) (alt & 65280) >> 8;
// Sanity checks
//if(50473 == offset) {
// printf("i1 = %d, i2 = %d\n", i1, i2);
//}
world3.put(i1);
if (!world3) {
cerr <<
"An error occured while writing the output file... (no disc space?)"
<< endl;
exit(1);
}
world3.put(i2);
if (!world3) {
cerr <<
"An error occured while writing the output file... (no disc space?)"
<< endl;
exit(1);
}
offset++;
}
}
}
// main part of subset creating .-------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------------------
if (!ETOPOMERGING) {
cout << "Subset of " << source << " will be created" << endl;
cout << "Selected limits:" << endl <<
"Max Lat: " << maxlat << endl <<
"Min Lat: " << minlat << endl <<
"Max Lon: " << maxlon << endl <<
"Min Lon: " << minlon << endl << endl;
double grid_lat = 1.0 /120.0;
double grid_lon = 1.0 / 120.0;
int downscalefactor = 1;
int upsteps = int (((90 - maxlat) / grid_lat)+0.5);
int downsteps = int (((90 - minlat) / grid_lat)+0.5);
int leftsteps = int (((minlon - (-180)) / grid_lon)+0.5);
int rightsteps = int (((maxlon - (-180)) / grid_lon)+0.5);
int colums_lon = 43200;
double DEM_LAT_MAX = 90.0 -(upsteps * grid_lat);
double DEM_LAT_MIN = 90.0 - (downsteps * grid_lat);
double DEM_LON_MAX = -180.0 + (rightsteps * grid_lon);
double DEM_LON_MIN = -180.0 + (leftsteps * grid_lon);
int steps_lat = downsteps - upsteps ; //+ 2 *downscalefactor;
int steps_lon = rightsteps - leftsteps; // + 2 * downscalefactor;
cout << filename << " will be: " << (steps_lat) * (steps_lon )*2 << " bytes." << endl << endl;
cout << "DEM_FILE " << filename << endl <<
"DEM_LAT_MAX " << DEM_LAT_MAX << endl <<
"DEM_LAT_MIN " << DEM_LAT_MIN << endl <<
"DEM_LON_MAX " << DEM_LON_MAX << endl <<
"DEM_LON_MIN " << DEM_LON_MIN << endl <<
"DEM_ROWS " << steps_lat << endl <<
"DEM_COLUMNS " << steps_lon << endl;
int counter = steps_lat;
for (int zeile = 0; zeile < steps_lat; zeile += downscalefactor) {
cout << counter-- << " " << '\r' << flush;
for (int spalte = 0; spalte < steps_lon; spalte += downscalefactor) {
// fuer 1 byte daten kommentiert ///* */ !?
///*
int verschieber =
(colums_lon * upsteps + zeile * colums_lon +
leftsteps + spalte) * 2;
//*/
/*
int
verschieber = (colums_lon * upsteps + zeile * colums_lon + leftsteps + spalte);
*/
//cout << "vershieber : " << verschieber << endl;
gtopo30.seekg(verschieber, ios::beg);
///*
int i1 = gtopo30.get();
//*/
int i2 = gtopo30.get();
subset.put(i1);
subset.put(i2);
}
}
}
cout << "Finished. Please check the output file." << endl;
}

383
src/etopo2merger.cpp Normal file
View File

@ -0,0 +1,383 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
/*
This program merges a WORLD.DEM (created with createworld from the GTOPO30-tiles)
and an etopo2.i2 into a WORLD3.DEM. (world3 is the new version with water-flag!)
(WORLD2 was without waterflag)
All files have 2 byte integer-values in big-endian order.
Another option is to prepare subsets of GTOPO30 WORLDx.DEM file
--latmax --latmin --lonmax --lonmin --out file
*/
#include <fstream>
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cstdlib>
//const double GTOPO30GRID = 0.00833333333333333;
//const double ETOPO2GRID = 0.03333333333333333;
const double GTOPO30GRID = 1.0/120.0;
const double ETOPO2GRID = 1.0/30.0;
using namespace std;
//const string rcsid_etopo2merger_cpp =
// "$Id: etopo2merger.cpp 3 2014-07-31 09:59:20Z kruegerh $";
short int etopo_array[5401][10801];
// This function uses bilinear interpolation to map values
// from etopo2 to gtopo30
short int getalt(double lat, double lon, int debug)
{
int steps_lat, steps_lon;
short int alt, h1, h2, h3, h4, max, min;
double lat_frac, lon_frac, tmp;
double dem_lon_min = -180.0;
double dem_lat_max = 90.0;
// Layout:
// h3 h4
// h1 h2
// lat_frac is the remaining fraction on the side h1 towards h3
// lon_frac is the remaining fraction on the side h1 towards h2
steps_lat = (int) (1.0 + (dem_lat_max - lat) / ETOPO2GRID);
steps_lon = (int) ((lon - dem_lon_min) / ETOPO2GRID);
lat_frac = -1.0 * (-steps_lat * ETOPO2GRID + dem_lat_max - lat) / ETOPO2GRID;
lon_frac = (-steps_lon * ETOPO2GRID - dem_lon_min + lon) / ETOPO2GRID;
h1 = etopo_array[steps_lat][steps_lon];
if(lat_frac < 0 || lon_frac < 0 || debug) printf("latfrac = %f, lonfrac = %f\n", lat_frac, lon_frac);
steps_lat = (int) (1.0 + (dem_lat_max - lat) / ETOPO2GRID);
steps_lon = (int) (1.0 + (lon - dem_lon_min) / ETOPO2GRID);
h2 = etopo_array[steps_lat][steps_lon];
steps_lat = (int) ((dem_lat_max - lat) / ETOPO2GRID);
steps_lon = (int) ((lon - dem_lon_min) / ETOPO2GRID);
h3 = etopo_array[steps_lat][steps_lon];
steps_lat = (int) ((dem_lat_max - lat) / ETOPO2GRID);
steps_lon = (int) (1.0 + (lon - dem_lon_min) / ETOPO2GRID);
h4 = etopo_array[steps_lat][steps_lon];
tmp = ((1.0 - lon_frac) * (1.0 - lat_frac) * (double) h1
+ lon_frac * (1.0 - lat_frac) * (double) h2
+ (1.0 - lon_frac) * lat_frac * (double) h3
+ lat_frac * lon_frac * (double) h4);
tmp = (double)((float) tmp); //This is in order to achieve identical results on x86_64 and i386
// Looks like Voodoo, but it can be understood: We are always sitting right on the fence
// rounding this way or that. If x86_64 works with different internal precision, then the
// rounding outcome in the cast operation (below) can go different ways...
if(tmp > 0.0){
alt = (short int) (0.5 + tmp);
} else {
alt = (short int) (-0.5 + tmp);
}
// Sanity checks
max = -10000;
min = 16000;
if(h1 > max) max = h1;
if(h2 > max) max = h2;
if(h3 > max) max = h3;
if(h4 > max) max = h4;
if(h1 < min) min = h1;
if(h2 < min) min = h2;
if(h3 < min) min = h3;
if(h4 < min) min = h4;
if(alt > max || alt < min || debug){
printf("Interpolation: h1 = %d, h2 = %d, h3 = %d, h4 = %d, alt = %d (%f), lat_frac = %f, lon_frac = %f\n",
h1, h2, h3, h4, alt, tmp, lat_frac, lon_frac);
}
// end sanity checks
return alt;
}
void failed(void)
{
cout << "Some of the input files are missing, "
<< "or we are unable to write to the output file."
<< endl
<<
"The files WORLD.DEM should be in this directory. And for etopo2merging etopo2.i2!"
<< endl;
exit(1);
}
//---------------------------------------------
int main(int argc, char *argv[])
{
bool ETOPOMERGING = true;
double minlat, maxlat, minlon, maxlon;
string filename;
string source = "WORLD.DEM";
// parsing of options...
for (int i = 0; i < argc; i++) {
if (strcmp(argv[i], "--latmin") == 0)
sscanf(argv[i + 1], "%lf", &minlat);
if (strcmp(argv[i], "--lonmin") == 0)
sscanf(argv[i + 1], "%lf", &minlon);
if (strcmp(argv[i], "--latmax") == 0)
sscanf(argv[i + 1], "%lf", &maxlat);
if (strcmp(argv[i], "--lonmax") == 0)
sscanf(argv[i + 1], "%lf", &maxlon);
if (strcmp(argv[i], "--out") == 0) {
filename = argv[i + 1];
ETOPOMERGING=false;
}
if (strcmp(argv[i], "--source") == 0)
source = argv[i+1];
}
if (sizeof(short int) != 2) {
cerr << "sizeof(short int) " << sizeof(short int) << endl;
cerr << "Sorry, can't help you here. Use the source, Luke."
<< endl;
exit(1);
}
bool FAILED = false;
ifstream etopo2;
ifstream gtopo30;
ofstream world3;
ofstream subset;
if (ETOPOMERGING) {
cout << "Trying to read etopo2.i2 ... ";
etopo2.open("etopo2.i2", ios::binary);
if (!etopo2) {
cout << "failed." << endl;
FAILED = true;
} else {
cout << "ok." << endl;
}
}
cout << "trying to read " << source << " ... ";
gtopo30.open(source.c_str(), ios::binary);
if (!gtopo30) {
cout << "failed" << endl;
FAILED = true;
} else {
cout << "ok" << endl;
}
if (!ETOPOMERGING) {
cout << "Trying to open outputfile: " << filename << " ... ";
subset.open(filename.c_str(), ios::binary);
if (!subset) {
cout << "failed." << endl;
FAILED = true;
} else {
cout << "ok." << endl;
}
}
if (ETOPOMERGING) {
cout << "Trying to open WORLD3.DEM for writing... ";
world3.open("WORLD3.DEM", ios::binary);
if (!world3) {
cout << "failed." << endl;
FAILED = true;
} else {
cout << "ok." << endl;
}
}
if (FAILED) failed();
int row, col;
short int alt;
int i1, i2;
int offset = 0;
// main part of etopo2merging -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------
// now read etopo into memory!
if (ETOPOMERGING) {
cout << "Reading etopo2 into RAM" << endl;
for (row = 0; row < 5401; row++) {
cout << (5401 - row) << " " << '\r' << flush;
for (col = 0; col < 10801; col++) {
i1 = etopo2.get();
i2 = etopo2.get();
etopo_array[row][col] = 256 * i1 + i2;
}
}
cout << "Finished." << endl;
cout <<
"Merging and interpolating... (this may take a little time)" <<
endl;
for (row = 0; row < 21600; row++) {
cout << (21600 - row) << " " << '\r' << flush;
for (col = 0; col < 43200; col++) {
i1 = gtopo30.get();
i2 = gtopo30.get();
alt = 256 * i1 + i2;
if (alt == -9999) { // this is ocean surface, get bathymetry from etopo2
double lat = 90.0 - (GTOPO30GRID * row);
double lon = -180.0 + (GTOPO30GRID * col);
alt = getalt(lat, lon, 0);
// Sanity checks
//if(50473 == offset) {
// getalt(lat, lon, 1);
//// exit(1);
//}
// we should not loose the information, that this is covered by water!
// low areas might have negative elevations!
// the deepest place on earth is heigher than 16384 (2^14)
// so we will set the 2^14- bit to indicate water coverage
//I havent understand the bit-logic of negative short int..
// due to interpolation in the worse resolutioned
// model we might cat positive values :(
// they will be forced to 0
if (alt >= 0) alt =0;
alt -= 16384;
}
// split alt in big-endian 2 byte and write..
i2 = (short int) (alt & 255);
i1 = (short int) (alt & 65280) >> 8;
// Sanity checks
//if(50473 == offset) {
// printf("i1 = %d, i2 = %d\n", i1, i2);
//}
world3.put(i1);
if (!world3) {
cerr <<
"An error occured while writing the output file... (no disc space?)"
<< endl;
exit(1);
}
world3.put(i2);
if (!world3) {
cerr <<
"An error occured while writing the output file... (no disc space?)"
<< endl;
exit(1);
}
offset++;
}
}
}
// main part of subset creating .-------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------------------
if (!ETOPOMERGING) {
cout << "Subset of " << source << " will be created" << endl;
cout << "Selected limits:" << endl <<
"Max Lat: " << maxlat << endl <<
"Min Lat: " << minlat << endl <<
"Max Lon: " << maxlon << endl <<
"Min Lon: " << minlon << endl << endl;
double grid_lat = 1.0 /120.0;
double grid_lon = 1.0 / 120.0;
int downscalefactor = 1;
int upsteps = int (((90 - maxlat) / grid_lat)+0.5);
int downsteps = int (((90 - minlat) / grid_lat)+0.5);
int leftsteps = int (((minlon - (-180)) / grid_lon)+0.5);
int rightsteps = int (((maxlon - (-180)) / grid_lon)+0.5);
int colums_lon = 43200;
double DEM_LAT_MAX = 90.0 -(upsteps * grid_lat);
double DEM_LAT_MIN = 90.0 - (downsteps * grid_lat);
double DEM_LON_MAX = -180.0 + (rightsteps * grid_lon);
double DEM_LON_MIN = -180.0 + (leftsteps * grid_lon);
int steps_lat = downsteps - upsteps ; //+ 2 *downscalefactor;
int steps_lon = rightsteps - leftsteps; // + 2 * downscalefactor;
cout << filename << " will be: " << (steps_lat) * (steps_lon )*2 << " bytes." << endl << endl;
cout << "DEM_FILE " << filename << endl <<
"DEM_LAT_MAX " << DEM_LAT_MAX << endl <<
"DEM_LAT_MIN " << DEM_LAT_MIN << endl <<
"DEM_LON_MAX " << DEM_LON_MAX << endl <<
"DEM_LON_MIN " << DEM_LON_MIN << endl <<
"DEM_ROWS " << steps_lat << endl <<
"DEM_COLUMNS " << steps_lon << endl;
int counter = steps_lat;
for (int zeile = 0; zeile < steps_lat; zeile += downscalefactor) {
cout << counter-- << " " << '\r' << flush;
for (int spalte = 0; spalte < steps_lon; spalte += downscalefactor) {
// fuer 1 byte daten kommentiert ///* */ !?
///*
int verschieber =
(colums_lon * upsteps + zeile * colums_lon +
leftsteps + spalte) * 2;
//*/
/*
int
verschieber = (colums_lon * upsteps + zeile * colums_lon + leftsteps + spalte);
*/
//cout << "vershieber : " << verschieber << endl;
gtopo30.seekg(verschieber, ios::beg);
///*
int i1 = gtopo30.get();
//*/
int i2 = gtopo30.get();
subset.put(i1);
subset.put(i2);
}
}
}
cout << "Finished. Please check the output file." << endl;
}

1581
src/flightdata.cpp Normal file

File diff suppressed because it is too large Load Diff

236
src/flightdata.h Normal file
View File

@ -0,0 +1,236 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*/
#ifndef FLIGHTDATA_H
#define FLIGHTDATA_H 1
#include <vector>
#include <string>
#include <sstream>
#ifndef __OSX__
#include <GL/gl.h>
#else
#include <OpenGL/gl.h>
#endif
#include "oconfig.h"
#include "oglexfunc.h"
#include "projection.h"
#include "config.h"
#ifdef HAVE_LIBGPS
#include "libgpsmm.h"
#else
#define DEFAULT_GPSD_PORT "2497"
#endif
class Flightdata {
public:
Flightdata();
~Flightdata();
int readIGCFile (string, bool USE_V=false); //read igc datafile
void initgps(const char* gpsdserver="localhost", const char* port=DEFAULT_GPSD_PORT);
string serverstring;
void readGNDElevation (Config * _config) {get_gnd_elevations(&gnd_elevation, &lat, &lon, _config);}
double getx (int _i) const {return x[_i];}
double gety (int _i) const {return y[_i];}
double getz (int _i) const {return z[_i];}
double getmarkerx () const {return (n!=0) ? x[marker_pos] : 0;}
double getmarkery () const {return (n!=0) ? y[marker_pos] : 0;}
double getmarkerz () const {return (n!=0) ? z[marker_pos] : 0;}
void set_proj_pointer(Projection *p) { proj_pointer = p;}
void set_conf_pointer(Config *c) { conf_pointer = c;}
int querygps(void);
void usegps(void);
int getstartelevation(bool GPS);
double getxcenter () const {return xcenter;}
void setxcenter(double x) {xcenter =x;}
double getycenter () const {return ycenter;}
void setycenter(double y) {ycenter =y;}
double getzcenter () const {return zcenter;}
void setzcenter(double z) {zcenter =z;}
double getxmax () const {return xmax;}
void setxmax(double x) {xmax =x;}
double getxmin () const {return xmin; }
void setxmin(double x) {xmin =x;}
double getymax () const {return ymax;}
void setymax(double y) {ymax =y;}
double getymin () const {return ymin;}
void setymin(double y) {ymin =y;}
double getzmax () const {return zmax; }
void setzmax(double z) {zmax =z;}
double getzmin () const {return zmin;}
void setzmin(double z) {zmin =z;}
double getcenter_lat () const {return center_lat;}
void setcenter_lat(double l) {center_lat =l;}
double getcenter_lon () const {return center_lon;}
void setcenter_lon(double l) {center_lon =l;}
double getlatmin () const {return latmin;}
void setlatmin(double l) {latmin =l;}
double getlatmax () const {return latmax;}
void setlatmax(double l) {latmax =l;}
double getlonmin () const {return lonmin;}
void setlonmin(double l) {lonmin =l;}
int getcycles () const {return cycles;}
void setcycles(int c) {cycles=c;}
double getlonmax () const {return lonmax;}
void setlonmax(double l) { lonmax =l;}
int getn () const {return n;}
void setglEvaluator (void);
int getmarker(void) const {return int(marker_pos);}
void setmarkerpos(int _pos);
void setmarkertime(string _time);
void forward_marker (void);
void fforward_marker(void);
void backward_marker(void);
void fbackward_marker(void);
void marker_head(void);
void draw_marker(int, float, bool);
void draw_marker_ortho(void);
//double getdectime(void) const {return dectime[marker_pos];}
string gettime(void) const {return time[marker_pos];}
double getalt(void) const {return alt[marker_pos];}
double getlat(void) const {return lat[marker_pos];}
double getlon(void) const {return lon[marker_pos];}
double getgpsalt(void) const {return gpsalt[marker_pos];}
int getgndelevation(void) const {return gnd_elevation[marker_pos];}
double getsatused (void) const {return satused[marker_pos];}
double getsatvis (void) const {return satvis[marker_pos];}
double getgpsmode (void) const {return gpsmode[marker_pos];}
int getgpsinterruptions(void) const {return gps_interruptions;}
int getvalidfix(void) const {return consecutive_valid_fixes;}
// estimated errors climb speed vertical horizontal
double getepc (void) const {return epc[marker_pos];}
double geteps (void) const {return eps[marker_pos];}
double getepv (void) const {return epv[marker_pos];}
double geteph (void) const {return eph[marker_pos];}
double getvario(void);
double getgpsvario(void);
double getintvario(int);
double getgpsintvario(int);
double getspeed(void);
void draw_linestrip(int _offset,bool BW, float _r_up ,float _g_up ,float _b_up ,float _r_down ,float _g_down, float _b_down);
// another draw linestrip...
void draw_curtain(int _offset, bool BW, float, float, float, float);
void draw_shadow(int _offset, bool BW, float _width, float _r = 0.0, float _g = 0.0, float _b = 0.0);
void draw_shadow_terrain(bool BW, float _width, float _r = 0.0, float _g = 0.0, float _b = 0.0);
protected:
int n; //number of data points
double xmin;
double xmax;
double xcenter;
double ymin;
double ymax;
double ycenter;
double zmin;
double zmax;
double zcenter;
double center_lat;
double center_lon;
double center_alt;
double center_gps;
double latmax;
double latmin;
double lonmax;
double lonmin;
double altmax;
double altmin;
double gpsmax;
double gpsmin;
vector < float > x; //km from center
vector < float > y;
vector < float > z; //height in km
vector < float > lat;
vector < float > lon;
vector < float > alt; //height in m
vector < float > gpsalt; // -"-
vector <int> gnd_elevation; // ground elevation at position
vector < float > dectime;
vector < string > time;
vector <int> satused;
vector <int> satvis;
vector <int> gpsmode;
int oldgpstime;
int consecutive_valid_fixes;
int gps_interruptions;
vector < float > speed;
vector < float > eps;
vector < float > vario;
vector < float > epc;
vector < float > epv;
vector < float > eph;
float speedmax;
float speedmin;
float variomax;
float variomin;
//name fdatafile
string filename;
Projection *proj_pointer; //the projection-class pointer
Config *conf_pointer; // config-pointer
int marker_pos;
int cycles;
#ifdef HAVE_LIBGPS
#if GPSD_API_MAJOR_VERSION == 5
gpsmm *gps; //("localhost", DEFAULT_GPSD_PORT);
struct gps_data_t *gpsdata;
// struct gps_fix_t *gpsfix;
#endif
#endif
};
#endif

1266
src/landscape.cpp Normal file

File diff suppressed because it is too large Load Diff

116
src/landscape.h Normal file
View File

@ -0,0 +1,116 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*/
#ifndef LANDSCAPE_H
#define LANDSCAPE_H 1
#include <string>
#include <vector>
#include "projection.h"
#include "oconfig.h"
inline int runden(double a){return ((int)(a + 0.5));}
class Landscape {
public:
int readDEM (string filename, int rows_lat, int colums_lon, double demlatmin,
double demlatmax, double demlonmin, double demlonmax, bool FAST = false);
Landscape();
~Landscape ();
void setgltrianglestrip (bool _WIRE, int _colmapnumber, int _colmapnr2, bool BW, bool _TEXMAP= false);
void setgltrianglestrip_tex (int _colmapnr, int _colmapnr2, bool BW);
void shadecolor (float*, int, int, int);
void setcenter_lat (double _lat) {center_lat = _lat;}
void setcenter_lon (double _lon) {center_lon = _lon;}
void setmin_lon (double _lon) {min_lon = _lon; }
void setmax_lon (double _lon) {max_lon = _lon;}
void setmin_lat (double _lat) {min_lat = _lat;}
void setmax_lat (double _lat) {max_lat = _lat;}
double getmin_lon (void) {return min_lon;}
double getmax_lon (void) {return max_lon;}
double getmin_lat (void) {return min_lat;}
double getmax_lat (void) {return max_lat;}
void setgrid_lat (double _lat) {grid_lat = _lat;}
void setgrid_lon (double _lon) {grid_lon = _lon; }
void setdownscalefactor(int _d) {downscalefactor=_d;}
// void setupscalefactor(int _up) {upscalefactor=_up;}
int getsteps_lat (void) const {return steps_lat;}
int getsteps_lon (void) const {return steps_lon; }
//int getnoftriangles (void);
short int getmax_h(void) const {return max_h;}
void setmax_h(int m) {max_h = m;}
short int getmin_h(void) const {return min_h;}
void setmin_h(int m) {min_h= m;}
void set_proj_pointer(Projection *p) { proj_pointer = p;}
void set_conf_pointer(Config *c) { conf_pointer = c;}
void set_sealevel(double sl) {sealevel = sl;}
void set_sealevel2(double sl) {sealevel2 = sl;}
void set_sealevel3(double sl) {sealevel3 = sl;}
protected:
bool CLEARFLAG;
bool CLEARFLAG_SURFACE;
void getlandcolor(float *, short int, int );
double center_lat;
double center_lon;
// borders for the piece of terrain to be displayed
double min_lon;
double max_lon;
double min_lat;
double max_lat;
short int **surface_h; // -22222 means this is watersurface at NN
short int max_h;
short int min_h;
// maybe these should come from conf ?
double sealevel; //this is the border between the upper and lower colormap
double sealevel2; //if this is set (!= -22222) then the blue ocean surface is set to this alt
// if set to "0" water will be plotted, where the water-flag is set in dem
double sealevel3; // if this is set (!= -22222) then a transparent blue surface will be plottet
float **surface_x;
float **surface_y;
float ***normalvectors;
int steps_lat;
int steps_lon;
double grid_lat;
double grid_lon;
int downscalefactor;
// int upscalefactor;
float tex_top_km;
float tex_bottom_km;
float tex_right_bottom_km;
float tex_right_top_km;
float tex_left_top_km;
float tex_left_bottom_km;
void vectorproduct (double a1, double a2, double a3, double b1, double b2, double b3, double &c1, double &c2,
double &c3);
void norm (double &a1, double &a2, double &a3);
Projection *proj_pointer; //the projection-class pointer
Config *conf_pointer; // config-pointer
};
#endif

374
src/map.cpp Normal file
View File

@ -0,0 +1,374 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
#include "map.h"
#include "projection.h"
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <jpeglib.h>
#ifndef __OSX__
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glext.h>
#else
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <OpenGL/glext.h>
#endif
#include "GLexplorer.h"
//const std::string rcsid_map_cpp =
// "$Id: map.cpp 3 2014-07-31 09:59:20Z kruegerh $";
//const std::string rcsid_map_h = MAP_H;
void
Map::readMap(string filename, int _width, int _height)
{
file = filename;
width = _width;
height = _height;
if (width == 0 || height == 0) {
cerr << "Width or Height for a map-tile is not set!" <<
endl;
cerr << filename << endl;
exit(1);
}
int _max;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*)&_max);
//cout << "max is: " << _max << endl;
if (_width > _max || _height > _max) {
cerr << "Map tile \"" << filename <<
"\" ist too big. Maximum size for your openGL implementation is "
<< _max << endl;
exit(1);
}
map = new GLubyte[_width * _height * 3];
ifstream mapfile;
mapfile.open(filename.c_str(), ios::binary);
if (!mapfile) {
cerr << "Error opening Map file: >" << filename << "<" <<
endl;
exit(1);
}
for (int nr = 0; nr < _width * _height * 3; nr++) {
map[nr] = mapfile.get();
//cout << map[nr] << endl;
}
mapfile.close();
}
void Map::readMap_jpeg(string filename, int _width, int _height)
{
// width and height should be 0, and will be read from jpeg image, and internally rescaled (if necessary)
// if width and height != 0 -> warning message, read from image -> rescaling
// if width or height = -1 no rescaling!
width = _width;
height = _height;
file = filename;
bool RESCALE = true;
// in logo conf_pointer will not be defined....
if (conf_pointer)
if (conf_pointer->DEBUG.get())
cout << "readMap_jpeg(" << file << ", " << _width << ", " << _height << ")" << endl << flush; ;
if (width == -1 && height == -1) RESCALE = false;
if ( (width != 0 || height != 0) && (width != -1 || height != -1) ) {
cerr <<
"Width or Height is specified for a jpeg-texture map..."
<< endl;
cerr << "This is not needed and will be ignored." << endl;
cerr << filename << endl;
width = 0;
height = 0;
}
int _max;
GLubyte *tmpmap;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*)&_max);
if (conf_pointer)
if (conf_pointer->DEBUG.get())
cout << "GL_MAX_TEXTURE_SIZE: " << _max << endl;
map = read_jpg(&width, &height, (char*) filename.c_str()); //, (unsigned char *) map);
if (conf_pointer)
if (conf_pointer->DEBUG.get())
cout << file << " is " << width << "x" << height << endl;
// AND HERE WE NEED TO CALCULATE THE NEXT POWER OF 2
// AND CHECK IF THE SIZE ISNT ALREADY A POWER OF 2
// THE NEXT POWER OF 2 SHOULD BE SMALLER THAN _max
// check if the width and height of image is a power of 2
double lbw = log((double) width) / log(2.0);
double lbh = log((double) height) / log(2.0);
// log of max allowed size
double lmax = log((double) _max) / log(2.0);
int lbw_i = (int) (lbw + 0.5);
int lbh_i = (int) (lbh + 0.5);
//cout << lbw_i << " " << lbh_i << endl;
//cout << "log_2 ("<<width<<") = "<<lbw<<endl;
//cout << "log_2 ("<<height<<") = "<<lbh<<endl;
if (RESCALE)
if (lbw != (double) lbw_i || lbh != (double) lbh_i || lbw > lmax || lbh > lmax) {
cerr << "Resizing is needed for " << filename << endl;
// calculate new width and height
// aufrunden (+1) abrunden -1 (eine potenz kleiner)
int power_w = (int) lbw; // - 1;
int power_h = (int) lbh; // -1;
// bis <= max erniedrigen
while (pow(2.0, power_w) > _max) {
power_w--;
}
while (pow(2.0, power_h) > _max) {
power_h--;
}
int new_width = (int) pow(2.0, power_w);
int new_height = (int) pow(2.0, power_h);
cout << "New width x height: " << new_width << "x" <<
new_height << " (old: " << width << "x" << height << ")" << endl;
tmpmap = new GLubyte[new_width * new_height * 3];
copy_resample_image_buffer((unsigned char *) tmpmap,
(unsigned char *) map, 0, 0, 0,
0, new_width, new_height, width,
height, width, new_width);
/*
copy_resample_image_buffer( unsigned char* destination, unsigned char* source,
int destination_x, int destination_y, int source_x, int source_y,
int destination_width, int destination_height, int source_width, int source_height,
int source_dimw, int destination_dimw);
*/
delete map;
map = tmpmap;
width = new_width;
height = new_height;
}
}
// _MODULATE = MAPS_UNLIGHTED (whether maps should be lighted or not, in !(not)coloured map mode
void Map::setglmap(double _altitude_of_map, bool COMPRESSION,
bool _MAPS_UNLIGHTED, bool BW, bool TEXCOOR)
{
if (conf_pointer)
if (conf_pointer->DEBUG.get())
cout << "setglmap: " << file << endl;
// this works much better than the internal format LUMINANCE... because of the better col->gray model
// but its slower :(
if (BW) {
this->grayscale_map();
}
// first of all: load the texture
if (!COMPRESSION) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_R3_G3_B2, width, height,
0, GL_RGB, GL_UNSIGNED_BYTE, map);
} else {
glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_ARB,
width, height, 0, GL_RGB, GL_UNSIGNED_BYTE,
map);
}
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
// we use modulate in any case!
// The unmodulated case needs lighting aswell, therefore colormap 7 (white)
// is used with modulation!
if (_MAPS_UNLIGHTED) {
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
} else {
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE,
GL_MODULATE);
}
// glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE,
// GL_MODULATE);
if (conf_pointer)
if (conf_pointer->DEBUG.get())
cout << "glGetError: " << gluErrorString(glGetError()) << endl;
// the texture coordinates dont need to be set here (in landscape mode)
// in landscape mode they will be set in landscape glsettrianglestrip_tex...
if (TEXCOOR) {
float top_km, bottom_km, right_top_km, left_top_km,
right_bottom_km, left_bottom_km;
proj_pointer->get_xy(top, right, right_top_km, top_km);
proj_pointer->get_xy(top, left, left_top_km, top_km);
proj_pointer->get_xy(bottom, right, right_bottom_km, bottom_km);
proj_pointer->get_xy(bottom, left, left_bottom_km, bottom_km);
right_top_km *= -1.0;
left_top_km *= -1.0;
right_bottom_km *= -1.0;
left_bottom_km *= -1.0;
top_km *= -1.0;
bottom_km *= -1.0;
glEnable(GL_TEXTURE_2D);
//glEnable(GL_LIGHTING);
glDisable(GL_LIGHTING);
//glPolygonMode(GL_FRONT, GL_FILL);
glBegin(GL_POLYGON);
//glColor3f(1.0,0,0);
// unten links
glTexCoord2f(0.0, 1.0);
glVertex3f(left_bottom_km, bottom_km, _altitude_of_map);
// unten rechts
glTexCoord2f(1.0, 1.0);
glVertex3f(right_bottom_km, bottom_km, _altitude_of_map);
// oben rechts
glTexCoord2f(1.0, 0.0);
glVertex3f(right_top_km, top_km, _altitude_of_map);
// oben links
glTexCoord2f(0.0, 0.0);
glVertex3f(left_top_km, top_km, _altitude_of_map);
glEnd();
glDisable(GL_TEXTURE_2D);
glEnable(GL_LIGHTING);
}
}
void Map::grayscale_map(void)
{
for (int _x = 0; _x <= (width * height * 3) - 3; _x += 3) {
GLubyte col =
(GLubyte) ((float) map[_x] * 0.3 +
(float) map[_x + 1] * 0.59 +
(float) map[_x + 2] * 0.11);
map[_x] = col;
map[_x + 1] = col;
map[_x + 2] = col;
}
}
void Map::map_to_colBuffer(int x, int y, int dx, int dy)
{
// this function scales the map to dx, dy
// the put it to screen coordinates x,y
GLubyte *tmpmap;
GLubyte *flipmap;
tmpmap = new GLubyte[dx * dy * 3];
flipmap = new GLubyte[dx*dy*3];
//cout << "vorher" << endl << flush;
copy_resample_image_buffer((unsigned char *) tmpmap,
(unsigned char *) map, 0, 0, 0,
0, dx, dy, width,
height, width, dx);
// flip up-down
for (int z=0; z< dy; z++) {
for (int s=0; s < dx*3 ; s++) {
flipmap[(((dy-1)-z)*dx*3)+s] = tmpmap[(z*dx*3)+s];
}
}
if (conf_pointer)
if (conf_pointer->DEBUG.get()) {
cout << "writing logo_image to color buffer" << endl << flush;
}
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glWindowPos2fMESAemulate((GLfloat) x, (GLfloat)y );
glDrawPixels(dx,dy, GL_RGB, GL_UNSIGNED_BYTE, flipmap);
//free array
delete[]tmpmap;
delete[]flipmap;
}
Map::~Map()
{
delete[]map;
}

77
src/map.h Normal file
View File

@ -0,0 +1,77 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*/
#ifndef MAP_H
#define MAP_H 1
#ifndef __OSX__
#include <GL/gl.h>
#else
#include <OpenGL/gl.h>
#endif
#include <string>
#include "projection.h"
#include "oglexfunc.h"
#include "oconfig.h"
using namespace std;
class Map {
public:
void readMap (string filename, int height, int width);
void readMap_jpeg (string filename, int height, int width);
void settop (float _top) { top = _top; }
void setbottom (float _bottom) { bottom = _bottom; }
void setright (float _right) { right = _right; }
void setleft (float _left) { left = _left; }
void setcenter_lat (double _lat) { center_lat = _lat; }
void setcenter_lon (double _lon) { center_lon = _lon; }
unsigned char *getMap (void) const { return map; }
int getHeight (void) const { return height; }
int getWidth (void) const { return width; }
void set_proj_pointer (Projection * p) { proj_pointer = p; }
void set_conf_pointer (Config * c) { conf_pointer = c;}
void grayscale_map (void);
void map_to_colBuffer(int x, int y, int dx, int dy);
void setglmap (double _altitude_of_map, bool COMPRESSION, bool _MODULATE, bool BW, bool TEXCOOR=true);
~Map ();
protected:
float top;
float right;
float left;
float bottom;
double center_lat;
double center_lon;
string file; // only used for information output...
int width;
int height;
GLubyte *map;
Projection *proj_pointer; //the projection-class pointer
Config *conf_pointer; //pointer to config
};
#endif

469
src/merger.cpp Normal file
View File

@ -0,0 +1,469 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
/*
hacked from etopo2merger to merge more general
example:
./merger --lonmin 5.63833333310781 --latmax 49.17166666637981 --grid 0.000833333 --file ../../../srtm3/20367254/20367254.bil --rows 7151 --columns 14254 --sgrid 0.008333333333 --slatmax 90 --slonmin -180 --scolumns 43200 --srows 21600 --source /usr/local/share/gpligc/data/dem/WORLD3_SRTM30_GTOPO30_ETOPO2.DEM --out test.dem
*/
#include <fstream>
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;
//const string rcsid_etopo2merger_cpp =
// "$Id: merger.cpp 3 2014-07-31 09:59:20Z kruegerh $";
float smaxlat, sminlon, maxlat, minlon, sgrid, grid;
string srcfile;
string infile;
string outfile;
int rows, srows, columns, scolumns;
int icounter =0;
ifstream in;
ifstream src;
ofstream out;
bool BIGENDIAN=false;
bool SBIGENDIAN=true;
short int
getalt(double _lat,double _lon)
{
int steps_lat, steps_lon, i1, i2, verschieber;
short int h1, h2, h3, h4;
short int watercounter;
short int seafloorcounter;
vector <short int> neighbours;
float lat_frac, lon_frac;
watercounter = 0;
seafloorcounter = 0;
//second_try:
steps_lat = (int) (1.0 +
(smaxlat -
_lat) / sgrid
);
steps_lon = (int) ((_lon -
sminlon) /
sgrid
);
lat_frac =
fabs(-steps_lat * sgrid +
smaxlat - _lat)
/ sgrid;
lon_frac =
fabs(-steps_lon * sgrid -
sminlon + _lon)
/ sgrid;
//cout << "lat: " << lat_frac << " lon: " << lon_frac << endl;
verschieber =
(steps_lat * scolumns + steps_lon) * 2;
src.seekg(verschieber, ios::beg);
i1 = src.get();
i2 = src.get();
if (SBIGENDIAN) {
h1 = 256 * i1 + i2;
} else {
h1 = 256 * i2 + i1;
}
neighbours.push_back(h1);
if (h1 == -9999)// || h1 <= -16384)
watercounter++; //h1 = 0; // in this case this is OK warum nicht 0?
if (h1 <= -16384)
seafloorcounter++;
steps_lat = (int) (1.0 +
(smaxlat -
_lat) /
sgrid);
steps_lon = (int) (1.0 +
(_lon -
sminlon) /
sgrid);
verschieber =
(steps_lat * scolumns + steps_lon) * 2;
src.seekg(verschieber, ios::beg);
i1 = src.get();
i2 = src.get();
if (SBIGENDIAN) {
h2 = 256 * i1 + i2;
} else {
h2 = 256 * i2 + i1;
}
//h2 = 256 * i1 + i2;
neighbours.push_back(h2);
if (h2 == -9999)// || h2 <= -16384)
watercounter++;//h2 = 0;
if (h2 <= -16384)
seafloorcounter++;
steps_lat = (int) ((smaxlat -
_lat) /
sgrid);
steps_lon = (int) ((_lon -
sminlon) /
sgrid);
verschieber =
(steps_lat * scolumns + steps_lon) * 2;
src.seekg(verschieber, ios::beg);
i1 = src.get();
i2 = src.get();
if (SBIGENDIAN) {
h3 = 256 * i1 + i2;
} else {
h3 = 256 * i2 + i1;
}
//h3 = 256 * i1 + i2;
neighbours.push_back(h3);
if (h3 == -9999)// || h3 <= -16384)
watercounter++;//h3 = 0;
if (h3 <= -16384)
seafloorcounter++;
steps_lat = (int) ((smaxlat -
_lat) /
sgrid);
steps_lon = (int) (1.0 +
(_lon -
sminlon) /
sgrid);
verschieber =
(steps_lat * scolumns + steps_lon) * 2;
src.seekg(verschieber, ios::beg);
i1 = src.get();
i2 = src.get();
if (SBIGENDIAN) {
h4 = 256 * i1 + i2;
} else {
h4 = 256 * i2 + i1;
}
//h4 = 256 * i1 + i2;
neighbours.push_back(h4);
if (h4 == -9999) // || h4 <= -16384)
watercounter++;//h4 = 0;
if (h4 <= -16384)
seafloorcounter++;
// this implements bilinear-interpolation!
short int alt;
alt = (int) (
((1.0 - lon_frac) * (1.0 - lat_frac) * (double) h1 +
lon_frac * (1.0 - lat_frac) * (double) h2 +
(1.0 - lon_frac) * lat_frac * (double) h3 +
lat_frac * lon_frac * (double) h4) +0.5);
// now rounded :-) rounding error?!
// if there is water
if (watercounter == 1 || watercounter == 2) {
alt = 0;
}
if (watercounter > 2)
alt = -22222;
// if one or two of the neighbours are seafloor, then we set the elevation to 0 (coast)
if (seafloorcounter > 0 ) {
if (seafloorcounter == 1 || seafloorcounter == 2)
alt = 0;
//if three neighbours are seafloor, then we set elevation to -16384 (sea with 0)
// if -16383 => workaround... rounding error in interpolation?
if (seafloorcounter == 3 || alt == -16383 )
alt = -16384;
// if 4x seafloor, then its ok
}
// Add warning signs! if invalid elevations read
// this only works for data in srtm-3 from seamless server, which uses 0 for invalid data (stupid!)
/*int neg_counter=0;
if (_conf->GETELEV_WARN.get()) {
// count neighbours equal zero!
for(unsigned int a=0; a<= neighbours.size()-1; a++) {
if (neighbours[a] <= 0) {
neg_counter--;
}
}
// we return a negative integer, indicating how many points are invalid
if (neg_counter < 0) {(*_gnd_elev)[i] = neg_counter;}
}
// simple preliminary error-guess
if (_conf->GETELEV_ERROR.get()) {
int min=10000;
int max=0;
for(unsigned int a=0; a<= neighbours.size()-1; a++) {
if (neighbours[a] < min)
min = neighbours[a];
if (neighbours[a] > max)
max = neighbours[a];
}
// an error is added to the elevation array
if (neg_counter < 0) {
(*_gnd_elev).push_back(max);
if (max-min != max) {
cerr << "AAAAAAAAAAAAAAAALLLLLLLLLLLAAAAAAAAAARRRRRRRMMMMMMMM!!"<<endl;
}
}else{
(*_gnd_elev).push_back(max-min);
}
}
*/
//src.close();
//if (_conf->DEBUG.get() ) {cout << "get_gnd_elevations finished " << endl << flush ;}
return alt;
}
void failed(void)
{
cout << "Some of the files are missing, "
<< "or we are unable to write to the output file."
<< endl;
exit(1);
}
//---------------------------------------------
int main(int argc, char *argv[])
{
// parsing of options...
for (int i = 0; i < argc; i++) {
if (strcmp(argv[i], "--slatmax") == 0)
sscanf(argv[i + 1], "%f", &smaxlat);
if (strcmp(argv[i], "--slonmin") == 0)
sscanf(argv[i + 1], "%f", &sminlon);
if (strcmp(argv[i], "--latmax") == 0)
sscanf(argv[i + 1], "%f", &maxlat);
if (strcmp(argv[i], "--lonmin") == 0)
sscanf(argv[i + 1], "%f", &minlon);
if (strcmp(argv[i], "--out") == 0)
outfile = argv[i + 1];
if (strcmp(argv[i], "--source") == 0)
srcfile = argv[i+1];
if (strcmp(argv[i], "--file") == 0)
infile = argv[i+1];
if (strcmp(argv[i], "--sgrid") == 0)
sscanf(argv[i + 1], "%f", &sgrid);
//sgrid = argv[i+1];
if (strcmp(argv[i], "--grid") == 0)
sscanf(argv[i + 1], "%f", &grid);
//grid = argv[i+1];
if (strcmp(argv[i], "--rows") == 0)
sscanf(argv[i + 1], "%d", &rows);
//rows = argv[i+1];
if (strcmp(argv[i], "--srows") == 0)
sscanf(argv[i + 1], "%d", &srows);
//srows = argv[i+1];
if (strcmp(argv[i], "--scolumns") == 0)
sscanf(argv[i + 1], "%d", &scolumns);
//scolumns = argv[i+1];
if (strcmp(argv[i], "--columns") == 0)
sscanf(argv[i + 1], "%d", &columns);
//columns = argv[i+1];
}
if (sizeof(short int) != 2) {
cerr << "sizeof(short int) " << sizeof(short int) << endl;
cerr << "Sorry, can't help you here. Use the source, Luke."
<< endl;
exit(1);
}
bool FAILED = false;
cout << "Trying to read: "<< infile <<".....";
in.open(infile.c_str(), ios::binary);
if (!in) {
cout << "failed." << endl;
FAILED = true;
} else {
cout << "ok." << endl;
}
cout << "trying to read " << srcfile << " ... ";
src.open(srcfile.c_str(), ios::binary);
if (!src) {
cout << "failed" << endl;
FAILED = true;
} else {
cout << "ok" << endl;
}
cout << "Trying to open outputfile: " << outfile << " ... ";
out.open(outfile.c_str(), ios::binary);
if (!out) {
cout << "failed." << endl;
FAILED = true;
} else {
cout << "ok." << endl;
}
if (FAILED)
failed();
cout << "File to be improved by interpolation: "<< infile << endl
<< "rows: " <<rows<<" columns: "<<columns<<endl<<"latmax :"<<maxlat<<" lonmin: "<<minlon
<< " grid: "<<grid <<endl<<"output: "<< outfile<<endl;
cout << "Interpolation source: "<< srcfile << endl
<< "rows: " <<srows<<" columns: "<<scolumns<<endl<<"latmax :"<<smaxlat<<" lonmin: "<<sminlon
<< " grid: "<<sgrid <<endl;
// main part of etopo2merging -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------
// now read etopo into memory!
// cout << "Reading etopo2 into RAM" << endl;
for (int row = 0; row < rows; row++) {
cout << (rows - row) << " " << '\r' << flush;
for (int col = 0; col < columns; col++) {
int i1 = in.get();
int i2 = in.get();
short int salt; //source alt
//read in given (BIGENDIAN) endianess
if (BIGENDIAN) {
salt = 256 * i1 + i2;
} else {
salt = 256 * i2 + i1;
}
if (salt == 0) { // undef interpolate from source
double lat = maxlat - (grid * row);
double lon = minlon + (grid * col);
salt = getalt(lat, lon);
//cout << salt << endl;
icounter++;
}
i2 = (short int) (salt & 255);
i1 = (short int) (salt & 65280) >> 8;
out.put(i1);
if (!out) {
cerr <<
"An error occured while writing the output file... (no disc space?)"
<< endl;
exit(1);
}
out.put(i2);
if (!out) {
cerr <<
"An error occured while writing the output file... (no disc space?)"
<< endl;
exit(1);
}
}
}
cout << "Finished." << endl;
cout << (rows * columns) << " DEM data points handled."<<endl << icounter << " interpolated" << endl;
float per = ( (float)icounter / ((float)rows*(float)columns)) *100.0;
cout << per << " %" << endl;
cout << "Finished. Please check the output file." << endl;
}

1565
src/oconfig.cpp Normal file

File diff suppressed because it is too large Load Diff

428
src/oconfig.h Normal file
View File

@ -0,0 +1,428 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*/
#ifndef OCONFIG_H
#define OCONFIG_H 1
#include <vector>
#include <string>
#include <deque>
#include <sys/time.h>
#include "value.h"
#include "config.h"
#ifdef HAVE_LIBOSMESA
#define WITH_OSMESA
#endif
#ifdef HAVE_LIBGPS
#define __GPSD__
#endif
#ifdef __WIN32__
const std::string SEPERATOR = "\\";
#else
const std::string SEPERATOR = "/";
#endif
using namespace std;
class Switch {
public:
Switch();
void off(void) {state = false;}
void on(void) {state = true;}
bool get(void) const {return state;}
void toggle(void);
protected:
bool state;
};
class Config {
public:
Config();
~Config();
int readConfigFile(void);
void setConfigFileName(string);
string getConfigFileName(void) const {return configfile;}
string getAirspaceFileName(void) const {return airspacefile;}
void setAirspaceFileName(string name) {airspacefile = name;}
string getLiftsFileName(void) const {return liftsfile;}
void setLiftsFileName(string name) {liftsfile = name;}
string getWaypointsFileName(void) const {return waypointsfile;}
void setWaypointsFileName(string name) {waypointsfile = name;}
string getDemFileName(void) const {return demfile;}
void setIGCFileName(string _name) {igcfilename = _name;}
string getIGCFileName(void) const {return igcfilename;}
Value<int> aov;
Value<float> z_scale;
Value<float> input_dem_factor;
Value<float> fogdensity;
Value<int> ignore_elev_min;
Value<int> ignore_elev_max;
// eye distance for stereo
Value<float> eye_dist;
// in milliseconds
Value<int> movie_msecs;
Value<int> movie_repeat_factor;
Value<float> idle_auto_repeat_limit;
Value<float> SPINNING;
Value<float> flightstrip_width;
Value<int> flightstrip_mode;
Value<int> flightstrip_colmap;
Value<float> flightstrip_col_rup;
Value<float> flightstrip_col_gup;
Value<float> flightstrip_col_bup;
Value<float> flightstrip_col_rdown;
Value<float> flightstrip_col_gdown;
Value<float> flightstrip_col_bdown;
Value<float> markercol_r;
Value<float> markercol_g;
Value<float> markercol_b;
Value<float> MAXTRIANGLES;
Value<int> shadedirection;
Value<int> colmapnumber;
Value<int> colmap2number;
Value<int> style; //1=new, 2 = old
Value<int> background; //1=like old, 2=vertical, 3=horiz gradient
Value<float> background_color_1r;
Value<float> background_color_1g;
Value<float> background_color_1b;
Value<float> background_color_2r;
Value<float> background_color_2g;
Value<float> background_color_2b;
Value<float> airspace_wire_color_r;
Value<float> airspace_wire_color_g;
Value<float> airspace_wire_color_b;
Value<float> text_color_r;
Value<float> text_color_g;
Value<float> text_color_b;
Value<float> text_width;
Value<float> lifts_color_r;
Value<float> lifts_color_g;
Value<float> lifts_color_b;
Value<int> lifts_info_mode;
Value<float> waypoints_color_r;
Value<float> waypoints_color_g;
Value<float> waypoints_color_b;
Value<float> waypoints_info_mode;
Value<int> waypoints_offset;
Value<float> airspace_wire_width;
Value<int> info_fontsize;
Value<float> info_fontwidth;
Value<int> offset;
Value<float> orthoclipping;
Value<int> ActiveMapSet;
Value<int> jpeg_quality;
Value<float> MARKER_SIZE;
Value<float> pTextSize;
Value<int> fglut_version; // to save freeglut version information
Value<float> joyfac_x;
Value<float> joyfac_y;
Value<float> joyfac_z;
float getborder(void) const {return border;}
float getborder_land_lat(void) const { return border_land_lat;}
float getborder_land_lon(void) const { return border_land_lon;}
void setborder_land_lat(float b) {border_land_lat = b;}
void setborder_land_lon(float b) {border_land_lon = b;}
float getlat(void) const {return lat;}
float getlon(void) const {return lon;}
void setlat(float l) {lat = l;}
void setlon(float l) {lon =l;}
void setwidth(int w) {width = w;}
void setinitwidth(int w) {initwidth =w;}
void setheight(int h) {height = h;}
void setinitheight(int h) {initheight = h;}
int getwidth(void) const {return width;}
int getheight(void) const {return height;}
int getinitwidth(void) const {return initwidth;}
int getinitheight(void) const {return initheight;}
int getnextframewriternumber(void) {return framewritercounter++;}
int getairfield_elevation(void) const {return airfield_elevation;}
void setairfield_elevation(int _ae) {airfield_elevation=_ae;}
void clearairfield_elevation(void) {airfield_elevation=-9999;}
float getorthoshift(void) const {return orthoclipping.get() / 100.0;}
int getdownscalefactor(void) const {return downscalefactor;}
void setdownscalefactor(int d) {downscalefactor=d;}
float getshadescale(void) const {return shadescale;}
void setshadescale(float d) {shadescale=d;}
int getupscalefactor(void) const {return upscalefactor;}
void setupscalefactor(int u) {upscalefactor=u;}
int getdem_rows(void) {return dem_rows;}
int getdem_columns(void) {return dem_columns;}
float getdem_lat_min(void) {return dem_lat_min;}
float getdem_lat_max(void) {return dem_lat_max;}
float getdem_lon_min(void) {return dem_lon_min;}
float getdem_lon_max(void) {return dem_lon_max;}
float getdem_grid_lat(void) {return dem_grid_lat;}
float getdem_grid_lon(void) {return dem_grid_lon;}
short int getmax_h(void) const {return max_h;}
void setmax_h(int m) {max_h = m;}
short int getmin_h(void) const {return min_h;}
void setmin_h(int m) {min_h= m;}
//char* getMapFilename(int i) const {return (char*) MapFilename[i].c_str();}
string getMapFilename(int i) const {return MapFilename[i];}
int getNumberOfMaps(void) const {return NumberOfMaps;}
int getNumberOfMapSets(void) const {return NumberOfMapSets;}
int set_ActiveMapSet(string);
vector<string> getMapSetName(void) const {return MapSetName;}
int getMapIndexLow(void); // const {return mapcuts[ActiveMapSet-1];}
int getMapIndexHigh(void);// const {return mapcuts[ActiveMapSet];}
float getmap_top(int i) const {return map_top[i];}
float getmap_bottom(int i) const {return map_bottom[i];}
float getmap_right(int i) const {return map_right[i];}
float getmap_left(int i) const {return map_left[i];}
int getmap_height(int i) const {return map_height[i];}
int getmap_width(int i) const {return map_width[i];}
float getalt_unit_fac(void) const {return alt_unit_fac;}
string getalt_unit_name(void) const {return alt_unit_name;}
float getspeed_unit_fac(void) const {return speed_unit_fac;}
string getspeed_unit_name(void) const {return speed_unit_name;}
float getvspeed_unit_fac(void) const {return vspeed_unit_fac;}
string getvspeed_unit_name(void) const {return vspeed_unit_name;}
int get_marker_back(void) const {return marker_back;}
int get_marker_ahead(void) const {return marker_ahead;}
void set_marker_back(int _x) {marker_back = _x;}
void set_marker_ahead(int _x) {marker_ahead = _x;}
timeval get_time_mem(void) const {return time_mem;}
void set_time_mem(timeval t) {time_mem = t;}
void set_framerate(float f) {framerate = f;}
float get_framerate(void) const {return framerate;}
void set_fps(float f);
float get_fps(void);
unsigned int get_projection(void) const {return projection;}
int get_sealevel(void) const {return sealevel;}
int get_sealevel2(void) const {return sealevel2;}
int get_sealevel3(void) const {return sealevel3;}
void set_sealevel(int sl) {sealevel = sl;}
void set_sealevel2(int sl) {sealevel2 = sl;}
void set_sealevel3(int sl) {sealevel3 = sl;}
void setTimeZone(int z) {timeZone = z;}
void setTimeZoneName(char* n) {timeZoneName = n;}
int getTimeZone(void) const {return timeZone;}
string getTimeZoneName(void) const {return timeZoneName;}
string get_image_format(void) const {return image_format;}
void set_image_format(string i) {image_format = i;}
string get_save_path(void) const {return save_path;}
string get_basename(void) const {return basename;}
Switch COMPRESSION;
Switch MOVIE; //screenshot and movie stuff....
Switch FULLSCREEN; //we wont start fullscreen
Switch MOUSE; //but with mousecursor visible in GL window
Switch LANDSCAPE; //do we need the green grass?
Switch VERBOSE; //want to have lots of mostly useless output?
Switch QUIET; //needed temporarily while reading the conf-file
// indicates if --quiet is given...
Switch DEBUG; //even more of useless output ;-)
Switch WIRE; //Wireframe Model?
Switch SHADE; //Gouraud-Shading
Switch NOLIGHTING;
Switch TERRAINSHADING; // terrain gradient shading
Switch QUADS; // use quads!
Switch FLIGHT; //with or with out flightdatafile
Switch DEM; //digital elevation model
Switch AUTOREDUCE;
Switch AIRSPACE;
Switch AIRSPACE_WIRE;
Switch LIFTS;
Switch WAYPOINTS;
Switch WAYPOINTS_OFFSET_TEXT_ONLY;
Switch ORTHOVIEW; //glOrtho Projection?
Switch ORTHOONTOP; // track in orthomode much higher, always on top
Switch CURTAIN;
Switch FOG;
Switch EGG1;
Switch EGG2;
Switch MAP; //texture map - map :-)
Switch INFO; //Info text
Switch MARKER; //marker
Switch MODULATE; //modulate dem and texture colours
Switch MAPS_UNLIGHTED; //used when !MODULATE
Switch STEREO; //stereographic rendering (2 pictures)
Switch SWAP_STEREO;
Switch STEREO_RG; //red green stereo
Switch STEREO_RB; //red blue stereo
Switch STEREO_HW; //hardware stereo (quadbuffers-shutterglasses)
Switch BW; // Grayscale
Switch OFFSCREEN; //offscreen rendering (with glx)
Switch OSMESA; //offscreen with osmesa
Switch FGLUT; // if freeglut is available... (checked at runtime
// but how???) !!! FREEGLUT is reserved by freeglut
Switch FGLUT_CHECK; // should I check for Freeglut-Version?
// to avoid warning on old-glut systems
Switch JOYSTICK; // joystick on/off
Switch GPSALT; // use gps alt or baro-alt
Switch MARKER_RANGE; // position lock, relative to marker
Switch FOLLOW; // follow mode (position will follow maker)
Switch FLYING;
Switch FLYING_REPEAT;
Switch FLYING_AUTO_REPEAT;
Switch BIGENDIAN;
// these switches control, whether an airspace is displayed or not
Switch AIRSPACE_P;
Switch AIRSPACE_Q;
Switch AIRSPACE_R;
Switch AIRSPACE_D;
Switch AIRSPACE_C;
Switch AIRSPACE_CTR;
Switch GETELEV_WARN;
Switch GETELEV_ERROR;
Switch IGNORE_ELEV_RANGE;
Switch GPSD;
Switch GPSDGNDELEV;
Value <int> AirspaceLimit;
protected:
string configfile;
vector <string> configfiles;
string airspacefile;
string liftsfile;
string waypointsfile;
string demfile;
//char* igcfilename;
string igcfilename;
string image_format;
string save_path;
string basename;
string alt_unit_name;
float alt_unit_fac;
string speed_unit_name;
float speed_unit_fac;
string vspeed_unit_name;
float vspeed_unit_fac;
float border; //in km for the green underground
float border_land_lat; //in km for landscape-mode
float border_land_lon;
int width; //width and height for glut window
int height;
int initheight;
int initwidth;
float lat; //center for views without igcfile
float lon;
int downscalefactor; //changable at start-time only
int upscalefactor;
float shadescale;
unsigned int projection; //changable at start-time only
int NumberOfMaps; //for texture maps
vector<string> MapFilename;
vector<string> MapSetName; // Map set names
int NumberOfMapSets;
vector<int> mapcuts;
vector<float> map_top;
vector<float> map_bottom;
vector<float> map_right;
vector<float> map_left;
vector<int> map_height;
vector<int> map_width;
float map_shift_lat;
float map_shift_lon;
int airfield_elevation; //elevation of take-off location in m
int dem_rows;
int dem_columns;
float dem_lat_min;
float dem_lat_max;
float dem_lon_min;
float dem_lon_max;
float dem_grid_lat;
float dem_grid_lon;
short int max_h; //max and minumim height for colormap-scaling in landscape
short int min_h;
int framewritercounter; //for movie-stuff
int marker_ahead;
int marker_back;
timeval time_mem;
float framerate;
deque<float>fps;
int sealevel;
int sealevel2;
int sealevel3;
int timeZone;
string timeZoneName;
// dies sollte char const* sein !? geht das?
int checkBOOL(char* val, const char* key="not given");
int checkINT(char* val, const char* key="not given");
int checkFLOAT(char* val, const char* key="not given");
};
#endif

1534
src/oglexfunc.cpp Normal file

File diff suppressed because it is too large Load Diff

78
src/oglexfunc.h Normal file
View File

@ -0,0 +1,78 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*/
#ifndef OGLEXFUNC_H
#define OGLEXFUNC_H 1
#ifndef OPTIMIZER
#ifndef __OSX__
#include <GL/gl.h>
#include <GL/glut.h>
#else
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
#endif
#endif
#include <vector>
#include <string>
#include <cstdlib>
#include <sys/time.h>
#include "oconfig.h"
using namespace std;
#ifndef OPTIMIZER
// the old text function, no shaded background for text (to be used in help, about "loading"
void gltext (GLuint x, GLuint y, GLfloat scale, const char* txt, int _width, int _height, float _r=0.0, float _g=0.0, float _b=0.0);
// antonios new text function, with nice shaded background for text, to be used for on-screen info
void gltextvect (GLuint x, GLuint y, GLfloat scale, vector <string> lines, int _width, int _height, bool ortho=false);
// the last parameter isnt necessary anymore...(ortho)
void go(float lat1, float lon1, float heading, float distance, float& lat2, float& lon2, float radius=6371.0);
float heading (float lat1, float lon1, float lat2, float lon2);
void get_gnd_elevations(vector<int>*, vector<float>*, vector<float>*, Config*);
int get_1gnd_elevation(float, float, Config*);
void HelpScreen();
void InfoScreen();
void getcolor(float* colorpointer, int colormap, float value, float min, float max);
float* graycolor(float*);
void glWindowPos4fMESAemulate(GLfloat x,GLfloat y,GLfloat z,GLfloat w);
void glWindowPos2fMESAemulate(GLfloat x, GLfloat y);
string dec2humantime(float t, int n);
// this is for SysV IPC communication with GPLIGC
struct gpligc_ipc_block {
int marker_pos;
};
class Timecheck {
public:
Timecheck();
Timecheck(string _name,Config* _c);
void checknow(string _here);
protected:
Config* conf;
string name;
timeval start;
timeval last;
timeval now;
};
#endif
float great_circle_dist (float lat1, float lon1, float lat2 , float lon2 , float radius=6371.0);
#endif

967
src/optimizer.cpp Normal file
View File

@ -0,0 +1,967 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
/*
usage:
optimizer
-f firstpoint
-l lastpoint if not given all will be assumed
-w number of wps
-p pl1 pl2 ... pln-1 points for legs (n-1 arguments)
-s random seed
-d datafile (3d.dat from GPLIGC)
-igc igcfile // planned, not yet implemented
-devisor n uses every n-th record only
-refine n do a brute force optimisation for each wp +-n (only for 7 wps)
-m montecarlo guesses (to be done before Metropolis Monte Carlo)
-mmc metropolis mc cycles
-progress n progression method n steps (testing for live-optimisation)
-sima simulated annealing
-sapara simulated annealing parameter a
-saparb simulated annealing parameter b (see temperature function)
-sacycles aimulated annealing cycles for each temp
-c overall cycles (GPLIGC uses many times -c 1 (to get the progress bar) otherwise -c 15 is OK (and default)
-v verbose
-debug lots of output
For a general optimization task:
task with n waypoints (n-1 legs) and defined scoring
max altitude difference between min((-f),w1) and max((-l),wn) of 1000m
use: -f x -l y -w n -p 1 1 . . -delta 1000 -m 5000 -c 15 -v -d 3d.dat
-dmst dmst scoring +15% for fai-triangle, but -w 5 -p 1 1 1 1 have to be given too
altitude checking included
-holc holc scoring -w5 -p 1.5 1.5 1.5 1.5 should be given too
checking for altitude (holc limit is 2500ft AGL for UL-aero-tow (!winch))
-delta m (max alt-difference between start and finish
lowest point between release and start, and highest point between finish and landing)
"olc-rules"
(this check is only done if !HOLC && !DMST)
for olc 2004 give: -delta 1000 -w 7 -p 1 1 1 1 0.8 0.6
for dmst 2004: -dmst -w 5 -p 1 1 1 1
for holc 2004: -holc -w 5 -p 1.5 1.5 1.5 1.5
*/
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdio>
#include <unistd.h>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <algorithm>
#include "oglexfunc.h"
// srandom and random are POSIX, not available on MinGW
#ifdef __WIN32__
#define srandom srand
#define random rand
#endif
//const std::string rcsid_optimizer_cpp =
// "$Id: optimizer.cpp 3 2014-07-31 09:59:20Z kruegerh $";
using namespace std;
//global variables
vector <float> lat;
vector <float> lon;
vector <int> alt;
vector <float> scoring;
vector <float> cycleresults;
int wps = 0;
int delta_h = 1000;
int low_index = 0;
int high_index = 0;
int mmc_done=0;
int temp_done=0;
int progression = 0;
int progression_high_index = 0;
bool PROGRESSION = false; // progression method, stucks in local minima often...
bool SIMANNEALING = false; // simulated annealing
bool VERBOSE = false;
bool OLC_CLASS = false;
bool OLC_FAI = false;
bool DMST = false;
bool HOLC = false; // OLC-PHG
bool SOLUTION = false;
bool DEBUG = false;
bool SA_CHANGED = false;
int sa_i = 1;
int sa_t = 0;
int sa_nt = 1000;
float sa_temp;
float sa_param_a=15;
float sa_param_b=0.03;
bool SA_LINEAR = false;
bool SA_EXP = true;
int devisor = 1; // uses only every n-th record
int refine = 0; // brute force refinement points +- n
// Working wp vector
vector <int> p;
// overall maximum variables
vector <int> max_task;
float opt_km = 0;
float max_points = 0;
// cycle maximum variables
vector < int >max_task_cycle;
float opt_km_cycle = 0;
float max_points_cycle = 0;
void montecarlo(void);
void metropolismontecarlo(void);
void calc_pts_km(vector < int >_p);
float temperature(int _t);
double binomial(int n, int k);
double factorial(int n);
int main(int argc, char *argv[])
{
if (argc == 1) {
exit(0);
}
int cycles = 15; //overall cycles (default)
int n = -1; // line-index (datafile)
unsigned long int mc_cycles = 5000; // number of monte carlo cycles
unsigned long int met_mc_cycles = 25000;
float x, y, _f; //some tmp-floats
int temp_alt;
unsigned long int seed = 0; //random seed from GPLIGC
char *filename;
// parsing of options...
for (int i = 0; i < argc; i++) {
//cerr << i << " " << argc << " " << argv[i] << "---" << endl;
if (strcmp(argv[i], "-f") == 0)
sscanf(argv[i + 1], "%d", &low_index);
if (strcmp(argv[i], "-l") == 0)
sscanf(argv[i + 1], "%d", &high_index);
if (strcmp(argv[i], "-w") == 0) {
sscanf(argv[i + 1], "%d", &wps);
p.resize(wps);
max_task.resize(wps);
max_task_cycle.resize(wps);
}
if (strcmp(argv[i], "-progression") == 0) {
sscanf(argv[i + 1], "%d", &progression);
PROGRESSION = true;
}
if (strcmp(argv[i], "-sima") == 0) {
SIMANNEALING = true;
}
if (strcmp(argv[i], "-salin") == 0) {
SA_LINEAR = true;
SA_EXP = false;
}
if (strcmp(argv[i], "-saexp") == 0) {
SA_EXP = true;
SA_LINEAR = false;
}
if (strcmp(argv[i], "-d") == 0)
filename = argv[i + 1];
if (strcmp(argv[i], "-m") == 0)
sscanf(argv[i + 1], "%lu", &mc_cycles);
if (strcmp(argv[i], "-mmc") == 0)
sscanf(argv[i + 1], "%lu", &met_mc_cycles);
if (strcmp(argv[i], "-sacycles") == 0)
sscanf(argv[i + 1], "%d", &sa_nt);
if (strcmp(argv[i], "-sapara") == 0)
sscanf(argv[i + 1], "%f", &sa_param_a);
if (strcmp(argv[i], "-saparb") == 0)
sscanf(argv[i + 1], "%f", &sa_param_b);
if (strcmp(argv[i], "-s") == 0)
sscanf(argv[i + 1], "%lu", &seed);
if (strcmp(argv[i], "-c") == 0)
sscanf(argv[i + 1], "%d", &cycles);
if (strcmp(argv[i], "-devisor") == 0)
sscanf(argv[i + 1], "%d", &devisor);
if (strcmp(argv[i], "-refine") == 0)
sscanf(argv[i + 1], "%d", &refine);
if (strcmp(argv[i], "-delta") == 0)
sscanf(argv[i + 1], "%d", &delta_h);
if (strcmp(argv[i], "-p") == 0) {
for (int j = 1; j < wps; j++) {
sscanf(argv[i + j], "%f", &_f);
//cerr << _f << endl;
scoring.push_back(_f);
}
}
if (strcmp(argv[i], "-v") == 0)
VERBOSE = true;
if (strcmp(argv[i], "-debug") == 0) {
DEBUG = true;
VERBOSE = true;
}
if (strcmp(argv[i], "-dmst") == 0) {
DMST = true;
delta_h = 1000; //check is hard-coded
}
if (strcmp(argv[i], "-olc-class") == 0) {
OLC_CLASS = true;
delta_h = 1000; //check is hard-coded
}
if (strcmp(argv[i], "-olc-fai") == 0) {
OLC_FAI = true;
delta_h = 1000; //check is hard-coded
}
if (strcmp(argv[i], "-holc") == 0)
HOLC = true;
}
if (PROGRESSION) {
// cycles = 1;
progression_high_index = low_index+progression;
}
/* if (SIMANNEALING) {
//cycles = 1;
mc_cycles = 1;
}
*/
if (VERBOSE) {
cerr << "Optimizer by Hannes Krueger (c) 2002-2016 " << endl; // << rcsid_optimizer_cpp << endl;
cerr << "Optimize \"" << filename << "\"" << endl
<< "between " << low_index << " and " << high_index <<
endl << wps << " Waypoints" << endl;
for (int i = 0; i < wps - 1; i++)
cerr << "Leg " << i +
1 << " = " << scoring[i] << " Points/km" <<
endl;
cerr << mc_cycles << " Initial MC Random guesses"
<< endl << "Random seed given: " << seed << endl <<
"Overall cycles: " << cycles << endl;
if (OLC_CLASS)
cerr << "Optimize for OLC-classic (rules oct/2007)" << endl;
if (OLC_FAI)
cerr << "Optimize for OLC-Fai (rules oct/2007)" << endl;
if (DMST)
cerr << "Optimize for DMSt (rules 2004)" << endl;
if (HOLC)
cerr << "Optimize for HOLC 2004 rules" << endl;
//if (!DMST && !HOLC)
// cerr << "Max Alt difference is " << delta_h << " m" <<
// endl;
if (PROGRESSION) {
cerr << "Progression method: steps: "<< progression << endl;
}
if (SIMANNEALING){
cerr << "Simulated annealing will be performed. Cylces: " <<sa_nt <<endl;
if (SA_EXP)
cerr << "Temp function: T(x) = " << sa_param_a<<"*exp(-"<<sa_param_b<<"*x)"<<endl;
if (SA_LINEAR)
cerr << "Temp function: T(x) = -" << sa_param_a<<"*x + "<<sa_param_b<<endl;
}
if (refine > 0) {
cerr << "Brute Force refinement will be performed +- " << refine << endl;
}
if (devisor > 1) {
cerr << "Devisor: " << devisor << " Data subsampling" << endl;
}
}
// open the datafile and read in
ifstream cfile(filename);
if (!cfile) {
cerr << "Can not open datafile " << filename << endl;
return -1;
}
char zeile[80];
while (cfile) {
cfile.getline(zeile, 80, '\n');
//cerr << "Zeile: " << zeile << endl;
n++;
if (sscanf(zeile, "%f %f %d", &x, &y, &temp_alt) != 3) {
//cerr << "empty line in km.dat (why?)" << endl;
n--;
} else {
lat.push_back(y);
lon.push_back(x);
alt.push_back(temp_alt);
//cerr << temp_alt << endl;
}
}
if (high_index==0) {high_index=lat.size()-1;}
if (VERBOSE)
cerr << high_index-low_index << " Records. " << wps << " Waypoints. Gives Binomial("<<high_index-low_index<<","<<wps<<") possibilities." << endl;
if (VERBOSE && devisor > 1)
cerr << (float)(high_index-low_index)/(float)devisor << " Records/devisor " << wps << " Waypoints. Gives Binomial("<<(float)(high_index-low_index)/(float)devisor<<","<<wps<<") possibilities." << endl;
// initialize random by jmw krueger modified by kruegerh
// Seed RNG *******************************************
//int seed = 0;
FILE *devrand;
devrand = fopen("/dev/urandom", "r");
// if no dev urandom available use seed from cmdl
if (devrand) {
fread(&seed, sizeof(int), 1, devrand);
fclose(devrand);
} else {
// if no seed from commandline available... exit
if (seed == 0) {
cerr << "No random seed available..." << endl;
return -1;
}
}
//cerr << "used seed to initialize random number generator: " << seed << endl;
srandom(seed);
// ****************************************************
// too high release point warning! (applies in case of UL-tow)
if (HOLC && VERBOSE) {
//VALID = true;
if (alt[low_index] - alt[0] > 762.195) { // 2500ft
cerr << "WARNING: Altitude difference between take-off location and release point: " <<
alt[low_index]-alt[0] << "m. This violates 4.5 in DHV Online contest Rules for 2004 (Rel. 1.5)" <<
" in the case you were towed by an UL. According to 4.5 winch launching seems to be OK." << endl;
}
}
//starting optimization cycles:
for (int u = 1; u <= cycles; u++) {
if (DEBUG)
cerr << "Cycle: " << u << endl;
max_points_cycle = 0;
if (PROGRESSION)
progression_high_index = low_index+progression;
progress_point:
if (PROGRESSION && VERBOSE) cerr << "Progression: " << low_index << " <===> " << progression_high_index << " " << '\r' << flush;
// initial model (random guesses or equidistant (index) distribution)
if (mc_cycles != 0) {
// loop for random guesses
for (unsigned long int i = 0; i <= mc_cycles; i++) {
//if (DEBUG)
// cerr << "Monte Carlo random guess: " << i << " " << '\r' << flush;
montecarlo();
}
} else { //start with uniform distribution
if (PROGRESSION) {exit(0);}
if (DEBUG)
cerr << "No Monte Carlo guesses. Starting with \"uniform distribution\"" << endl;
int intervall =
(high_index - low_index) / (wps + 1);
//cerr << low_index << " <---> " << high_index << endl;
for (int z = 0; z < wps; z++) {
max_task_cycle[z] =
low_index + (z + 1) * intervall;
}
}
if (!SIMANNEALING) {
// Metropolis MC cycles
unsigned long int zaehler = 0;
while (zaehler < met_mc_cycles) {
zaehler++;
//if (DEBUG)
// cerr << "Metropolis Monte Carlo: " << zaehler << " " << '\r' << flush;
metropolismontecarlo();
}
} else {
// SIMULATED ANNEALING
sa_t=0;
sa_temp=temperature(sa_t);
while (sa_temp >= 0.0001) {
SA_CHANGED = false;
if (sa_i < sa_nt) {
metropolismontecarlo();
if (!SA_CHANGED)
sa_i++;
} else {
sa_i = 1;
sa_t++;
sa_temp=temperature(sa_t);
temp_done++;
if (VERBOSE)
cerr << "Temp: " << sa_temp << " Pts: " << max_points_cycle << " KM: " << opt_km_cycle << " "<<'\r' << flush;
}
}
}
//if (DEBUG) cerr << endl;
if (PROGRESSION) {
progression_high_index += progression;
if (progression_high_index <= high_index) {goto progress_point;}
}
// brute force refinement +- n
vector <int> _p = max_task_cycle; // this one stays constant (for the loops)
vector <int> _pp = max_task_cycle;// this one contains the actual try
// so far this only works for wps == 7
if (refine > 0) {
unsigned long int bfrefc =0;
if (DEBUG) cerr << "Refine started..." <<endl;
if (max_task_cycle.size() == 7) {
for (int p0=_p[0]-refine; p0<=_p[0]+refine; p0++) {
_pp[0] = p0;
for (int p1=_p[1]-refine; p1<=_p[1]+refine; p1++) {
_pp[1] = p1;
for (int p2=_p[2]-refine; p2<=_p[2]+refine; p2++) {
_pp[2] = p2;
for (int p3=_p[3]-refine; p3<=_p[3]+refine; p3++) {
_pp[3] = p3;
for (int p4=_p[4]-refine; p4<=_p[4]+refine; p4++) {
_pp[4] = p4;
for (int p5=_p[5]-refine; p5<=_p[5]+refine; p5++) {
_pp[5] = p5;
for (int p6=_p[6]-refine; p6<=_p[6]+refine; p6++) {
_pp[6] = p6;
bfrefc++;
calc_pts_km(_pp);
//for (int s = 0; s < (int) _pp.size(); s++) {
//cerr << " " << _pp[s];
//} cerr << endl;
}}}}}}}}
if (max_task_cycle.size() == 5) {
for (int p0=_p[0]-refine; p0<=_p[0]+refine; p0++) {
_pp[0] = p0;
for (int p1=_p[1]-refine; p1<=_p[1]+refine; p1++) {
_pp[1] = p1;
for (int p2=_p[2]-refine; p2<=_p[2]+refine; p2++) {
_pp[2] = p2;
for (int p3=_p[3]-refine; p3<=_p[3]+refine; p3++) {
_pp[3] = p3;
for (int p4=_p[4]-refine; p4<=_p[4]+refine; p4++) {
_pp[4] = p4;
bfrefc++;
calc_pts_km(_pp);
//for (int s = 0; s < (int) _pp.size(); s++) {
//cerr << " " << _pp[s];
//} cerr << endl;
}}}}}}
if (DEBUG)
cerr << "Refinement cycles: " << bfrefc << endl;
}
if (max_points_cycle > max_points) {
max_points = max_points_cycle;
opt_km = opt_km_cycle;
max_task = max_task_cycle;
}
if (VERBOSE) {
//cerr << u << " cycle: km" << opt_km_cycle << " pts: " << max_points_cycle << endl;
//cerr << "Cycle " << u << " results: km: " << opt_km << " pts: "
// << max_points << endl;
cerr << "Cycle " << u << " results: pts: " << max_points_cycle << " km: "
<< opt_km_cycle << " (best: "<< max_points<<"pts / "<<opt_km<<"km)"<<endl;
}
cycleresults.push_back(max_points_cycle);
}
if (!SOLUTION && VERBOSE)
cerr << "No solution! - ??? why? -delta too negative?" <<
endl;
// this is the real result, to be get by GPLIGC (the only output to stdout (without -v))
cout << wps << " " << opt_km << " " << max_points;
for (int s = 0; s < (int) max_task.size(); s++) {
cout << " " << max_task[s];
}
cout << endl;
// gives an estimate how often the best solution comes out (% of cycles)
if (VERBOSE) {
int numbest=0;
//int cycles=1;
for (int a=0;a<=(int)cycleresults.size()-1;a++) {
//cycles++;
if (cycleresults[a] > max_points-0.001) {numbest++;}
}
float per = ((float)numbest/(float)cycleresults.size())*100.0;
cerr << "cyc: " << cycleresults.size() << " best: " << numbest << " percent: " << per << endl;
cerr << "Average mmc/cycle: " << (float) mmc_done / (float) cycles << " Steps in cooling: " << (float) temp_done / (float) cycles << endl;
cerr << "above per Trackpoint: " << ((float) mmc_done / (float) cycles) / ((float) (high_index-low_index)/(float)devisor) << endl;
cerr << "above per %: " << (((float) mmc_done / (float)cycles) / ((float) (high_index-low_index)/(float)devisor))/per << endl;
}
return 1;
}
// random number between zero and max (by jan mw krueger)
inline int random_number(double max)
{
return (int) ((max + 1) * random() / (RAND_MAX + 1.0));
}
void montecarlo(void)
{
// get the guesses for each wp
int hi;
if (PROGRESSION) {hi = progression_high_index;}
else {hi = high_index;}
for (int m = 0; m < wps; m++) {
p[m] = (
(int) (random_number((hi - low_index +1) / devisor)) * devisor) + low_index;
//cerr << "ZZZ: " << p[m] << " ";
}
sort(p.begin(), p.end());
calc_pts_km(p);
}
// ######################### MMC
void metropolismontecarlo(void)
{
int but, top, q, indexregister;
//random number (take one wp to change)
q = (int) random_number((wps - 2) - 0 + 1) + 0;
if (q == 0) {
but = low_index;
} else {
but = max_task_cycle[q - 1];
} //+1;}
if (q == wps - 1) {
top = high_index;
if (PROGRESSION) {top=progression_high_index;}
} else {
top = max_task_cycle[q + 1];
} //-1;}
//guess new wp between last and next of choosen
indexregister = ((int) (random_number((top - but)/devisor)) *devisor) + but;
p = max_task_cycle;
p[q] = indexregister;
calc_pts_km(p);
mmc_done++;
}
// calculate points and km for given indices
void calc_pts_km(vector < int >_p)
{
//sort given indices
//sort(_p.begin(), _p.end()); // PERFORMANCE ... not needed for metropolis and sim anneal
//set km and points to 0
float km = 0;
float pts = 0;
// temporary km in calc-cycle
float cyckm = 0;
// this should bes visible in the whole calc_pts_km function (for some debug-related output)
bool FAI = false;
bool TRI = false; // only for debugging output
// The "legs" vector is filles with the lengths of each leg
vector < float >legs;
// calculate distance
// General case (doesnt need to be calc for olc-fai
//if (!OLC_FAI) { ALWAYS NEEDED
for (int n = 0; n < (int) _p.size() - 1; n++) {
cyckm =
great_circle_dist(lat[_p[n]], lon[_p[n]],
lat[_p[n + 1]],
lon[_p[n + 1]]);
legs.push_back(cyckm);
km = km + cyckm;
pts = pts + cyckm * scoring[n];
}
//}
// DMST rules and HOLC rules OLC_FAI
// check for triangular task an fai-tri
if (DMST || HOLC || OLC_FAI) {
//these will be the distance of the triangular task
float km3;
// in the case of holc we need to calculate this first, because the start-end limit is 20% of km3
// triangle wp 123
if (HOLC)
km3 = legs[1] + legs[2] +
great_circle_dist(lat[_p[1]], lon[_p[1]],
lat[_p[3]], lon[_p[3]]);
// if track is closed - end point within a radius of 1km of start point (DMST and olc-fai)
// triangular
// for holc this is 20% of triangular task
float limit = 1.0;
if (HOLC) limit = 0.2 * km3;
// check the triangular task, if it is one start-end <= limit!
if (great_circle_dist (lat[_p[0]], lon[_p[0]], lat[_p[4]], lon[_p[4]]) <= limit) {
// distance from wp2-wp3-wp4-wp2 (wp1 is start, wp5 is finish)
// calc only for dmst here, for holc we have done this before (saves some time)
if (DMST || OLC_FAI)
km3 = legs[1] + legs[2] +
great_circle_dist(lat[_p[1]], lon[_p[1]],
lat[_p[3]], lon[_p[3]]);
// lengths of legs of triangular task
vector < float >legs3;
legs3.push_back(legs[1]);
legs3.push_back(legs[2]);
legs3.push_back(great_circle_dist
(lat[_p[1]], lon[_p[1]], lat[_p[3]],
lon[_p[3]]));
// sort them for FAI task checking
sort(legs3.begin(), legs3.end());
// check for FAI task
FAI = false;
if (km3 < 500) {
// leg3[0] is the shortest leg
if ((legs3[0] / km3) >= 0.28)
FAI = true;
}
if (km3 >= 500) {
if ((legs3[0] / km3) >= 0.25
&& (legs[2] / km3) <= 0.45)
FAI = true;
}
// add 15% if its an FAI task (DMSt WO 4.2)
// calc points seperate, to compare with "plain task" later
float fai_pts;
float tri_pts;
//float tri_km;
// OLC_FAI 3 legs, 1pt/km <== scheint so zu sein!
if (OLC_FAI && FAI) {
pts = km3;
km = km3;
}
// FAI adds 15% for DMST, and check if the FAI-task will have more points
if (DMST && FAI) {
fai_pts = km3 * 1.15;
if (fai_pts > pts) {
pts = fai_pts;
km = km3;
}
}
// FAI task will have km3 * 2 pts!
if (HOLC && FAI) {
fai_pts = (km3
- great_circle_dist(lat[_p[0]], lon[_p[0]], lat[_p[4]],lon[_p[4]]) ) * 2.0;
if (fai_pts > pts) {
pts = fai_pts;
km = km3- great_circle_dist(lat[_p[0]], lon[_p[0]], lat[_p[4]],lon[_p[4]]);
}
}
// triangluar task will have km3 * 1.75 pts!
if (HOLC && !FAI) {
tri_pts = (km3 - great_circle_dist(lat[_p[0]], lon[_p[0]], lat[_p[4]],lon[_p[4]])) *1.75;
if (tri_pts > pts) {
pts = tri_pts;
km = km3- great_circle_dist(lat[_p[0]], lon[_p[0]], lat[_p[4]],lon[_p[4]]);
TRI = true;
}
}
}
}
// ######## CHECKING THE TASK
// now points and km are calculated
// now we need to check if the task is valid or not (alt difference, etc)
// save better task, check altitude difference...
//altitude diff for olc differs from alt diff for dmst (is like FAI sporting code III (1999,AL4, 1.2.8 and 1.4.7)
if (pts > max_points_cycle || SIMANNEALING) {
// valid-task-flag.
bool VALID = false;
int start_alt = 100000;
int finish_alt = -100000;
// this is the olc-style altitude difference checking!
if (OLC_CLASS || OLC_FAI) {
// get lowest point between release and first wp (start)
for (int n = low_index; n <= _p[0]; n++) {
if (alt[n] < start_alt)
start_alt = alt[n];
}
// get highest point between finish (last wp) and landing (or engine start etc)
for (int n = _p[_p.size() - 1]; n <= high_index; n++) {
if (alt[n] > finish_alt)
finish_alt = alt[n];
}
// avoid task with too big altitude difference
if (start_alt - finish_alt < delta_h)
VALID = true;
}
if (OLC_FAI && !FAI)
VALID=false;
if (DMST) {
// dmst alt diff like FAI Sporting Code III
// 1999, AL4, 1.2.8 1.4.7
start_alt = alt[_p[0]];
finish_alt = alt[_p.size()-1];
int release_alt = alt[low_index];
int diff1 = start_alt - finish_alt;
int diff2 = release_alt - finish_alt;
if (diff1 < 1000 || diff2 < 1000)
VALID=true;
}
if (HOLC)
VALID = true;
// check for minimum distance between WP's (DMSt WO 4.1)
// nur zwischen WPs, also nicht start und endpunkt???
// this seems to be removed from 4.1 in 2004 ?
// check this out too!
if (DMST) {
if (great_circle_dist
(lat[_p[1]], lon[_p[1]], lat[_p[2]],
lon[_p[2]]) < 10.0
|| great_circle_dist(lat[_p[2]], lon[_p[2]],
lat[_p[3]],
lon[_p[3]]) < 10.0
|| great_circle_dist(lat[_p[3]], lon[_p[3]],
lat[_p[1]],
lon[_p[1]]) < 10.0)
VALID = false;
}
// save better and valid task
if (VALID && !SIMANNEALING) {
// save better task...
max_task_cycle = _p;
opt_km_cycle = km;
max_points_cycle = pts;
SOLUTION = true;
}
if (VALID && SIMANNEALING) {
if (pts > max_points_cycle) {
max_task_cycle = _p;
opt_km_cycle = km;
max_points_cycle = pts;
SOLUTION = true;
SA_CHANGED=true;
//cerr << "pts: " << pts << endl;
} else {
float prob = exp(- (max_points_cycle-pts)/sa_temp);
//cerr << "diff: " << max_points_cycle-pts << endl;
float randno = (float) random() / (float) RAND_MAX;
//cerr << "prob = " << prob << " rand = " << randno << endl;
if (randno < prob && !(prob==1.0)) {
max_task_cycle = _p;
opt_km_cycle = km;
max_points_cycle = pts;
SOLUTION = true;
SA_CHANGED=true;
//cerr << "pts: " << pts << " !!" << endl;
}
}
}
if (DEBUG && !VALID)
cerr << endl << "Invalid Task omitted!" << endl;
if (DEBUG && VALID && !SIMANNEALING) {
cerr << "Task improved: " << km << " " << pts << " " << endl;
if (DMST && FAI) cerr << "DMST and FAI! 15% bonus applied!"<<endl;
if (HOLC && FAI) cerr << "HOLC and FAI! 2pts/km!" << endl;
if (HOLC && TRI) cerr << "HOLC triangular! 1.75pts/km!" << endl;;
// cerr << endl;
}
}
}
// temperature function for sim anneal
float temperature (int _t) {
//simple linear temp function
if (SA_LINEAR)
return (-sa_param_a * (float) _t + sa_param_b);
if (SA_EXP)
return (sa_param_a*exp(-sa_param_b*(float)_t));
return 0;
}
// not usefull. range of double is 1.7E +/- 308 (too small)
double factorial(int n) {
double fac=1;
for (int x=n;x>1;x--) {
fac*=x;
//cerr << fac << " ";
}
return fac;
}
double binomial(int n, int k) {
return factorial(n)/(factorial(k)*factorial(n-k));
}

572
src/points.cpp Normal file
View File

@ -0,0 +1,572 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
#include "points.h"
#include "GLexplorer.h"
#include "oglexfunc.h"
#include "ego.h"
#include "projection.h"
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#ifndef __OSX__
#include <GL/glu.h>
#include <GL/glut.h>
#else
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#endif
//const std::string rcsid_points_cpp =
// "$Id: points.cpp 3 2014-07-31 09:59:20Z kruegerh $";
//const std::string rcsid_points_h = POINTS_H;
Points::Points()
{
n = 0;
}
int
Points::readLiftsFile(string _filename)
{
Timecheck readigc("ReadLifts",conf_pointer);
ifstream liftsfile;
liftsfile.open(_filename.c_str());
if (!liftsfile) { cerr << "error opening :" << _filename << endl; exit (1);}
n = 0;
x.clear();
y.clear();
z.clear();
dectime.clear();
date.clear();
fname.clear();
alt.clear();
lat.clear();
lon.clear();
int line_counter=0;
int line_valid=0;
char zeile[180];
char d[20];
char f[100];
int _alt;
float _lat, _lon,_dectime,_var,_ivar;//_latsum=0,_lonsum=0;
while (liftsfile) {
liftsfile.getline(zeile, 180, '\n');
line_counter++;
if (sscanf(zeile,
"%f %f %d %f %f %f %s %s",
&_lat, &_lon, &_alt, &_ivar, &_var,&_dectime, d, f) != 8) {
if(conf_pointer->VERBOSE.get()){
cout << "error parsing liftsfile line: " << zeile << endl;
}
} else {
if (conf_pointer->DEBUG.get()) {
cout << "lat:" << _lat << " lon:" << _lon << " alt:" << _alt << " dect:" << _dectime << " ivar:" << _ivar << " var:" << _var << " date:" << d << " file:" << f << endl;
}
line_valid++;
n++;
dectime.push_back(_dectime);
alt.push_back(_alt);
var.push_back(_var);
ivar.push_back(_ivar);
lat.push_back(_lat);
//_latsum += _lat;
//_lonsum += _lon;
lon.push_back(_lon);
date.push_back((string)d);
fname.push_back((string)f);
}
}
liftsfile.close();
if (conf_pointer->VERBOSE.get()) {
cout << line_counter << " lines of lifts-file read" << endl
<< " valid lines: " << line_valid << endl;
}
/*
center_lat = _latsum / (double) n; //startwerte
center_lon = _lonsum / (double) n;
//startwerte fuer maxima/minima
latmax = center_lat;
latmin = center_lat;
lonmin = center_lon;
lonmax = center_lon;
altmax = center_alt;
altmin = center_alt;
// determination of maxima and minima in original data
for (int _q = 0; _q < n; _q++) {
if (lat[_q] < latmin)
latmin = lat[_q];
if (lat[_q] > latmax)
latmax = lat[_q];
if (lon[_q] < lonmin)
lonmin = lon[_q];
if (lon[_q] > lonmax)
lonmax = lon[_q];
if (alt[_q] < altmin)
altmin = alt[_q];
if (alt[_q] > altmax)
altmax = alt[_q];
}
//real centers
center_lat = (latmin + latmax) / 2;
center_lon = (lonmin + lonmax) / 2;
center_alt = (altmin + altmax) / 2;
*/
//proj_pointer->set_center
//cout << "test" << endl << flush;
//cout << proj_pointer->get_center_lat() << endl << flush;
//calculate x,y and z values (now using the projection object)!
for (int _q = 0; _q < n; _q++) {
//cout << "_q" << _q << endl <<flush;
//cout << "lat:" <<lat[_q] <<" lon:"<< lon[_q] << endl << flush;
float _ykmdist, _xkmdist;
proj_pointer->get_xy(lat[_q], lon[_q], _xkmdist, _ykmdist);
x.push_back(-_xkmdist);
y.push_back(-_ykmdist);
//z is altitude in km
z.push_back(alt[_q] / 1000.0);
}
// WOFÜR
/*
// startwerte fuer xyz max und minima
xmin = 0;
ymin = 0;
zmin = center_alt / 1000.0;
xmax = 0;
ymax = 0;
zmax = center_alt / 1000.0;
for (int _i = 0; _i < n; _i++) {
if (x[_i] < xmin) {
xmin = x[_i];
}
if (x[_i] > xmax) {
xmax = x[_i];
}
if (y[_i] < ymin) {
ymin = y[_i];
}
if (y[_i] > ymax) {
ymax = y[_i];
}
if (z[_i] < zmin) {
zmin = z[_i];
}
if (z[_i] > zmax) {
zmax = z[_i];
}
}
xcenter = (xmin + xmax) / 2;
ycenter = (ymin + ymax) / 2;
zcenter = (zmin + zmax) / 2;
*/
readigc.checknow("readigc end");
return 1;
}
// stupidly cloned from lifts
int
Points::readWaypointsFile(string _filename)
{
Timecheck readigc("ReadWaypoints",conf_pointer);
ifstream liftsfile;
liftsfile.open(_filename.c_str());
if (!liftsfile) { cerr << "error opening :" << _filename << endl; exit (1);}
n = 0;
x.clear();
y.clear();
z.clear();
dectime.clear();
date.clear();
fname.clear();
symbol.clear();
name.clear();
describtion.clear();
alt.clear();
lat.clear();
lon.clear();
int line_counter=0;
int line_valid=0;
char zeile[180];
char d[100];
char f[100];
char g[100];
int _alt;
float _lat, _lon;//_latsum=0,_lonsum=0;
while (liftsfile) {
liftsfile.getline(zeile, 180, '\n');
line_counter++;
// this is changed (from lifts)
// wpt format is:
// lat lon alt descshort namelong symbol
if (sscanf(zeile,
" %f %f %d %s %s %s",
&_lat, &_lon, &_alt, d, f,g) != 6) {
if(conf_pointer->VERBOSE.get()){
cout << "error parsing waypoints line: " << zeile << endl;
}
} else {
if (conf_pointer->DEBUG.get()) {
cout << "lat:" << _lat << " lon:" << _lon << " alt:" << _alt << " name:" << d << " name:" << f << " symbol:" << g << endl;
}
line_valid++;
n++;
//dectime.push_back(0);
alt.push_back(_alt);
//var.push_back(0);
//ivar.push_back(0);
lat.push_back(_lat);
//_latsum += _lat;
//_lonsum += _lon;
lon.push_back(_lon);
//date.push_back((string)d);
name.push_back((string)d);
describtion.push_back((string)f);
symbol.push_back((string)g);
}
}
liftsfile.close();
if (conf_pointer->VERBOSE.get()) {
cout << line_counter << " lines of wpts-file read" << endl
<< " valid lines: " << line_valid << endl;
}
/*
center_lat = _latsum / (double) n; //startwerte
center_lon = _lonsum / (double) n;
//startwerte fuer maxima/minima
latmax = center_lat;
latmin = center_lat;
lonmin = center_lon;
lonmax = center_lon;
altmax = center_alt;
altmin = center_alt;
// determination of maxima and minima in original data
for (int _q = 0; _q < n; _q++) {
if (lat[_q] < latmin)
latmin = lat[_q];
if (lat[_q] > latmax)
latmax = lat[_q];
if (lon[_q] < lonmin)
lonmin = lon[_q];
if (lon[_q] > lonmax)
lonmax = lon[_q];
if (alt[_q] < altmin)
altmin = alt[_q];
if (alt[_q] > altmax)
altmax = alt[_q];
}
//real centers
center_lat = (latmin + latmax) / 2;
center_lon = (lonmin + lonmax) / 2;
center_alt = (altmin + altmax) / 2;
*/
//proj_pointer->set_center
//cout << "test" << endl << flush;
//cout << proj_pointer->get_center_lat() << endl << flush;
//calculate x,y and z values (now using the projection object)!
for (int _q = 0; _q < n; _q++) {
//cout << "_q" << _q << endl <<flush;
//cout << "lat:" <<lat[_q] <<" lon:"<< lon[_q] << endl << flush;
float _ykmdist, _xkmdist;
proj_pointer->get_xy(lat[_q], lon[_q], _xkmdist, _ykmdist);
x.push_back(-_xkmdist);
y.push_back(-_ykmdist);
//z is altitude in km
z.push_back(alt[_q] / 1000.0);
}
/*
// startwerte fuer xyz max und minima
xmin = 0;
ymin = 0;
zmin = center_alt / 1000.0;
xmax = 0;
ymax = 0;
zmax = center_alt / 1000.0;
for (int _i = 0; _i < n; _i++) {
if (x[_i] < xmin) {
xmin = x[_i];
}
if (x[_i] > xmax) {
xmax = x[_i];
}
if (y[_i] < ymin) {
ymin = y[_i];
}
if (y[_i] > ymax) {
ymax = y[_i];
}
if (z[_i] < zmin) {
zmin = z[_i];
}
if (z[_i] > zmax) {
zmax = z[_i];
}
}
xcenter = (xmin + xmax) / 2;
ycenter = (ymin + ymax) / 2;
zcenter = (zmin + zmax) / 2;
*/
readigc.checknow("readigc end");
return 1;
}
void Points::drawLifts(bool BW)
{
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
float col[3] = {conf_pointer->lifts_color_r.get(), conf_pointer->lifts_color_g.get(), conf_pointer->lifts_color_b.get()};
if (BW) {
glColor3fv(graycolor(col));
} else {
glColor3fv(col);
}
for (int _q = 0; _q < n; _q++) {
if (lat[_q]>=latmin && lat[_q]<=latmax && lon[_q]>= lonmin && lon[_q] <=lonmax) {
glPushMatrix();
glTranslatef(x[_q],y[_q],z[_q]);
glScalef(1, 1, 1 / conf_pointer->z_scale.get());
glutSolidSphere(conf_pointer->MARKER_SIZE.get()*0.25, 10,10 );
glPopMatrix();
if (conf_pointer->CURTAIN.get()) {
glBegin(GL_LINES);
glVertex3f(x[_q],y[_q],z[_q]);
glVertex3f(x[_q],y[_q],0);
glEnd();
}
}
}
glPopAttrib();
}
void Points::drawWaypoints(bool BW)
{
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
float col[3] = {conf_pointer->waypoints_color_r.get(), conf_pointer->waypoints_color_g.get(), conf_pointer->waypoints_color_b.get()};
if (BW) {
glColor3fv(graycolor(col));
} else {
glColor3fv(col);
}
float offset=0;
if (!conf_pointer->WAYPOINTS_OFFSET_TEXT_ONLY.get()) {
offset=conf_pointer->waypoints_offset.get() / 1000.0;
}
for (int _q = 0; _q < n; _q++) {
if (lat[_q]>=latmin && lat[_q]<=latmax && lon[_q]>= lonmin && lon[_q] <=lonmax) {
glPushMatrix();
glTranslatef(x[_q],y[_q],z[_q]+offset);
glScalef(1, 1, 1 / conf_pointer->z_scale.get());
glutSolidSphere(conf_pointer->MARKER_SIZE.get()*0.25, 10,10 );
glPopMatrix();
if (conf_pointer->CURTAIN.get()) {
glBegin(GL_LINES);
glVertex3f(x[_q],y[_q],z[_q]+offset);
glVertex3f(x[_q],y[_q],0);
glEnd();
}
}
}
glPopAttrib();
}
void Points::drawLiftsTxt(bool BW, Ego *egopointer)
{
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
float col[3] = {conf_pointer->text_color_r.get(), conf_pointer->text_color_g.get(), conf_pointer->text_color_b.get()};
if (BW) {
glColor3fv(graycolor(col));
} else {
glColor3fv(col);
}
for (int _q = 0; _q < n; _q++) {
if (lat[_q]>=latmin && lat[_q]<=latmax && lon[_q]>= lonmin && lon[_q] <=lonmax) {
glPushMatrix();
glTranslatef(x[_q],y[_q],z[_q]+((conf_pointer->MARKER_SIZE.get()*0.25)/conf_pointer->z_scale.get()));
glScalef(conf_pointer->pTextSize.get(),conf_pointer->pTextSize.get(), conf_pointer->pTextSize.get() / conf_pointer->z_scale.get());
// rotate fo face the viewpoint!
if (!conf_pointer->ORTHOVIEW.get()) {
glRotatef(-egopointer->getspinz(), 0.0, 0.0, 1.0);
glRotatef(360.0-egopointer->getspinx(), 1.0, 0.0, 0.0);
}
char txt[100];
// option for different textstrings
if (conf_pointer->lifts_info_mode.get() == 1)
sprintf(txt,"%.1f",ivar[_q]*conf_pointer->getvspeed_unit_fac());
if (conf_pointer->lifts_info_mode.get() == 2)
sprintf(txt,"%.1f",var[_q]*conf_pointer->getvspeed_unit_fac());
if (conf_pointer->lifts_info_mode.get() == 3)
sprintf(txt,"%.0f",alt[_q]*conf_pointer->getalt_unit_fac());
if (conf_pointer->lifts_info_mode.get() == 4)
sprintf(txt,"%s",dec2humantime(dectime[_q],2).c_str());
if (conf_pointer->lifts_info_mode.get() == 5)
sprintf(txt,"%s",dec2humantime(dectime[_q],3).c_str());
if (conf_pointer->lifts_info_mode.get() == 6)
sprintf(txt,"%s",date[_q].c_str());
if (conf_pointer->lifts_info_mode.get() == 7)
sprintf(txt,"%s",fname[_q].c_str());
glLineWidth(conf_pointer->text_width.get());
for (const char *p = txt; *p; p++)
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);
//glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, *p);
glPopMatrix();
}
}
glLineWidth(1.0);
glPopAttrib();
}
void Points::drawWaypointsTxt(bool BW, Ego *egopointer)
{
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
float col[3] = {conf_pointer->text_color_r.get(), conf_pointer->text_color_g.get(), conf_pointer->text_color_b.get()};
if (BW) {
glColor3fv(graycolor(col));
} else {
glColor3fv(col);
}
float orthooffset=0;
if (conf_pointer->ORTHOVIEW.get()) orthooffset=2.0;
for (int _q = 0; _q < n; _q++) {
if (lat[_q]>=latmin && lat[_q]<=latmax && lon[_q]>= lonmin && lon[_q] <=lonmax) {
glPushMatrix();
glTranslatef(x[_q],y[_q],z[_q]+conf_pointer->waypoints_offset.get()/1000.0
+orthooffset+((conf_pointer->MARKER_SIZE.get()*0.25)/conf_pointer->z_scale.get()));
glScalef(conf_pointer->pTextSize.get(),conf_pointer->pTextSize.get(), conf_pointer->pTextSize.get() / conf_pointer->z_scale.get());
// rotate fo face the viewpoint!
if (!conf_pointer->ORTHOVIEW.get()) {
glRotatef(-egopointer->getspinz(), 0.0, 0.0, 1.0);
glRotatef(360.0-egopointer->getspinx(), 1.0, 0.0, 0.0);
}
char txt[100];
// option for different textstrings
if (conf_pointer->waypoints_info_mode.get() == 1)
sprintf(txt,"%s",describtion[_q].c_str());
if (conf_pointer->waypoints_info_mode.get() == 2)
sprintf(txt,"%s",name[_q].c_str());
if (conf_pointer->waypoints_info_mode.get() == 3)
sprintf(txt,"%.0f",alt[_q]*conf_pointer->getalt_unit_fac());
if (conf_pointer->waypoints_info_mode.get() == 4)
sprintf(txt,"%s",symbol[_q].c_str());
/*if (conf_pointer->waypoints_info_mode.get() == 5)
sprintf(txt,"%s",dec2humantime(dectime[_q],3).c_str());
if (conf_pointer->waypoints_info_mode.get() == 6)
if (conf_pointer->waypoints_info_mode.get() == 7)
sprintf(txt,"%s",fname[_q].c_str());*/
glLineWidth(conf_pointer->text_width.get());
for (const char *p = txt; *p; p++)
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);
//glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, *p);
glPopMatrix();
}
}
glLineWidth(1.0);
glPopAttrib();
}

80
src/points.h Normal file
View File

@ -0,0 +1,80 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*/
/*
DESCRIPTION:
class for points of interest (lifts, waypoints, etc)
*/
#ifndef POINTS_H
#define POINTS_H 1
#include <vector>
#include <string>
#ifndef __OSX__
#include <GL/gl.h>
#else
#include <OpenGL/gl.h>
#endif
#include "oconfig.h"
#include "oglexfunc.h"
#include "projection.h"
#include "ego.h"
class Points {
public:
Points();
int readLiftsFile (string);
int readWaypointsFile (string);
void set_proj_pointer(Projection *p) { proj_pointer = p;}
void set_conf_pointer(Config *c) { conf_pointer = c;}
void drawLifts(bool BW);
void drawLiftsTxt(bool BW, Ego *egopointer);
void drawWaypoints(bool BW);
void drawWaypointsTxt(bool BW, Ego *egopointer);
void setDegRanges(float _latmax, float _latmin, float _lonmax, float _lonmin) {
latmax=_latmax;latmin=_latmin;lonmax=_lonmax;lonmin=_lonmin; }
protected:
int n; //number of data points
vector < float >x; //km from center
vector < float >y;
vector < float >z; //height in km
vector < float >lat;
vector < float >lon;
vector < float >alt; //height in m
vector < float >var;
vector < float >ivar;
vector <float> dectime;
vector <string> fname;
vector <string> date;
vector <string> describtion;
vector <string> name;
vector < string > symbol;
//double center_lat;
//double center_lon, center_alt;
double latmax, lonmax, altmax, altmin, latmin, lonmin;// zmax,zmin,xmax,xmin,ymax,ymin,xcenter,ycenter,zcenter;
vector < float > vario;
char *filename; //name fdatafile
Projection *proj_pointer; //the projection-class pointer
Config *conf_pointer; // config-pointer
};
#endif

198
src/projection.cpp Normal file
View File

@ -0,0 +1,198 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
#include "projection.h"
#include <string>
#include <iostream>
#include <cmath>
#include <cstdlib>
//const std::string rcsid_projection_cpp =
// "$Id: projection.cpp 3 2014-07-31 09:59:20Z kruegerh $";
//const std::string rcsid_projection_h = PROJECTION_H;
Projection::Projection()
{
sphere_radius = 6371.0;
// this is 1 in km on a great circle
degree_dist = (2 * M_PI * sphere_radius) / 360.0;
// this is the default
projection = PROJ_PSEUDO_CYL_NO1;
// 9999 is the "not set"-flag
center_lat = 9999;
center_lon = 9999;
}
void
Projection::get_xy(float lat, float lon, float &x, float &y)
{
//std::cout << "ENTERING proj::get_xy" << std::flush;
//std::cout << "ENTERING proj::get_xy" << center_lat << " " << center_lon << std::endl << std::flush;
if (center_lat == 9999 || center_lon == 9999) {
std::
cerr << "Projection class: get_xy: center isn't set!"
<< std::endl;
return;
}
if (lat > 90)
lat = 90;
if (lat < -90)
lat = -90;
// This pseudo cylindrical projection has true lengths on meridians and latitude circles...
if (projection == PROJ_PSEUDO_CYL_NO1) {
float latdiff = center_lat - lat;
float londiff = center_lon - lon;
y = latdiff * degree_dist;
x = londiff * degree_dist * cos((M_PI / 180.0) * lat);
return;
}
// This cylindrical projection has true lengths on meridian only
if (projection == PROJ_CYL_NO1) {
y = (center_lat - lat) * degree_dist;
x = (center_lon - lon) * degree_dist;
return;
}
// platt(?) (Flaechentreu)
if (projection == PROJ_CYL_PLATT) {
float aequatdist_center =
sin(center_lat * (M_PI / 180.0)) * sphere_radius;
float aequatdist_point =
sin(lat * (M_PI / 180.0)) * sphere_radius;
y = aequatdist_center - aequatdist_point;
x = (center_lon - lon) * degree_dist;
return;
}
if (projection == PROJ_CYL_MERCATOR) {
x = sphere_radius * (center_lon * (M_PI / 180.0) -
lon * (M_PI / 180.0));
//x = (center_lon - lon) * degree_dist;
//std::cout << x << std::endl;
float sign = 1.0;
if (lat < 0)
sign = -1.0;
float aequatdist_point =
-sign * sphere_radius *
log(tan
((M_PI / 4.0) +
((fabs(lat) * (M_PI / 180.0)) / 2.0)));
float sign_c = 1.0;
if (center_lat < 0)
sign_c = -1.0;
float aequatdist_center =
-sign_c * sphere_radius *
log(tan
((M_PI / 4.0) +
((fabs(center_lat) * (M_PI / 180.0)) / 2.0)));
y = -(aequatdist_center - aequatdist_point);
return;
}
std::cerr << "No valid projection....." << std::endl;
exit(1);
}
void Projection::get_latlon(float x, float y, float &lat, float &lon)
{
if (center_lat == 9999 || center_lon == 9999) {
std::
cerr <<
"Projection class: get_latlon: center isn't set!" <<
std::endl;
return;
}
// this is 1 in km on a great circle
degree_dist = (2 * M_PI * sphere_radius) / 360.0;
if (projection == PROJ_PSEUDO_CYL_NO1) {
lat = center_lat + (y / degree_dist);
lon =
center_lon +
(x / (degree_dist * cos((M_PI / 180.0) * lat)));
return;
}
if (projection == PROJ_CYL_NO1) {
lat = center_lat + (y / degree_dist);
lon = center_lon + (x / degree_dist);
return;
}
if (projection == PROJ_CYL_PLATT) {
lon = center_lon + (x / degree_dist);
float aequatdist_center =
sin(center_lat * (M_PI / 180.0)) * sphere_radius;
lat =
asin((y +
aequatdist_center) / sphere_radius) / (M_PI /
180.0);
return;
}
if (projection == PROJ_CYL_MERCATOR) {
lon = center_lon + (x / degree_dist);
float sign_c = 1.0;
if (center_lat < 0)
sign_c = -1.0;
float aequatdist_center =
-sign_c * sphere_radius *
log(tan
((M_PI / 4.0) +
((fabs(center_lat) * (M_PI / 180.0)) / 2.0)));
float northing = aequatdist_center - y;
lat =
-(2.0 * atan(exp(northing / sphere_radius)) -
(M_PI / 2.0)) / (M_PI / 180.0);
return;
}
std::cerr << "No valid projection....." << std::endl;
exit(1);
}

53
src/projection.h Normal file
View File

@ -0,0 +1,53 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*/
#ifndef PROJECTION_H
#define PROJECTION_H 1
//definitions of usable projections:
const int MERCATOR_MAX_LAT = 80;
// cylindrical "platt" projection
const unsigned int PROJ_CYL_PLATT = 1;
const unsigned int PROJ_CYL_MERCATOR = 2;
// laengentreu auf meridianen
const unsigned int PROJ_CYL_NO1 = 3;
// laengentreu auf meridianen und breitenkreisen (old default)
const unsigned int PROJ_PSEUDO_CYL_NO1 = 4;
class Projection {
public:
Projection();
void set_center_lat (float lat) {center_lat = lat;}
void set_center_lon (float lon) {center_lon = lon;}
float get_center_lat (void) const {return center_lat;}
float get_center_lon (void) const {return center_lon;}
void set_projection (unsigned int p) {projection = p;}
unsigned int get_projection (void) const {return projection;}
void get_xy (float, float, float&, float&);
void get_latlon (float, float, float&, float&);
protected:
float center_lat;
float center_lon;
unsigned int projection;
float sphere_radius;
float degree_dist;
};
#endif

110
src/value.h Normal file
View File

@ -0,0 +1,110 @@
/*
* (c) 2002-2016 Hannes Krueger
* This file is part of the GPLIGC/ogie package
*/
#ifndef VALUE_H
#define VALUE_H 1
#include <iostream>
// ATTENTION this template is not suitable for unsigned
template <typename T> class Value
{
private:
T value;
T max;
T min;
public:
Value() {};
Value (T _val, T _min, T _max);
T get(void) const {return value;}
void init(T _val, T _min, T _max);
void set(T _val) ;
void inc(T);
void dec(T);
void setmax(T _max) { max = _max;}
T getmax(void) { return max;}
void setmin(T _min) {min = _min;}
T getmin(void) {return min;}
};
template <typename T>
Value<T>::Value(T _val, T _min, T _max)
{
value = _val;
min = _min;
max = _max;
if (value < min) {
value = min;
std::cerr << "tried to set value out of range... (min:" << min << ", tried:" << value << "). " << std::endl;
}
if (value > max) {
value = max;
std::cerr << "tried to set value out of range... (max:" << max << ", tried:" << value << "). " << std::endl;
}
}
template <typename T>
void Value<T>::init(T _val, T _min, T _max)
{
value = _val;
min = _min;
max = _max;
if (value < min) {
value = min;
std::cerr << "tried to set value out of range... (min:" << min << ", tried:" << value << "). " << std::endl;
}
if (value > max) {
value = max;
std::cerr << "tried to set value out of range... (max:" << max << ", tried:" << value << "). " << std::endl;
}
}
template <typename T>
void Value<T>::inc(T _inc)
{
value += _inc;
if (value > max)
value = max;
}
template <typename T>
void Value<T>::dec(T _dec)
{
value -= _dec;
if (value < min)
value = min;
}
template <typename T>
void Value<T>::set(T _val)
{
value = _val;
if (value < min) {
value = min;
std::cerr << "tried to set value out of range... (min:" << min << ", tried:" << value << "). " << std::endl;
}
if (value > max) {
value = max;
std::cerr << "tried to set value out of range... (max:" << max << ", tried:" << value << "). " << std::endl;
}
}
#endif

344
src/write_jpeg.c Normal file
View File

@ -0,0 +1,344 @@
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
******************** JPEG COMPRESSION INTERFACE ***************************
***************************************************************************/
#include <math.h>
#include <setjmp.h>
#include <stdlib.h>
#include <stdio.h>
#include <jpeglib.h>
//static const char *rcsid_write_jpeg_c =
// "$Id: write_jpeg.c 3 2014-07-31 09:59:20Z kruegerh $";
struct my_error_mgr {
struct jpeg_error_mgr pub; /* "public" fields */
jmp_buf setjmp_buffer; /* for return to caller */
};
typedef struct my_error_mgr *my_error_ptr;
/*
* Here's the routine that will replace the standard libjpeg error_exit method:
*/
METHODDEF(void) my_error_exit(j_common_ptr cinfo)
{
/* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
my_error_ptr myerr = (my_error_ptr) cinfo->err;
/* Always display the message. */
/* We could postpone this until after returning, if we chose. */
(*cinfo->err->output_message) (cinfo);
/* Return control to the setjmp point */
longjmp(myerr->setjmp_buffer, 1);
}
void
write_JPEG_file(int image_width, int image_height, int quality,
char *jpegFileName, JSAMPLE * image_buffer)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
FILE *outfile; /* target file */
JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
int row_stride; /* physical row width in image buffer */
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_compress(&cinfo);
/* Here we use the library-supplied code to send compressed data to a
* stdio stream. You can also write your own code to do something else.
* VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
* requires it in order to write binary files.
*/
if ((outfile = fopen(jpegFileName, "wb")) == NULL) {
fprintf(stderr, "can't open %s\n", jpegFileName);
exit(1);
}
jpeg_stdio_dest(&cinfo, outfile);
cinfo.image_width = image_width; /* image width and height, in pixels */
cinfo.image_height = image_height;
cinfo.input_components = 3; /* # of color components per pixel */
cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
jpeg_set_defaults(&cinfo);
jpeg_set_quality(&cinfo, quality,
TRUE /* limit to baseline-JPEG values */ );
jpeg_start_compress(&cinfo, TRUE);
row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */
while (cinfo.next_scanline < cinfo.image_height) {
row_pointer[0] =
&image_buffer[cinfo.next_scanline * row_stride];
(void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
}
jpeg_finish_compress(&cinfo);
fclose(outfile);
jpeg_destroy_compress(&cinfo);
}
void
write_JPEG_stdout(int image_width, int image_height, int quality,
JSAMPLE * image_buffer)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
/*FILE * outfile; *//* target file */
JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
int row_stride; /* physical row width in image buffer */
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_compress(&cinfo);
/* Here we use the library-supplied code to send compressed data to a
* stdio stream. You can also write your own code to do something else.
* VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
* requires it in order to write binary files.
*/
/*
if ((outfile = fopen(jpegFileName, "wb")) == NULL) {
fprintf(stderr, "can't open %s\n", jpegFileName);
exit(1);
}
*/
jpeg_stdio_dest(&cinfo, stdout);
cinfo.image_width = image_width; /* image width and height, in pixels */
cinfo.image_height = image_height;
cinfo.input_components = 3; /* # of color components per pixel */
cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
jpeg_set_defaults(&cinfo);
jpeg_set_quality(&cinfo, quality,
TRUE /* limit to baseline-JPEG values */ );
jpeg_start_compress(&cinfo, TRUE);
row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */
while (cinfo.next_scanline < cinfo.image_height) {
row_pointer[0] =
&image_buffer[cinfo.next_scanline * row_stride];
(void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
}
jpeg_finish_compress(&cinfo);
/* fclose(outfile); */
jpeg_destroy_compress(&cinfo);
}
unsigned char *read_jpg(int *width, int *height, char *filename)
{
struct my_error_mgr jerr;
struct jpeg_decompress_struct cinfo;
/* struct my_error_mgr jerr; */
FILE *infile; /* source file */
JSAMPARRAY buffer; /* Output row buffer */
int row_stride; /* physical row width in output buffer */
int nr = 0;
int tmpint = 0;
unsigned char *map;
if ((infile = fopen(filename, "rb")) == NULL) {
fprintf(stderr, "Map::readMap_jpeg() can't open %s\n",
filename);
return NULL;
}
cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = my_error_exit;
if (setjmp(jerr.setjmp_buffer)) {
jpeg_destroy_decompress(&cinfo);
fclose(infile);
return NULL;
}
jpeg_create_decompress(&cinfo);
jpeg_stdio_src(&cinfo, infile);
(void) jpeg_read_header(&cinfo, TRUE);
(void) jpeg_start_decompress(&cinfo);
/* JSAMPLEs per row in output buffer */
row_stride = cinfo.output_width * cinfo.output_components;
map = malloc(3 * cinfo.output_width * cinfo.output_height);
/*printf("width from jpg header = %d, height = %d, components = %d\n",
cinfo.output_width,cinfo.output_height,cinfo.output_components ); */
*width = cinfo.output_width;
*height = cinfo.output_height;
/*
if(cinfo.output_components != 3){
printf("Map::readMap_jpeg() output_components = %d\n", cinfo.output_components);
}
if(cinfo.output_width != (unsigned int) width){
printf("Map::readMap_jpeg() output_width = %d\n", cinfo.output_width);
}
if(cinfo.output_height != (unsigned int) height){
printf("Map::readMap_jpeg() output_height = %d\n", cinfo.output_height);
}
*/
buffer = (*cinfo.mem->alloc_sarray)
((j_common_ptr) & cinfo, JPOOL_IMAGE, row_stride, 1);
while (cinfo.output_scanline < cinfo.output_height) {
(void) jpeg_read_scanlines(&cinfo, buffer, 1);
/* printf("scanline %d\n",cinfo.output_scanline); */
for (nr = 0; nr < (*width) * 3; nr++) {
tmpint = (int) buffer[0][nr];
/* printf("%d ",tmpint); */
map[nr +
((*width) * 3 * (cinfo.output_scanline - 1))] =
(unsigned char) tmpint;
/* cout << map[nr] << endl; */
}
/* printf("\n"); */
}
(void) jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
fclose(infile);
return map;
}
void copy_resample_image_buffer
(unsigned char *destination, unsigned char *source,
int destination_x, int destination_y, int source_x, int source_y,
int destination_width, int destination_height, int source_width,
int source_height, int source_dimw, int destination_dimw) {
/*
This function has been inspired and partially copied from an appropriate function in gd,
gdImageCopyResampled(), available in gd.c from http://www.boutell.com/gd/
2003 Jan Krueger
Usage: Only for true color (24bit) RGB arrays
We copy source buffer into destination buffer at the positions given in the
function call. The arrays must exist already.
I have tried to keep this function as universal as possible. Most parameters
will be 0 of width/height unless we are copying around image SECTIONS.
*/
int x, y; /* mark the position at destination buffer */
int source_array_pos, destination_array_pos;
for (y = destination_y; (y < destination_y + destination_height);
y++) {
/* over complete height of destination buffer */
for (x = destination_x;
(x < destination_x + destination_width); x++) {
/* over width of destination buffer scanline */
float sy1, sy2, sx1, sx2;
float sx, sy;
float spixels = 0;
float red = 0.0;
float green = 0.0;
float blue = 0.0;
sy1 = ((float) y - (float) destination_y) * (float) source_height / (float) destination_height; /* this is ycount * the y-scaling factor */
sy2 =
((float) (y + 1) -
(float) destination_y) *
(float) source_height /
(float) destination_height;
sy = sy1;
do { /* while (sy < sy2) [while we are between dest height pixels] */
float yportion;
if (floor(sy) == floor(sy1)) {
yportion = 1.0 - (sy - floor(sy));
if (yportion > sy2 - sy1) {
yportion = sy2 - sy1;
}
sy = floor(sy);
} else if (sy == floor(sy2)) {
yportion = sy2 - floor(sy2);
} else {
yportion = 1.0;
}
sx1 =
((float) x -
(float) destination_x) *
(float) source_width /
destination_width;
sx2 =
((float) (x + 1) -
(float) destination_x) *
(float) source_width /
destination_width;
sx = sx1;
do { /* while (sx < sx2) [while we are between dest width pixels] */
float xportion;
float pcontribution;
if (floor(sx) == floor(sx1)) {
xportion =
1.0 - (sx - floor(sx));
if (xportion > sx2 - sx1) {
xportion =
sx2 - sx1;
}
sx = floor(sx);
} else if (sx == floor(sx2)) {
xportion =
sx2 - floor(sx2);
} else {
xportion = 1.0;
}
pcontribution =
xportion * yportion;
source_array_pos =
3 * ((int) sx + source_x +
source_dimw * ((int) sy +
source_y));
red +=
source[source_array_pos] *
pcontribution;
green +=
source[source_array_pos +
1] * pcontribution;
blue +=
source[source_array_pos +
2] * pcontribution;
spixels += xportion * yportion;
sx += 1.0;
} while (sx < sx2);
sy += 1.0;
} while (sy < sy2);
if (spixels != 0.0) {
red /= spixels;
green /= spixels;
blue /= spixels;
}
/* Avoid overflows by rounding errors above */
if (red > 255.0) {
red = 255.0;
}
if (green > 255.0) {
green = 255.0;
}
if (blue > 255.0) {
blue = 255.0;
}
destination_array_pos =
3 * (x + y * destination_dimw);
destination[destination_array_pos] =
(unsigned char) red;
destination[destination_array_pos + 1] =
(unsigned char) green;
destination[destination_array_pos + 2] =
(unsigned char) blue;
}
}
}

69
win/README_windows.txt Normal file
View File

@ -0,0 +1,69 @@
GPLIGC/OGIE for windows
Author:
Hannes Krueger
Bug reports / Support / Forum
http://sourceforge.net/projects/gpligc/support
Mailing list
There is a gpligc-announce mailing list, which will inform you about any updates
(extreme low traffic)
https://lists.sourceforge.net/lists/listinfo/gpligc-announce
This mailing list is also used by the author to estimate the number of users
For detailed information about installation and usage
read the manual (GPLIGC_Manual.pdf)
Installation:
Before the installation can be performed using the
install_windows.pl
script, Perl has to be installed. If you dont have Perl
installed, visit
http://www.strawberryperl.com
to download and install the free Perl distribution.
Subsequently, the installation of GPLIGC/Ogie can be
carried out by running the install_windows.pl script.
IMPORTANT!!!
Dont run the install_windows.pl script from within
the zip-archive. Unpack the archive first!
For running GPLIGC the Perl Tk module is needed
(installation details are given in the GPLIGC_Manual.pdf)
OGIE can be used from the commandline or from within GPLIGC
more details can be found in the GPLIGC_Manual.pdf
GPLIGC/OGIE is covered by the GPLv3 license,
which is included in the Manual (and file COPYING)
This zip package does not contain the full source-code.
The sources are available at the GPLIGC website.
The executable files of this software (ogie, etc.) are compiled
using MinGW / MSYS (www.mingw.org).
This package contains third party software:
libglut-0.dll
see freeglut.sourceforge.net
freeglut is a completely OpenSourced alternative to
the OpenGL Utility Toolkit (GLUT) library.
freeglut is released under the X-Consortium license.
libjpeg-9.dll
Ogie is based in part on the work of the Independent
JPEG Group. Ogie uses the jpeg-library functions, therefore
a compiled (using mingw) version of this library is
included. For more information see:
http://www.ijg.org/
wgnuplot.exe
gnuplot 4.2.6 executable file for use with GPLIGC.
copyright/license details for gnuplot can be found in the file
Copyright-gnuplot
more details/info/and sourcecode can be found at
https://sourceforge.net/projects/gnuplot/files/gnuplot/4.2.6/
www.gnuplot.info

327
win/install_windows.pl Executable file
View File

@ -0,0 +1,327 @@
# GPLIGC Installer Windows
# $Id: install_windows.pl 9 2014-08-01 10:52:42Z kruegerh $
use Win32;
use Win32::TieRegistry(Delimiter=>"/");
use File::Copy;
$email ="Hannes.Krueger\@gmail.com";
$close_delay = 60;
print <<ENDE;
GPLIGC and OGIE installation (Windows XP/Vista)
should work on Win2003, Win2008 and Win7 too, but was not tested yet!
(c) 2000-2014 by Hannes Krueger ($email)
read the GPLIGC_Manual.pdf for more information
Enter installation directory. Press enter for default.
ENDE
# Ask for installation directory
installdirinput:
print "[c:\\GPLIGC]: ";
chomp($installdir=<>);
if ($installdir eq "") {$installdir="c:\\GPLIGC";}
if ($installdir !~ /(^.:\\)/) {print "give path with drive letter\n"; goto installdirinput;}
if ($installdir =~ /[;,!|<>\@\%\&\$\*\?\+]/) { # ~ are allowed. (8.3 aliases as progra~1) # \s removed, trying whitespaces...
print "Do not use whitespaces* and/or special characters in the PATH!\n"; #
goto installdirinput;
}
# check for old installation and configfile
$prev_install = 0;
if (-d $installdir) {
print "\n$installdir already exists... \n";
if (-f $installdir."/ogie.ini") {
print "Configurationfile (ogie.ini) detected... The new default configfile will be installed as ogie-new.ini\n";
$prev_install=1;
# move configfile to .old to avoid replacing
move("$installdir/ogie.ini", "$installdir/ogie-old.ini") || failed_cp();
}
if (-f $installdir."/opengligcexplorer.ini") {
print "Configurationfile (opengligcexplorer.ini) detected... The new default configfile will be installed as ogie-new.ini\n";
$prev_install=1;
# move configfile to .old to avoid replacing
move("$installdir/opengligcexplorer.ini", "$installdir/ogie-old.ini") || failed_cp();
}
}
# copying files
print "\ncopying files...\n";
my $cmd = "xcopy /f /r /i /e * \"$installdir\" ";
system($cmd) && failed_cp();
print "Finished copying files...\n";
# swap configfiles
if ($prev_install) {
print "new default config file (ogie.ini) will be installed as ogie-new.ini\n";
move("$installdir/ogie.ini", "$installdir/ogie-new.ini") || failed_cp();
move("$installdir/ogie-old.ini", "$installdir/ogie.ini") || failed_cp();
}
#################################################
# setting environment variables
print "\nTrying to set environment variables GPLIGCHOME and PATH\n";
# check for OS
($osname, $edition) = Win32::GetOSName();
print "\nYour operating system is: \"$osname\" \"$edition\" \n";
@autoexec_OSlist = qw(Win95 Win98 WinME); # these OS's require ENV setting via autoexec.bat
# these OS's require ENV setting via registry (not sure whether 2008/Win7 have the same structure of the registry... I hope so.
@registry_OSlist = qw(WinNT Win2000 Win2003 WinHomeSrv WinXP WinVista Win2008 Win7 Win8);
# untested, will try to use registy anyway
@untested_OSlist = qw(Win2003 WinHomeSrv Win2008 Win10);
foreach (@autoexec_OSlist) {
if ($osname =~ /$_/i) {
print "Sorry, $osname is not longer supported! Maybe it will work anyway..?\n";
print "GPLIGC/OGIE will be installed anyway.\n";
autoexec(); }
}
foreach (@registry_OSlist) {
if ($osname =~ /$_/i) { registry(); }
# ups NT seems to be still ok with cygwin 1.7
# if ($osname eq "WinNT") {
# print "Sorry, $osname is not longer supported (by cygwin). Consequently OGIE will not work!\n";
# }
}
foreach (@untested_OSlist) {
if ($osname =~ /$_/i) {
untested();
registry();
}
}
print "Sorry, I did not recognize your Windows version...\n";
print "You should write an Email to $email and tell me this: ->$osname<--->$edition<- \n";
failed_env();
install_end();
##############################################
# this adds some settings to AUTOEXEC.BAT
# win95 / 98 / ME
sub autoexec {
my $path_set = 0;
if ($ENV{winbootdir}) {
my $autoexec = substr($ENV{winbootdir},0,2) .'\autoexec.bat';
# make it writable if necessary
if (-e $autoexec && ! -w $autoexec) {
chmod 0755, $autoexec;
}
my @autoexec_bat;
# read autoexec.bat into @autoexec_bat
if (open(AUTOR, "<$autoexec")) {
@autoexec_bat = <AUTOR>;
} else { warn "Cannot read autoexec.bat\n"; failed_env(); install_end(); }
# alter autoexec_bat in mem
$alter = 0;
$home_line = 0;
for ($i=0; $i<=$#autoexec_bat; $i++) {
if ( $autoexec_bat[$i] =~ /GPLIGCHOME/ ) {
print "Found this line in autoexec.bat: $autoexec_bat[$i]\n";
$autoexec_bat[$i] = "SET GPLIGCHOME=$installdir\n";
$alter = 0.5; # half is done
$home_line = $i;
print "Changed to: $autoexec_bat[$i]\n";
# prev line is probably the PATH line added by old installscript
if ($autoexec_bat[$i-1] =~ /PATH/ ) {
print "Found this line in autoexec.bat: $autoexec_bat[$i-1]\n";
$autoexec_bat[$i-1] = "SET PATH=$installdir;%PATH%\n";
$alter = 1; # everything is done
print "Changed to: $autoexec_bat[$i-1]\n";
}
}
}
# hmmm, maybe we set the path a second time now...
# (if previous install wasnt made by the install-script!)
if ($alter == 0.5) {
splice(@autoexec_bat,$home_line,0, "SET PATH=$installdir;%PATH%\n");
print "The line SET PATH=$installdir;%PATH% was inserted before the line containing SET GPLIGCHOME\n";
}
if ($alter == 0) {
push(@autoexec_bat, "SET PATH=$installdir;%PATH%\n");
push(@autoexec_bat, "SET GPLIGCHOME=$installdir\n");
print "Environment varibles are set!\n";
}
# write back autoexec.bat
if (open(AUTOW, ">$autoexec")) {
print "writing back $autoexec ... \n";
# write autoexec_bat
foreach (@autoexec_bat) {
print AUTOW "$_";
}
close AUTOW;
$path_set=1;
} else {
warn "Unable to open $autoexec for writing: $!\n";
failed_env();
install_end();
}
} else {
warn "No winbootdir environment variable found.\n";
failed_env();
install_end();
}
unless ($path_set) {
failed_env();
install_end();
}
print "\nInstallation finished\nReboot to make the new settings in AUTOEXEC.BAT take effect\n";
install_end();
}
# this sets the path in the registry
sub registry {
## I'm not sure if on every (2000/NT4/XP) platform the environment is
## in the same place in registry....
print "Modifying registry...\n";
#$environment = $Registry->{"LMachine/System/CurrentControlSet/Control/Session Manager/Environment/"};
$environment = $Registry->{"CUser/Environment/"};
my $path = $environment->{"/Path"};
#print "Path : $path \n";
# nur wenn nicht schon drinnen /\: in $installdir????
$quotet_installdir=quotemeta($installdir);
if ($path !~ /$quotet_installdir/) {
# we have to put the new path before the rest (maybe there is an old installation?!
$path = $installdir.";".$path;
print "$installdir added to Path \n";
} else { print "Path already set...\n"; }
#setting environment variables in Registry
$environment->{"/Path"} = $path;
$environment->{"/GPLIGCHOME"} = $installdir;
$path_new = $environment->{"/Path"};
$installdir_new = $environment->{"/GPLIGCHOME"};
# check the reread values
my $failed = 0;
if ($path eq $path_new) {
print "\nPath is updated in HKEY_CURRENT_USER/Environment\n";
} else {
print "\nSetting Path in HKEY_CURRENT_USER/Environment _failed_ !!!\n";
$failed = 1;
}
if ($installdir eq $installdir_new) {
print "GPLIGCHOME is set in HKEY_CURRENT_USER/Environment\n";
} else {
print "Setting GPLIGCHOME in HKEY_CURRENT_USER/Environment _failed_ !!!\n";
$failed = 1;
}
if ($failed == 0) {
print "\nEnvironment Variables are set for current user!\n";
print "Log out and in to make changes in Registry take effect\n";
print "\nInstallation finished\n";
} else {
failed_env();
}
install_end();
}
##############################################
sub install_end {
print "Window will be closed in $close_delay seconds.\n";
sleep $close_delay;
exit ;
}
sub failed_env {
print "\Setting the environment variables failed.\n";
print "You need to set the enviroment variable GPLIGCHOME to $installdir\n";
print "and add $installdir to PATH by yourself.\n\n";
print "Hhow to do this is described in the GPLIGC-manual.\n";
$close_delay = 240;
}
sub failed_cp {
print "\nInstallation failed!";
print "Failure while copying or moving files... Maybe you do not have write permissions for $installdir ?!\n";
print "If you cannot solve this feel free to contact me $email\n";
$close_delay = 240;
install_end();
}
sub untested {
print "\nGPLIGC/OGIE have not yet been tested on your Windows platform!\n";
print "Please check whether the installation was succesfull and write my a short notice\n";
print ">>> $email \n";
print "provide this line with your report: >>>$osname<<< >>>$edition<<< \n";
print "Thank you very much!\n";
#$close_delay = 240;
}

65
win/makedist Executable file
View File

@ -0,0 +1,65 @@
#!/bin/bash
# define VERSION on cmdline
# usage:
# VERSION=1.xx-win32 makedist
# script for creating a windows distribution file
# works on MinGW32/msys platform
# additionally installed:
# freeglut-2.8.1 ./configure --without-x --prefix=/mingw
# jpeg-9a ./configure --prefix=/mingw
# we use and _ship_ gnuplot 4.2.6
# configure and build (only ogie/src)
cd ..
./configure
cd src
make
DOCS_WIN="../ChangeLog ../COPYING README_windows.txt"
PDFDOC="../doc/GPLIGC_Manual.pdf"
PERL_BIN="install_windows.pl ../perl/GPLIGC.pl ../perl/GPLIGCfunctions.pm ../perl/gpsp2igc.pl ../perl/gpsp2igcfile.pl ../perl/loopviewer.pl"
IMG="../images/logo*"
CONF="../src/.ogierc"
BIN_WIN="../src/*.exe"
# gnuplot 4.2.6 --> other versions need to be checked / compiled on mingw (dependencies)
GNUPLOT_BIN="../../gnuplot-4.2.6/bin/wgnuplot.exe"
GNUPLOT_HELP="../../gnuplot-4.2.6/bin/wgnuplot.hlp"
GNUPLOT_LIC="../../gnuplot-4.2.6/Copyright"
# dlls to ship
DLL="/mingw/bin/libglut-0.dll /mingw/bin/libjpeg-9.dll /mingw/bin/libstdc++-6.dll /mingw/bin/libgcc_s_dw2-1.dll"
# these have to be treated with unix2dos (files from DOCS_WIN need to be repeated here)
TRANSL_WIN="*.pm *.pl ogie.ini COPYING ChangeLog *.txt"
cd ../win
mkdir GPLIGC-$VERSION
cp -v $DOCS_WIN GPLIGC-$VERSION/
cp -v $PDFDOC GPLIGC-$VERSION/
cp -v $PERL_BIN GPLIGC-$VERSION/
cp -v $IMG GPLIGC-$VERSION/
cp -v $CONF GPLIGC-$VERSION/ogie.ini
cp -v $BIN_WIN GPLIGC-$VERSION/
cp -v $DLL GPLIGC-$VERSION/
# gnuplot
cp -v $GNUPLOT_BIN GPLIGC-$VERSION/
cp -v $GNUPLOT_HELP GPLIGC-$VERSION/
cp -v $GNUPLOT_LIC GPLIGC-$VERSION/Copyright-gnuplot
cd GPLIGC-$VERSION ; unix2dos $TRANSL_WIN
# default path in ogie.ini is changed to C:/GPLIGC
cd ..
perl -p -i.old -e "s#PREFIX/share/gpligc#C:/GPLIGC#g" GPLIGC-$VERSION/ogie.ini
rm GPLIGC-$VERSION/*.old
# create archive
zip -r gpligc-$VERSION.zip GPLIGC-$VERSION/
rm -rf GPLIGC-$VERSION